7 Commits

Author SHA1 Message Date
Sebastian Husch Lee
512dd86d97
feat: Add serialization and deserialization of Enum type when creating a PipelineSnaphsot (#9869)
* refactor tests

* Test refactoring and add failing test for enum

* Remove redundant method

* Slight refactoring

* refactoring

* simplification of _deserialize_value_with_schema and _deserialize_value

* Add some more TODOs

* Add support for enum serialization and deserialization

* types

* Add reno

* fix linting

* PR comments

* Add warning message

* dev comment
2025-10-14 10:28:19 +00:00
David S. Batista
10e05b679f
feat: save last AgentSnapshot when Agent crashes (#9774)
* raise last good snapshot in PipelineRunTimeError + tests updates

* adding release notes

* renaming test file

* wip: PoC generating Agent snapshot + host pipeline snapshot and saving it to disk

* wip: agent tool error generates a valid snapshot file

* dealing with function seralisation/deserialisation

* wip: fixing typing issues

* fixing typing issues

* wip

* fixing types

* fixing tests

* extending tests for sudden crash + breakpoints and resume

* adding release notes

* merginng pipeline tests into single file

* adding missing test file

* WIP: PR comments/improvments

* set test as integration test

* refactor: Updates to saving an AgentSnapshot if execution fails (#9781)

* Updates

* Fix circular import

* Fixes

* Fix license header

* fixing typing

* fixing typing

---------

Co-authored-by: David S. Batista <dsbatista@gmail.com>

* Update haystack/utils/base_serialization.py

Co-authored-by: Amna Mubashar <amnahkhan.ak@gmail.com>

* wip

* fixing tests

* updaing deserialisation

* updating more tests, reorganising breakpoints tests

* fixing bug in saving agent_snapshot

* updating tests

* updating tests

* updating tests

* adding tests for serialisation/deserialisation of functions

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
Co-authored-by: Amna Mubashar <amnahkhan.ak@gmail.com>
2025-09-16 09:46:35 +00:00
Sebastian Husch Lee
85258f0654
fix: Fix types and formatting pipeline test_run.py (#9575)
* Fix types in test_run.py

* Get test_run.py to pass fmt-check

* Add test_run to mypy checks

* Update test folder to pass ruff linting

* Fix merge

* Fix HF tests

* Fix hf test

* Try to fix tests

* Another attempt

* minor fix

* fix SentenceTransformersDiversityRanker

* skip integrations tests due to model unavailable on HF inference

---------

Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
2025-07-03 09:49:09 +02:00
Amna Mubashar
9ed0b9b0bc
fix: Update the de/serialization with schema utils (#9526)
* Update the util methods

* Update tests

* fix tests

* schema fix

* Add json schema for tuples and sets

* Add proper conversion for sets and tuples

* Adjust typing

* PR comments

* Linting

* Optimize deserialization

* remove TODO

* PR comments

* PR comments

* Update tests and deserialization error

* Support legacy deserialization

* Update deprecating warning

* Update test
2025-06-24 13:10:12 +02:00
David S. Batista
da60156174
chore: removing unused imports from tests (#9446) 2025-05-26 16:22:51 +00:00
Amna Mubashar
720cc19d7d
feat: add serialization to State / move State to agents.state (#9345)
* Add serialization to State

* Add release notes

* Deprecate State in dataclasses

* Fix tests

* Remove state_utils test

* Fix linting

* Fix formating

* Update tests and remove old state utils

* Update agents test

* Update deserilaization per review

* Linting

* Add tests for edge case (custom class types)

* Fix type serialization

* PR comments

* Move State to agents

* Fix tests

* Update utils init

* Improve seriliaztion/deser

* Update the release notes

* Minor fix in docstrings

* PR comments

* Add deprecation warnign for state utils

* Recreate the serialization methods to use schema

* Update key names

* Make serialization methods private
2025-05-23 11:04:15 +02:00
Madeesh Kannan
ee89f6ad57
fix: PyPDFToDocument correctly serializes custom converters, deprecate DefaultConverter (#8430)
* fix: `PyPDFToDocument` correctly serializes custom converters, deprecate `DefaultConverter`

* Remove `auto` prefix from serde util function names, add unit tests
2024-10-01 16:35:38 +02:00