-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
If you call gemini3 via OpenRouter today, you get
agent_framework.exceptions.ServiceResponseException: <class 'agent_framework.openai._chat_client.OpenAIChatClient'> service failed to complete the prompt: Error code: 400 - {'error': {'message': 'Provider returned error', 'code': 400, 'metadata': {'raw': 'Gemini models require OpenRouter reasoning details to be preserved in each request. Please refer to our docs: https://openrouter.ai/docs/guides/best-practices/reasoning-tokens#preserving-reasoning-blocks. Upstream error: {\n "error": {\n "code": 400,\n "message": "Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:view_webpage` , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.",\n "status": "INVALID_ARGUMENT"\n }\n}\n', 'provider_name': 'Google AI Studio'}}, 'user_id': 'xxxxx'}
We should preserve the reasoning block as per the docs