forked from phoenix/litellm-mirror
fix(utils.py): fix default message object values
This commit is contained in:
parent
b2eef61679
commit
0f62213656
2 changed files with 3 additions and 4 deletions
|
@ -959,6 +959,7 @@ def completion(
|
||||||
model_response["choices"][0]["message"]["content"] = outputText
|
model_response["choices"][0]["message"]["content"] = outputText
|
||||||
elif (
|
elif (
|
||||||
hasattr(model_response.choices[0], "message")
|
hasattr(model_response.choices[0], "message")
|
||||||
|
and hasattr(model_response.choices[0].message, "tool_calls")
|
||||||
and model_response.choices[0].message.tool_calls is not None
|
and model_response.choices[0].message.tool_calls is not None
|
||||||
):
|
):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -245,14 +245,12 @@ class Message(OpenAIObject):
|
||||||
self.role = role
|
self.role = role
|
||||||
if function_call is not None:
|
if function_call is not None:
|
||||||
self.function_call = FunctionCall(**function_call)
|
self.function_call = FunctionCall(**function_call)
|
||||||
else:
|
|
||||||
self.function_call = function_call
|
|
||||||
if tool_calls is not None:
|
if tool_calls is not None:
|
||||||
self.tool_calls = []
|
self.tool_calls = []
|
||||||
for tool_call in tool_calls:
|
for tool_call in tool_calls:
|
||||||
self.tool_calls.append(ChatCompletionMessageToolCall(**tool_call))
|
self.tool_calls.append(ChatCompletionMessageToolCall(**tool_call))
|
||||||
else:
|
|
||||||
self.tool_calls = tool_calls
|
|
||||||
if logprobs is not None:
|
if logprobs is not None:
|
||||||
self._logprobs = logprobs
|
self._logprobs = logprobs
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue