mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix: wrap single-image tool_result in image_url object for Bedrock Converse
When a tool result contains a single image, the content field was set to the raw data URI string instead of being wrapped in a ChatCompletionImageObject, unlike the multi-item code path. This aligns the single-item path with the multi-item path. Fixes #24968
This commit is contained in:
parent
d1df4e838b
commit
5e24cf590b
1 changed files with 8 additions and 1 deletions
|
|
@ -480,7 +480,14 @@ class LiteLLMAnthropicMessagesAdapter:
|
|||
tool_call_id=content.get(
|
||||
"tool_use_id", ""
|
||||
),
|
||||
content=openai_image_url,
|
||||
content=[
|
||||
ChatCompletionImageObject(
|
||||
type="image_url",
|
||||
image_url=ChatCompletionImageUrlObject(
|
||||
url=openai_image_url
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
self._add_cache_control_if_applicable(
|
||||
content, tool_result, model
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue