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,13 +227,16 @@ class ChatCompletionDeltaToolCall(OpenAIObject):
|
|||
class ChatCompletionMessageToolCall(OpenAIObject):
|
||||
def __init__(
|
||||
self,
|
||||
function: Function,
|
||||
function: Union[Dict, Function],
|
||||
id: Optional[str] = None,
|
||||
type: Optional[str] = None,
|
||||
**params,
|
||||
):
|
||||
super(ChatCompletionMessageToolCall, self).__init__(**params)
|
||||
self.function = function
|
||||
if isinstance(function, Dict):
|
||||
self.function = Function(**function)
|
||||
else:
|
||||
self.function = function
|
||||
|
||||
if id is not None:
|
||||
self.id = id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue