mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix(bedrock): omit empty content for tool call responses
This commit is contained in:
parent
8e21611702
commit
c04d5e5ea9
2 changed files with 3 additions and 0 deletions
|
|
@ -2250,6 +2250,8 @@ class AmazonConverseConfig(BaseConfig):
|
|||
)
|
||||
if filtered_tools:
|
||||
chat_completion_message["tool_calls"] = filtered_tools
|
||||
if chat_completion_message.get("content") == "":
|
||||
chat_completion_message["content"] = None
|
||||
|
||||
## CALCULATING USAGE - bedrock returns usage in the headers
|
||||
usage = self._transform_usage(
|
||||
|
|
|
|||
|
|
@ -781,6 +781,7 @@ def test_transform_response_with_computer_use_tool():
|
|||
encoding=None,
|
||||
)
|
||||
# Check that the tool call is present in the returned message
|
||||
assert result.choices[0].message.content is None
|
||||
assert result.choices[0].message.tool_calls is not None
|
||||
assert len(result.choices[0].message.tool_calls) == 1
|
||||
tool_call = result.choices[0].message.tool_calls[0]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue