Overview: external thinking models (gemini 3 in this particular example) are failing on the tool calling within the Agents SDK. It is happening because thinking parameter is not preserved in the tool calling.
Here is my sample code (taken straight from the documentation here: Using any model via LiteLLM - OpenAI Agents SDK ):
@function_tool
def get_weather(city: str):
print(f"[debug] getting weather for {city}")
return f"The weather in {city} is sunny."
async def main():
model="gemini/gemini-3-pro-preview" #gemini-2.5-flash-lite
api_key= ""
agent = Agent(
name="Assistant",
instructions="You only respond in haikus.",
model=LitellmModel(model=model, api_key=api_key),
model_settings=ModelSettings(reasoning={"effort": "low"}),
tools=[get_weather],
)
result = await Runner.run(agent, "What's the weather in Tokyo?")
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())
- When using non-reasoning model (like gemini-2.5-flash-lite) - code works
- When running gemini-3 without tool added - code works
- When running gemini-3 WITH tool added - code throws an exception:
“error”: {
“code”: 400,
“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:get_weather , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.”,
“status”: “INVALID_ARGUMENT”
}
As far as I understand it is currently not possible to run it like this - maybe someone has workarounds?