Skip to content

Commit

Permalink
adds a fix for tool arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Jan 24, 2025
1 parent 9a3fc89 commit 0abfe13
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ export function chunksIntoMessage(obs$: Observable<UnifiedChatCompleteResponse>)
if (concatenatedChunk.choices[0].message.content === '') {
concatenatedChunk.choices[0].message.content = null;
}
concatenatedChunk.choices[0].message.tool_calls?.forEach((toolCall: any) => {
if (toolCall.function?.arguments?.trim() === '') {
toolCall.function.arguments = '{}';
}
});
return concatenatedChunk;
})
)
Expand Down

0 comments on commit 0abfe13

Please sign in to comment.