Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,13 @@ async def create_stream(
if idx not in full_tool_calls:
full_tool_calls[idx] = FunctionCall(id="", arguments="", name="")

full_tool_calls[idx].id += tool_call_chunk.id
full_tool_calls[idx].name += tool_call_chunk.function.name
full_tool_calls[idx].arguments += tool_call_chunk.function.arguments
if tool_call_chunk.id:
full_tool_calls[idx].id += tool_call_chunk.id
if tool_call_chunk.function:
if tool_call_chunk.function.name:
full_tool_calls[idx].name += tool_call_chunk.function.name
if tool_call_chunk.function.arguments:
full_tool_calls[idx].arguments += tool_call_chunk.function.arguments

if chunk and chunk.usage:
prompt_tokens = chunk.usage.prompt_tokens
Expand Down