11 Commits

Author SHA1 Message Date
Sebastian Husch Lee 04435add0b fix: component tool schema description (#11909)
Co-authored-by: David S. Batista <dsbatista@gmail.com>
2026-07-09 14:27:53 +02:00
Sebastian Husch Lee e1ae2f4170 feat: Forward state to tools (#11064)
* adding injection of State or State | Optional with tests

* refactor to add new util function to reduce duplicate code

* Add reno

* update state docs
2026-04-09 14:56:50 +00:00
Stefano Fiorucci 819ed7244b chore: drop pylint (#10640)
* draft

* progress

* more fixes

* improvs

* strict

* rm pylint

* rm pylint comments

* fix and simplify

* standardize

* more

* alpha order

* final touch

* remove template

* rm ellipsis comments
2026-02-24 07:46:20 +00:00
Michele Pangrazzi 96b8bc5be3 Skip callables in component tool schema generation (#10362)
* Skip callables in component tool schema generation (eg snapshot_callback)

* Release note

* Fix formatting on release note

* Update test/tools/test_component_tool.py

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>

* Fix formatting

* Add same fix to create_tool_from_function

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
2026-01-13 16:19:59 +01:00
Stefano Fiorucci 7c6323b960 refactor: support PEP604 typing syntax (X|Y and X|None) (#10255)
* adopt X|Y syntax: draft

* cast Union

* fix pylint + state testing

* use X|Y

* rm unused imports

* trigger e2e tests

* fix + simplification

* add compatibility tests

* rm e2e tests trigger

* fix

* add relnote

* simplify/fix pep604 union parsing

* fix comments

* test _is_optional_type

* introduce _build_pep604_union_type; make _is_union_type private

* try removing problematic test
2025-12-19 15:47:51 +01:00
Vladimir Blagojevic 8098e9c6f6 feat: Update tools param to Optional[Union[list[Union[Tool, Toolset]], Toolset]] (#9886)
* Update tools param to Optional[Union[list[Union[Tool, Toolset]], Toolset]]

* Exclude tools from schema generation

* Different approach

* Lint

* Use ToolsType

* Fixes

* Reno note

* Update haystack/tools/utils.py

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>

* Update haystack/tools/serde_utils.py

Co-authored-by: tstadel <60758086+tstadel@users.noreply.github.com>

* Revert "Update haystack/tools/utils.py"

This reverts commit ebdec9115d46276b57a7459e566fd06c388ba51b.

* PR feedback

* Improve serde tests

* Update releasenotes/notes/mixed-tools-toolsets-support-d944c5770e2e6e7b.yaml

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>

* Pydoc polish

* Update FallbackChatGenerator for new ToolsType

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
Co-authored-by: tstadel <60758086+tstadel@users.noreply.github.com>
2025-10-20 09:26:22 +02:00
Stefano Fiorucci c05d3f0051 chore: remove unused type:ignore and cast (#9690)
* chore: remove unused type:ignore and casts

* rm unused imports
2025-08-07 15:41:00 +02:00
Abdelrahman Kaseb 5f3c37d287 chore: adopt PEP 585 type hints (#9678)
* chore(lint): enforce and apply PEP 585 type hinting

* Run fmt fixes

* Fix all typing imports using some regex

* Fix all typing written in string in tests

* undo changes in the e2e tests

* make e2e test use list instead of List

* type fixes

* remove type:ignore

* pylint

* Remove typing from Usage example comments

* Remove typing from most of comments

* try to fix e2e tests on comm PRs

* fix

* Add tests typing.List in to adjust test compatiplity
- test/components/agents/test_state_class.py
- test/components/converters/test_output_adapter.py
- test/components/joiners/test_list_joiner.py

* simplify pyproject

* improve relnote

---------

Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
2025-08-07 10:23:14 +02:00
Vladimir Blagojevic b69d261280 chore: Make docstring-parser core dep (#9477)
* Make docstring-parser core dep

* Add reno note
2025-06-05 11:28:18 +02:00
Vladimir Blagojevic f253db3e14 feat: ComponentTool - preserve docstrings from underlying pipeline components (#9403)
* ComponentTool - preserve docstrings from underlying pipeline components

* PR feedback, adjustments
2025-05-20 13:11:49 +02:00
Sebastian Husch Lee 9ae76e1653 Fix component tool parameters (#9342)
* Starting property schema refactor

* Adding more tests

* More tests

* Handle null type explicitly

* More updates of tests to accomodate Optional properly

* Fix more tests

* Remove unecessary check

* Some cleanup

* Update test

* Add reno

* Fix typing

* Add license header

* Use docstrings of dataclasses in parameter spec generation

* More tests of Haystack dataclass types

* Properly handle Sequence

* Fix license header

* Update OpenAI tests to add more complicated tool parameter signature

* Properly set required for dataclasses

* Add integration test for azure that includes additionalProperties

* Add more complicated integration test for HuggingFaceAPIChatGenerator

* Alternate approach using pydantic like we do in from_function.py

* Cleanup and fix other affected tests

* Fix mypy

* PR comments

* PR comment

* Remove test from HF API

* Update reno

* Update reno
2025-05-15 07:51:06 +00:00