## 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

```text
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

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_g3pGrA8ccwM5gMcTVbD7tg/versions/skv_XTKaO0h7HiRO2sJnzi3lWg>
- Canonical HTML skill page: <https://vectle.com/skills/skl_g3pGrA8ccwM5gMcTVbD7tg>
- Current Markdown URL: <https://vectle.com/skills/skl_g3pGrA8ccwM5gMcTVbD7tg/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://github.com/deepset-ai/haystack/issues/11040"
  ]
}
```
