mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
fix(stream_chunk_builder): adding support for tool calling in completion counting
This commit is contained in:
parent
40d9e8ab23
commit
4cdd930fa2
3 changed files with 109 additions and 10 deletions
|
@ -140,12 +140,16 @@ class Message(OpenAIObject):
|
|||
self.role = role
|
||||
if function_call is not None:
|
||||
self.function_call = FunctionCall(**function_call)
|
||||
else:
|
||||
self.function_call = None
|
||||
if tool_calls is not None:
|
||||
self.tool_calls = []
|
||||
for tool_call in tool_calls:
|
||||
self.tool_calls.append(
|
||||
ChatCompletionMessageToolCall(**tool_call)
|
||||
)
|
||||
else:
|
||||
self.tool_calls = None
|
||||
if logprobs is not None:
|
||||
self._logprobs = logprobs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue