fix(Gemini): update ToolCallRequest and OpenAICompatProvider to handle thought signatures in extra_content

This commit is contained in:
Yohei Nishikubo
2026-03-25 10:00:29 +08:00
committed by Xubin Ren
parent 7b720ce9f7
commit af84b1b8c0
4 changed files with 25 additions and 4 deletions
+1 -1
View File
@@ -14,6 +14,6 @@ def test_tool_call_request_serializes_provider_fields() -> None:
message = tool_call.to_openai_tool_call()
assert message["provider_specific_fields"] == {"thought_signature": "signed-token"}
assert message["extra_content"] == {"google": {"thought_signature": "signed-token"}}
assert message["function"]["provider_specific_fields"] == {"inner": "value"}
assert message["function"]["arguments"] == '{"path": "todo.md"}'
+2 -2
View File
@@ -40,7 +40,7 @@ def _fake_tool_call_response() -> SimpleNamespace:
id="call_123",
index=0,
function=function,
provider_specific_fields={"thought_signature": "signed-token"},
extra_content={"google": {"thought_signature": "signed-token"}},
)
message = SimpleNamespace(
content=None,
@@ -160,7 +160,7 @@ async def test_openai_compat_preserves_provider_specific_fields_on_tool_calls()
assert tool_call.function_provider_specific_fields == {"inner": "value"}
serialized = tool_call.to_openai_tool_call()
assert serialized["provider_specific_fields"] == {"thought_signature": "signed-token"}
assert serialized["extra_content"] == {"google": {"thought_signature": "signed-token"}}
assert serialized["function"]["provider_specific_fields"] == {"inner": "value"}