Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Update checks
  • Loading branch information
Amnah199 committed Sep 2, 2025
commit 4bc8b650835391436d050093a13f1e43bf3f2a07
2 changes: 1 addition & 1 deletion haystack/components/generators/chat/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def __init__( # pylint: disable=too-many-positional-arguments
self.tools = tools # Store tools as-is, whether it's a list or a Toolset
self.tools_strict = tools_strict
self.http_client_kwargs = http_client_kwargs
self._response_format = generation_kwargs.get("response_format", None) if generation_kwargs else None
# Check for duplicate tool names
_check_duplicate_tool_names(list(self.tools or []))

Expand Down Expand Up @@ -406,6 +405,7 @@ def _prepare_api_call( # noqa: PLR0913
) -> dict[str, Any]:
# update generation kwargs by merging with the generation kwargs passed to the run method
generation_kwargs = {**self.generation_kwargs, **(generation_kwargs or {})}
self._response_format = generation_kwargs.get("response_format") if generation_kwargs else None

# adapt ChatMessage(s) to the format expected by the OpenAI API
openai_formatted_messages = [message.to_openai_dict_format() for message in messages]
Expand Down
Loading