Skip to content

Conversation

@julian-risch
Copy link
Member

@julian-risch julian-risch commented Jan 23, 2026

Related Issues

Proposed Changes:

How did you test it?

Notes for the reviewer

Simplifying AzureOpenAIResponsesChatGenerator to_dict
The only other class that I see could be updated is the AzureOpenAIResponsesChatGenerator but I decided against it. The current version makes it easier to understand in one location of the code how AzureOpenAIResponsesChatGenerator's Secret is serialized instead of spreading it across the AzureOpenAIResponsesChatGenerator class and the default_to_dict logic.

        # API key can be a secret or a callable
        serialized_api_key = (
            serialize_callable(self.api_key)
            if callable(self.api_key)
            else self.api_key.to_dict()
            if isinstance(self.api_key, Secret)
            else None
        )

We could do sth like

serialize_callable(self.api_key) if callable(self.api_key) else self.api_key

Happy to discuss.

Deprecating deserialize_document_store_in_init_params_inplace
deserialize_document_store_in_init_params_inplace is no longer used in Haystack and it also isn't used in any of the deepset maintained integrations in haystack-core-integrations. It would be still a breaking change to remove it, so we could deprecate it now and then remove it entirely in a later version of Haystack. If we decide to do that, I can open a separate PR. Happy to discuss this too.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel
Copy link

vercel bot commented Jan 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
haystack-docs Ignored Ignored Preview Jan 23, 2026 1:58pm

Request Review

@coveralls
Copy link
Collaborator

coveralls commented Jan 23, 2026

Pull Request Test Coverage Report for Build 21288641956

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 17 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.01%) to 92.445%

Files with Coverage Reduction New Missed Lines %
components/retrievers/filter_retriever.py 1 95.45%
components/retrievers/in_memory/bm25_retriever.py 2 95.83%
components/retrievers/sentence_window_retriever.py 6 93.88%
components/retrievers/in_memory/embedding_retriever.py 8 75.47%
Totals Coverage Status
Change from base Build 21284971239: -0.01%
Covered Lines: 14756
Relevant Lines: 15962

💛 - Coveralls

@julian-risch julian-risch changed the title chore: Simplify to_dict, from_dict with default (de-)serialization of objects chore: Simplify to_dict, from_dict with default (de-)serialization of objects Jan 23, 2026
@julian-risch julian-risch marked this pull request as ready for review January 23, 2026 11:57
@julian-risch julian-risch requested a review from a team as a code owner January 23, 2026 11:57
@julian-risch julian-risch requested review from anakin87 and removed request for a team January 23, 2026 11:57
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

I left two comments.

On the other points you brought up:

  • Ok with keeping AzureOpenAIResponsesChatGenerator as is
  • Let's deprecate deserialize_document_store_in_init_params_inplace as you suggest

@julian-risch julian-risch requested a review from anakin87 January 23, 2026 13:55
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Looks good!

@julian-risch julian-risch enabled auto-merge (squash) January 23, 2026 13:58
@julian-risch julian-risch merged commit 5e789ec into main Jan 23, 2026
21 checks passed
@julian-risch julian-risch deleted the simplify-serde-objects branch January 23, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify to_dict, from_dict with default (de-)serialization of init parameter objects that define to_dict, from_dict

4 participants