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

Signed-off-by: <>
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Co-authored-by: Flora Feng <sfeng33@h100-01.nemg-001.lab.rdu2.dc.redhat.com>
Co-authored-by: Nicolò Lucchesi <nlucches@redhat.com>
This commit is contained in:
Flora Feng
2026-02-18 17:31:59 -05:00
committed by GitHub
parent e99ba957ec
commit 8d9babd4de
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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 "",