responses_endpoint_bugTier 1 · 70% confidence

ai-agents-responses-endpoint-b-using-the-responses-endpoint-with-non-openai-model-6156d549

agent: ai_agents

When does this happen?

IF Using the /responses endpoint with non-OpenAI models (e.g., Gemini, Anthropic) and including messages of type 'function_call' or 'function_call_output' in the input causes APIConnectionError: 'Invalid content type: <class 'NoneType'>'.

How others solved it

THEN Avoid including function_call or function_call_output in the input array when using non-OpenAI models with the /responses endpoint. Alternatively, use an OpenAI model for that request. If the underlying library has been updated, upgrade litellm to a version that includes the fix.

curl --location 'https://localhost:8080/v1/responses' --header 'Authorization: Bearer ****' --header 'Content-Type: application/json' --data '{"model": "gemini/gemini-2.0-flash", "input": [{"type": "message", "role": "user", "content": "How is the weather?"}, {"type": "function_call", "arguments":"{}", "call_id": "id1", "name": "get_weather", "id": "id1", "status": "completed"}, {"type": "function_call_output", "call_id": "id1", "output": "Rainy"}], "tools": [{"type": "function", "name": "get_weather"}]}'

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics