Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a0ccca9
Add working ChatGenerator
Amnah199 Sep 22, 2025
8363ae6
rename
Amnah199 Sep 22, 2025
eba8123
Merge branch 'main' of https://github.com/deepset-ai/haystack into op…
Amnah199 Sep 24, 2025
18ce0e0
Improve and add live tests
Amnah199 Sep 24, 2025
ba14b18
Updates
Amnah199 Oct 8, 2025
eeec152
Update the tests
Amnah199 Oct 9, 2025
64052f7
Fix errors
Amnah199 Oct 9, 2025
ef4d0a7
Add release notes
Amnah199 Oct 10, 2025
149a47e
Merge branch 'main' into openai-responses
Amnah199 Oct 10, 2025
f3b41f2
Merge branch 'main' into openai-responses
Amnah199 Oct 10, 2025
50d5feb
Add support for openai tools
Amnah199 Oct 10, 2025
d1bea24
Merge branch 'openai-responses' of https://github.com/deepset-ai/hays…
Amnah199 Oct 10, 2025
f2ba387
Remove openai tools test that times out
Amnah199 Oct 12, 2025
830d086
fix tool calls
Amnah199 Oct 13, 2025
2c866f9
Update release notes
Amnah199 Oct 13, 2025
228a21b
PR comments
Amnah199 Oct 14, 2025
1b0ac65
remove edits to chat message
Amnah199 Oct 14, 2025
96e9343
Add a test
Amnah199 Oct 14, 2025
515474a
PR comments
Amnah199 Oct 15, 2025
9d8aa42
Send back reasoning to model
Amnah199 Oct 15, 2025
b1d6e80
Merge branch 'main' of https://github.com/deepset-ai/haystack into op…
Amnah199 Oct 21, 2025
9e414a9
Merge branch 'main' of https://github.com/deepset-ai/haystack into op…
Amnah199 Oct 22, 2025
00e6013
Fix reasoning support
Amnah199 Oct 22, 2025
419ec36
Add reasoning support
Amnah199 Oct 22, 2025
2a7f342
Fix tests
Amnah199 Oct 23, 2025
76db039
Refactor
Amnah199 Oct 23, 2025
0bab968
Simplify methods
Amnah199 Oct 23, 2025
8c8e031
Fix mypy
Amnah199 Oct 24, 2025
9107989
Stream responses, tool calls etc
Amnah199 Oct 24, 2025
fe07300
Update docstrings
Amnah199 Oct 24, 2025
c8083ba
Fix errors while using in Agent
Amnah199 Oct 30, 2025
40406aa
Fix call_id and fc_id
Amnah199 Oct 30, 2025
88760c0
Merge branch 'main' into openai-responses
Amnah199 Oct 31, 2025
d8949fc
Update tests
Amnah199 Oct 31, 2025
150b94a
Merge branch 'openai-responses' of https://github.com/deepset-ai/hays…
Amnah199 Oct 31, 2025
ed299f3
Updates
Amnah199 Nov 3, 2025
c973c8d
Add extra in ToolCall and ToolCallDelta
Amnah199 Nov 4, 2025
a0bb425
Update streaming chunk
Amnah199 Nov 4, 2025
412c26d
Fix tests and linting
Amnah199 Nov 4, 2025
41164ec
Merge branch 'main' into openai-responses
Amnah199 Nov 5, 2025
eb04021
Update api key resolve
Amnah199 Nov 5, 2025
d5c1717
Merge branch 'openai-responses' of https://github.com/deepset-ai/hays…
Amnah199 Nov 5, 2025
0ba664e
PR comments
Amnah199 Nov 5, 2025
90f8da5
PR comments
Amnah199 Nov 5, 2025
85064ee
Updates
sjrl Nov 6, 2025
c78e972
some type fixes and also make sure to use flatten_tools_or_toolsets
sjrl Nov 6, 2025
6cae697
fix docs
sjrl Nov 6, 2025
ac2cc2f
Fix streaming chunks so assistant header is properly captured
sjrl Nov 6, 2025
59f2064
Add finish_reason and update test
sjrl Nov 6, 2025
b8d4f02
Skip streaming + pydantic model test b/c of known issue in openai pyt…
sjrl Nov 6, 2025
334db3d
Fix pylint
sjrl Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/pydoc/config/generators_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ loaders:
"chat/hugging_face_local",
"chat/hugging_face_api",
"chat/openai",
"chat/openai_responses",
"chat/fallback",
]
ignore_when_discovered: ["__init__"]
Expand Down
1 change: 1 addition & 0 deletions docs/pydoc/config_docusaurus/generators_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ loaders:
"chat/hugging_face_local",
"chat/hugging_face_api",
"chat/openai",
"chat/openai_responses",
"chat/fallback",
]
ignore_when_discovered: ["__init__"]
Expand Down
2 changes: 2 additions & 0 deletions haystack/components/generators/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

_import_structure = {
"openai": ["OpenAIChatGenerator"],
"openai_responses": ["OpenAIResponsesChatGenerator"],
"azure": ["AzureOpenAIChatGenerator"],
"hugging_face_local": ["HuggingFaceLocalChatGenerator"],
"hugging_face_api": ["HuggingFaceAPIChatGenerator"],
Expand All @@ -21,6 +22,7 @@
from .hugging_face_api import HuggingFaceAPIChatGenerator as HuggingFaceAPIChatGenerator
from .hugging_face_local import HuggingFaceLocalChatGenerator as HuggingFaceLocalChatGenerator
from .openai import OpenAIChatGenerator as OpenAIChatGenerator
from .openai_responses import OpenAIResponsesChatGenerator as OpenAIResponsesChatGenerator

else:
sys.modules[__name__] = LazyImporter(name=__name__, module_file=__file__, import_structure=_import_structure)
824 changes: 824 additions & 0 deletions haystack/components/generators/chat/openai_responses.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion haystack/dataclasses/streaming_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ToolCallDelta:
index: int
tool_name: Optional[str] = field(default=None)
arguments: Optional[str] = field(default=None)
id: Optional[str] = field(default=None) # noqa: A003
id: Optional[str] = field(default=None)
extra: Optional[dict[str, Any]] = field(default=None)

def to_dict(self) -> dict[str, Any]:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
features:
- |
Added the OpenAIResponsesChatGenerator, a new component that integrates OpenAI's Responses API into Haystack.
This unlocks several advanced capabilities from the Responses API:
- Allowing retrieval of concise summaries of the model's reasoning process.
- Allowing the use of native OpenAI or MCP tool formats, along with Haystack Tool objects and Toolset instances.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What else do we support and integrate well from our ecosystem into Responses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Structured outputs could be one.


Example with reasoning and web search tool:
```python
from haystack.components.generators.chat import OpenAIResponsesChatGenerator
from haystack.dataclasses import ChatMessage

chat_generator = OpenAIResponsesChatGenerator(
model="o3-mini",
generation_kwargs={
{"summary": "auto", "effort": "low"}
},
tools=[{"type": "web_search"}]
)

response = chat_generator.run(
messages=[
ChatMessage.from_user("What's a positive news story from today?")
]
)
print(response["replies"][0].text)
```

Example with structured output:
```python
from pydantic import BaseModel
from haystack.components.generators.chat import OpenAIResponsesChatGenerator
from haystack.dataclasses import ChatMessage

class WeatherInfo(BaseModel):
location: str
temperature: float
conditions: str

chat_generator = OpenAIResponsesChatGenerator(
model="gpt-5-mini",
generation_kwargs={"text_format": WeatherInfo}
)

response = chat_generator.run(
messages=[ChatMessage.from_user("What's the weather in Paris?")]
)
```
Loading
Loading