Skip to content
← Back to activity

Solution skill

Gemma 4 - OpenAIResponseChatGenerator Tool Input error

Version 2Sign in to save

Complete solution

Haystack: gemma 4 - OpenAIResponseChatGenerator Tool Input error. The verified fix is Fix: Maintainer anakin87: don't use OpenAIResponsesChatGenerator against non-OpenAI APIs - use the targeted Ollama integration (OllamaChatGenerator) instead, and for reasoning models like Gemma set think=True. Use this when you hit the symptoms above in haystack; not for unrelated haystack errors or general setup questions.

TL;DR

Fix: Maintainer anakin87: don't use OpenAIResponsesChatGenerator against non-OpenAI APIs - use the targeted Ollama integration (OllamaChatGenerator) instead, and for reasoning models like Gemma set think=True.

The error

Issue deepset-ai/haystack#11040 (closed, 14 comments): **Describe the bug** When running the ResponseChatGenerator in an Agent WITHOUT the exit conditions being a tool (So the tool feeds back into the generator) you get the following. haystack.core.errors.PipelineRuntimeError: The following component failed to run: Component name: 'Agent' Component type: 'Agent' Error: The following component failed to run: Component name: 'chat_generator' Component type: 'OpenAIResponsesChatGenerator' Error: Error code: 400 - {'error': {'message': 'input[3]: json: cannot unmarshal array into Go struct field ResponsesFunctionCallOutput.output of type string', 'typ

Fix

  1. Maintainer anakin87: don't use OpenAIResponsesChatGenerator against non-OpenAI APIs - use the targeted Ollama integration (OllamaChatGenerator) instead, and for reasoning models like Gemma set think=True.

Success check: the symptom above is gone and the original operation completes.

When to use

  • You hit this exact symptom in haystack.
  • You want the verified fix without digging through the thread.

When not to use

  • A different error in haystack, even a similar-looking one.
  • General haystack setup or credential questions.

Compatibility

  • Haystack (deepset-ai/haystack)

Variant phrasings

  • How to fix "gemma 4 - OpenAIResponseChatGenerator Tool Input error" in haystack
  • haystack: gemma 4 - OpenAIResponseChatGenerator Tool Input error
  • gemma 4 - OpenAIResponseChatGenerator Tool Input problem

Source

  • https://github.com/deepset-ai/haystack/issues/11040

Evidence

In gh:deepset-ai/haystack#11040 (https://github.com/deepset-ai/haystack/issues/11040), someone reported: Issue deepset-ai/haystack#11040 (closed, 14 comments): Describe the bug When running the ResponseChatGenerator in an Agent WITHOUT the exit conditions being a tool (So the tool feeds back into the generator) you get the following. haystack.core.errors.PipelineRuntimeError: The following component failed to run: Component name: 'Agent' Component type: 'Agent' Error: The following component failed to run: Component name: 'chat_generator' Component type: 'OpenAIResponsesChatGenerator' Error: Error code: 400 - {'error': {'message': 'input[3]: json: cannot unmarshal array into Go struct field ResponsesFunctionCallOutput.output of type string', 'typ The verified resolution from the thread: Maintainer anakin87: don't use OpenAIResponsesChatGenerator against non-OpenAI APIs - use the targeted Ollama integration (OllamaChatGenerator) instead, and for reasoning models like Gemma set think=True. A dedicated vLLM integration was in progress and worked with Gemma 4 (Chat Completions API; Responses API support was on the roadmap). Issue closed after the reporter confirmed the integration approach.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_g3pGrA8ccwM5gMcTVbD7tg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Gemma 4 - OpenAIResponseChatGenerator Tool Input error <span>— Vectle</span></a>