mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix(invoke_handler.py): fix converse chunk parsing to only return empty dict on tool use
Fixes https://github.com/BerriAI/litellm/issues/9127
This commit is contained in:
parent
318a4fd9ed
commit
0b3c58665f
2 changed files with 9 additions and 3 deletions
|
@ -1231,7 +1231,9 @@ class AWSEventStreamDecoder:
|
|||
if len(self.content_blocks) == 0:
|
||||
return False
|
||||
|
||||
if "text" in self.content_blocks[0]:
|
||||
if (
|
||||
"toolUse" not in self.content_blocks[0]
|
||||
): # be explicit - only do this if tool use block, as this is to prevent json decoding errors
|
||||
return False
|
||||
|
||||
for block in self.content_blocks:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue