fix: improve type checking for tool calls in Google Gemini provider

This commit is contained in:
Soulter
2026-06-17 10:45:40 +08:00
parent d1b52d15b8
commit ada757bbb3

View File

@@ -371,9 +371,10 @@ class ProviderGoogleGenAI(Provider):
and thinking_signature
and "tool_calls" in message
and any(
tool.get("extra_content", {})
.get("google", {})
.get("thought_signature")
isinstance(tool, dict)
and isinstance(tool.get("extra_content"), dict)
and isinstance(tool["extra_content"].get("google"), dict)
and tool["extra_content"]["google"].get("thought_signature")
for tool in message["tool_calls"]
)
):