Feature/function calling update (#2700)
Co-authored-by: Mingyuan Ma <mamingyuan2001@berkeley.edu> Co-authored-by: Chayenne <zhaochen20@outlook.com> Co-authored-by: shuaills <shishuaiuoe@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ processes (TokenizerManager, DetokenizerManager, Controller).
|
||||
"""
|
||||
|
||||
import uuid
|
||||
from dataclasses import dataclass
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
@@ -540,3 +540,27 @@ class CloseSessionReqInput:
|
||||
class OpenSessionReqOutput:
|
||||
session_id: Optional[str]
|
||||
success: bool
|
||||
|
||||
|
||||
@dataclass
|
||||
class Function:
|
||||
description: Optional[str] = None
|
||||
name: Optional[str] = None
|
||||
parameters: Optional[object] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class Tool:
|
||||
function: Function
|
||||
type: Optional[str] = "function"
|
||||
|
||||
|
||||
@dataclass
|
||||
class FunctionCallReqInput:
|
||||
text: str # The text to parse.
|
||||
tools: List[Tool] = field(
|
||||
default_factory=list
|
||||
) # A list of available function tools (name, parameters, etc.).
|
||||
tool_call_parser: Optional[str] = (
|
||||
None # Specify the parser type, e.g. 'llama3', 'qwen25', or 'mistral'. If not specified, tries all.
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user