forked from phoenix/litellm-mirror
set default tool calls and function call
This commit is contained in:
parent
20a796bacb
commit
81ad331d92
1 changed files with 7 additions and 7 deletions
|
@ -364,8 +364,6 @@ class ChatCompletionMessageToolCall(OpenAIObject):
|
|||
|
||||
|
||||
class Message(OpenAIObject):
|
||||
tool_calls: Optional[List[ChatCompletionMessageToolCall]]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
content="default",
|
||||
|
@ -378,13 +376,16 @@ class Message(OpenAIObject):
|
|||
super(Message, self).__init__(**params)
|
||||
self.content = content
|
||||
self.role = role
|
||||
self.tool_calls = []
|
||||
self.function_call = None
|
||||
|
||||
if function_call is not None:
|
||||
self.function_call = FunctionCall(**function_call)
|
||||
|
||||
if tool_calls is not None:
|
||||
self.tool_calls = []
|
||||
for tool_call in tool_calls:
|
||||
self.tool_calls.append(ChatCompletionMessageToolCall(**tool_call))
|
||||
self.tool_calls = [
|
||||
ChatCompletionMessageToolCall(**tool_call) for tool_call in tool_calls
|
||||
]
|
||||
|
||||
if logprobs is not None:
|
||||
self._logprobs = ChoiceLogprobs(**logprobs)
|
||||
|
@ -407,8 +408,7 @@ class Message(OpenAIObject):
|
|||
except:
|
||||
# if using pydantic v1
|
||||
return self.dict()
|
||||
|
||||
|
||||
|
||||
class Delta(OpenAIObject):
|
||||
tool_calls: Optional[List[ChatCompletionDeltaToolCall]]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue