Unverified Commit 8d9babd4 authored by Flora Feng's avatar Flora Feng Committed by GitHub
Browse files

Fix empty tool_call_id in Anthropic messages API tool result conversion (#34745)



Signed-off-by: <>
Signed-off-by: default avatarsfeng33 <4florafeng@gmail.com>
Co-authored-by: default avatarFlora Feng <sfeng33@h100-01.nemg-001.lab.rdu2.dc.redhat.com>
Co-authored-by: default avatarNicolò Lucchesi <nlucches@redhat.com>
parent e99ba957
......@@ -40,6 +40,7 @@ class AnthropicContentBlock(BaseModel):
source: dict[str, Any] | None = None
# For tool use/result
id: str | None = None
tool_use_id: str | None = None
name: str | None = None
input: dict[str, Any] | None = None
content: str | list[dict[str, Any]] | None = None
......
......@@ -139,7 +139,7 @@ class AnthropicServingMessages(OpenAIServingChat):
openai_messages.append(
{
"role": "tool",
"tool_call_id": block.id or "",
"tool_call_id": block.tool_use_id or "",
"content": str(block.content)
if block.content
else "",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment