Repository navigation
fix: preserve MockChatGenerator deserialization input - #13471
davidsbatista merged 5 commits into
Conversation
|
@wozhenbang2004 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @wozhenbang2004, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
|
Thanks for signing the CLA, @wozhenbang2004! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
Pull request was converted to draft
Pull request was converted to draft
|
Thanks for the review! The CLA was signed on b8261d9, but the new merge commit is still waiting for license/cla. The CLA Assistant link now returns “Bad credentials” and says there is no CLA to sign. Could you take a look at the integration? I couldn't find a recheck option. |
|
Thanks for signing the CLA, @wozhenbang2004! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
Related Issues
No existing issue found.
Proposed Changes
Loading the same serialized
MockChatGeneratorconfiguration twice currently fails:from_dict()replaces the caller's response dictionaries withChatMessageinstances and serialized callback names with callables. For example, a second load of a predefined-response configuration raisesTypeError: argument of type 'ChatMessage' is not iterable.Copy
init_parametersbefore deserializing its values and construct the generator from that copy. The original configuration remains serialized and can be reused.Extend the existing parametrized serialization roundtrip test to verify unchanged input and two successful loads for predefined responses, response functions, echo mode, and streaming callbacks. Add a release note.
How did you test it?
hatch run test:unit test/components/generators/chat/test_mock.py test/core/test_serialization.py test/utils/test_callable_serialization.py test/utils/test_deserialization.py -q --no-cov: 79 passed.hatch run fmt-check haystack/components/generators/chat/mock.py test/components/generators/chat/test_mock.py: passed.hatch run test:types --no-native-parser haystack/components/generators/chat/mock.py test/components/generators/chat/test_mock.py: passed.The default mypy native parser crashed while probing CPU affinity through psutil in this container. The supported
--no-native-parseroption completed successfully. Full-suite and live-provider tests were not run.Notes for the reviewer
This contribution was generated with an AI assistant. The diff received an independent source review and the relevant regression tests and checks were run. Human author review has not yet occurred.