forked from phoenix/litellm-mirror
fix(utils.py): handle dict object for chatcompletionmessagetoolcall
This commit is contained in:
parent
e8c475b925
commit
f95458dad8
1 changed files with 5 additions and 2 deletions
|
@ -227,12 +227,15 @@ class ChatCompletionDeltaToolCall(OpenAIObject):
|
||||||
class ChatCompletionMessageToolCall(OpenAIObject):
|
class ChatCompletionMessageToolCall(OpenAIObject):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
function: Function,
|
function: Union[Dict, Function],
|
||||||
id: Optional[str] = None,
|
id: Optional[str] = None,
|
||||||
type: Optional[str] = None,
|
type: Optional[str] = None,
|
||||||
**params,
|
**params,
|
||||||
):
|
):
|
||||||
super(ChatCompletionMessageToolCall, self).__init__(**params)
|
super(ChatCompletionMessageToolCall, self).__init__(**params)
|
||||||
|
if isinstance(function, Dict):
|
||||||
|
self.function = Function(**function)
|
||||||
|
else:
|
||||||
self.function = function
|
self.function = function
|
||||||
|
|
||||||
if id is not None:
|
if id is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue