Skip to content

Commit

Permalink
fix: Multi-tools are not took from stream LLM
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jan 25, 2024
1 parent 43456ed commit d093932
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,7 @@ async def gpt_chat(
tools=tools,
):
if delta.content is None:
if delta.tool_calls:
piece = delta.tool_calls[0]
for piece in delta.tool_calls or []:
tool_calls[piece.index] = tool_calls.get(
piece.index,
{
Expand All @@ -823,7 +822,6 @@ async def gpt_chat(
else:
# Store whole content
full_content += delta.content
# Batch user return by sentence
buffer_content += delta.content
# Remove tool calls from buffer content, if any
buffer_content = _remove_message_actions(buffer_content)
Expand Down

0 comments on commit d093932

Please sign in to comment.