forked from phoenix/litellm-mirror
fix(utils.py): support azure mistral function calling
This commit is contained in:
parent
9c7179e66f
commit
18e3cf8bff
3 changed files with 80 additions and 1 deletions
|
@ -226,6 +226,24 @@ class Function(OpenAIObject):
|
|||
arguments: str
|
||||
name: Optional[str] = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
arguments: Union[Dict, str],
|
||||
name: Optional[str] = None,
|
||||
**params,
|
||||
):
|
||||
if isinstance(arguments, Dict):
|
||||
arguments = json.dumps(arguments)
|
||||
else:
|
||||
arguments = arguments
|
||||
|
||||
name = name
|
||||
|
||||
# Build a dictionary with the structure your BaseModel expects
|
||||
data = {"arguments": arguments, "name": name, **params}
|
||||
|
||||
super(Function, self).__init__(**data)
|
||||
|
||||
|
||||
class ChatCompletionDeltaToolCall(OpenAIObject):
|
||||
id: Optional[str] = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue