mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(anthropic.py): handle scenario where anthropic returns invalid json string for tool call while streaming
Fixes https://github.com/BerriAI/litellm/issues/5063
This commit is contained in:
parent
1008f24b16
commit
4919cc4d25
5 changed files with 105 additions and 7 deletions
|
@ -5113,7 +5113,9 @@ def stream_chunk_builder(
|
|||
prev_index = curr_index
|
||||
prev_id = curr_id
|
||||
|
||||
combined_arguments = "".join(argument_list)
|
||||
combined_arguments = (
|
||||
"".join(argument_list) or "{}"
|
||||
) # base case, return empty dict
|
||||
tool_calls_list.append(
|
||||
{
|
||||
"id": id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue