4277 Commits

Author SHA1 Message Date
Stefano Fiorucci
95dafdc20b
fix: reintroduce helpful error message in ChatMessage deserialization (#9748)
* fix: reintroduce helpful error message in  deserialization

* fix fmt
2025-08-28 15:27:09 +02:00
Stefano Fiorucci
41b7ed4f47
docs: fix exit_conditions in Agent docstring (#9745)
* docs: fix exit_conditions in Agent docstring

* improvements
2025-08-28 07:44:20 +00:00
David S. Batista
ac6a43f5d3
feat: raise components inputs/outputs during execution if an Exception occurs (#9742)
* initial PoC idea running

* removing test code

* cleaning up

* wip

* cleaning up demos

* adding more pipelines to test persistence saving

* wip

* wip

* working example for logging components inputs in run time

* reverting to a simpler solution for intermediate results

* cleaning up

* testing that in a crash components outputs/inputs up to the crash point are returned

* adding tests for state persistance in a RAG pipeline

* updataing tests for state persistance in a RAG pipeline

* removing use cases of agent tests

* adding LICENSE header

* adding LICENSE header

* adding release notes

* updating tests for mocked components only

* updating release notes

* adapting PipelineRuntimeError

* cleaning up tests

* fixing test pipeline crash components inputs/outputs are saved

* fixing tests for state persistance

* isolating changes

* cleaning

* updating release notes

* addding test for regular pipeline

* small improvements and updating release notes

* cleaning imports

* removing code

* improvements/fixes based on PR comments

* raising pipeline_outputs on async version of Pipeline

* fixing async versions + updating tests

* simplifying tests

* Suggested changes pipeline crash (#9744)

* Suggested changes

* Some cleanup

* Small changes

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
2025-08-27 13:28:34 +02:00
Stefano Fiorucci
4275fed8c4
docs: add State to pydocs config (#9739) 2025-08-25 12:55:11 +02:00
Sebastian Husch Lee
be52c685cd
refactor: Refactor Agent logic for easier readability (#9726)
* Start refactor

* Update run_async to use the new code

* Slight updates

* Refactoring of tests

* Remove messages from execution context

* Cleanup

* More cleanup

* Formatting

* Fix some typing

* ignore typing issues

* Add reno

* Adding docstrings

* Small changes

* docstrings

* Updates

* Update haystack/components/agents/agent.py

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>

* PR comments

* PR comments

---------

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
2025-08-21 12:27:57 +00:00
Vladimir Blagojevic
30080567b8
fix: Propagate tracing context in sync ToolInvoker.run(...) (#9727)
* Propagate tracing context in sync ToolInvoker.run(...)

* Add reno note

* Fix mypy

* Fix mypy and preserve correct tool results

* Reuse code for context propagation in sync/async

* Cleanup

* Improve pydocs
2025-08-21 13:22:42 +02:00
Stefano Fiorucci
f4db645231
fix: OpenAIChatGenerator - improve the logic to exclude custom tool calls (#9725) 2025-08-20 08:26:03 +00:00
Sebastian Husch Lee
9fae8e3928
fix: Make output_type optional in MetadataRouter.from_dict for YAML loading (#9724)
* Make output type optional in yaml

* Add reno
2025-08-20 09:33:38 +02:00
David S. Batista
db661df313
removing unused parameter from breakpoint._create_pipeline_snapshot() (#9723) 2025-08-19 15:58:23 +02:00
David S. Batista
850a7c7385
fix: adding data/abbreviations as part of our repo + distribution (#9721)
* adding data/abbreviations as part of our repo

* adding release notes
2025-08-19 13:52:01 +02:00
Stefano Fiorucci
9a2722477f
chore: export ReasoningContent to haystack.dataclasses (#9722) 2025-08-19 11:08:29 +00:00
Haystack Bot
426cc01211
Update unstable version to 2.18.0-rc0 (#9720)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-08-19 11:22:05 +02:00
David S. Batista
2f7cb9e959
!fix: FileTypeRouter raising FileNotFound in a consistently manner (#9710)
* adding raise_on_failure and warning

* adding release notes

* reverting, adding wrongly removed file

* FileNotFoundError is raised both with and without metadata passed

* reverting to raise_on_failure

* Update releasenotes/notes/fix-filetype-router-inconsistencies-b22a3af00059f953.yaml

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

* adding warning and updating tests

* adding warning and updating tests

* updating docstring and warning

* updating release notes

* adding extra output key 'failed' and updating tests

* adding missed test file

* Update haystack/components/routers/file_type_router.py

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>

* Update haystack/components/routers/file_type_router.py

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>

* Update releasenotes/notes/fix-filetype-router-inconsistencies-b22a3af00059f953.yaml

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>

* test fixes

* remove duplicated tests

* updating log message

* Fix multi file converter

* updating release notes

* Update releasenotes/notes/fix-filetype-router-inconsistencies-b22a3af00059f953.yaml

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>

* improve relnote

* fixing typing

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
Co-authored-by: Sebastian Husch Lee <sjrl423@gmail.com>
v2.18.0-rc0
2025-08-19 11:12:14 +02:00
datbth
ff63d83b50
fix: copy context when invoking tool in ThreadPoolExecutor (#9717)
* fix: copy context when invoking tool in ThreadPoolExecutor

* chore: release note
2025-08-18 15:44:12 +02:00
Bohan Qu
919e4930f7
feat: support subclasses of ChatMessage in state schema validation (#9718) 2025-08-18 11:46:01 +02:00
Stefano Fiorucci
d38c32e393
chore: change model and provider for HF API multimodal test (#9715) 2025-08-18 10:00:12 +02:00
Saurabh Lingam
ae6f3bcf7c
fix: fix inconsistent top_k validation in SentenceTransformersDiversityRanker (#9698)
* Fix inconsistent top_k validation in SentenceTransformersDiversityRanker
- change elif to if in run() method to ensure top_k validation always
  runs regardless of whatever top_k comes from init or runtime
- Both scenarios now consistently raise ValueError with descriptive
  message format: 'top_k must be between 1 and X, but got Y'
- Fixes inconsistency where init top_k gave confusing MMR error while
  runtime top_k gave clear validation error

* improvements

---------

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
2025-08-14 17:34:29 +02:00
Michele Pangrazzi
9ce48f9509
fix: raise RuntimeError when AsyncPipeline.run() is called from within an async context (#9712)
* Raise RuntimeError when AsyncPipeline.run() is called from an async context

* Add release note
2025-08-14 15:07:21 +00:00
Stefano Fiorucci
8bb8b67f8a
ci: avoid coveralls blocking CI (#9713)
* ci: avoid coveralls blocking CI

* trigger unit tests

* remove trigger
2025-08-14 16:22:55 +02:00
Stefano Fiorucci
2259fb7b31
fix: fix wrong error message in Sentence Transformers Embedders (#9711) 2025-08-14 14:37:12 +02:00
Sebastian Husch Lee
c7256b2116
feat: Update source_id_meta_field in SentenceWindowRetriever to also accept a list of values (#9699)
* Make source_id_meta_field also work with a list of values

* Fix

* Add reno

* Update docstring

* Add unit test

* Update test

* Adding more tests and simplifying logic

* Simplify
2025-08-13 11:41:59 +02:00
Stefano Fiorucci
8160ea8bfc
feat: ToolInvoker - pass tools in run + general refactoring (#9704)
* draft

* more refactoring

* fixes

* tools in run + tests

* reorganize tests

* refinements

* relnote

* log overridden tools

* more static methods
2025-08-13 10:10:30 +02:00
JohnKagunda
b4bb6bde54
Fix/informative error message (#9661)
* fix: more informative error message when two components connect

* chore: releasenote

* fix: (PipelineBase.connect) disable C901 complexity check using noqa

* fix: (PipelineBase:connect) provided two exceptions: when  is not defined &&  is not defined

* test: added tests for the  related issues

* Update haystack/core/pipeline/base.py

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
2025-08-13 09:39:48 +02:00
dependabot[bot]
33b2b83ce8
chore(deps): bump actions/checkout from 4 to 5 (#9709)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-13 09:28:45 +02:00
Abdelrahman Kaseb
b9a34dfebf
Fix: prevent in-place mutation of documents in Document Classifiers and Extractors (#9703)
* modify Documents Classifiers and Extractors to not make in-place changes

* Add e2e test for NER

* Add unit test for NER

* fixes + refinements

---------

Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
2025-08-12 15:20:44 +02:00
Daria Fokina
f8d3a82997
Your commit message here (#9692) 2025-08-11 14:41:16 +02:00
Sebastian Husch Lee
af9aac2b99
chore!: Update finish reason in output of HuggingFaceAPIChatGenerator to match between stream and non-stream modes (#9686)
* Update finish reason

* Fix unit test

* Add reno

* Update releasenotes/notes/update-finish-reason-hf-api-chat-gen-c700042a079733e8.yaml

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

* Update async as well

* Fix unit test

---------

Co-authored-by: Amna Mubashar <amnahkhan.ak@gmail.com>
2025-08-11 13:52:16 +02:00
Abdelrahman Kaseb
03d9f0fd74
fix: prevent in-place mutation of documents in Document Embedders (#9693)
* fix: prevent in-place mutation of documents after embeddings by using deepcopy

* Add tests

* use from dataclasses import replace instead of deepcopy

* Address PR comments
2025-08-11 12:21:09 +02:00
Stefano Fiorucci
35e69369dc
feat: add ReasoningContent to ChatMessage (#9696)
* feat: add ReasoningContent to ChatMessage

* more tests

* release note

* Update haystack/dataclasses/chat_message.py

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

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
2025-08-11 10:01:31 +02:00
Amna Mubashar
683c935b38
feat: Update MetadataRouter to support ByteStream (#9688)
* Start changes for updating metadata router

* Update the router

* releasenotes/notes/add-bytestream-support-metadata-router-1ee5149745894f42.yaml

* Add release notes

* Fix error

* Update typing

* Update the typing

* PR comments

* Update param name

* Update type name

* Fix typo

* Remove type var

* Update typing

* Update typing

* Add overloads for all filter methods

* Use type ignore

* Remove unused imports

---------

Co-authored-by: Sebastian Husch Lee <sjrl423@gmail.com>
2025-08-08 16:21:27 +02:00
Stefano Fiorucci
95f00210e8
chore: OpenAI - explictly filter function tools (#9697) 2025-08-08 11:37:11 +02:00
Stefano Fiorucci
47508bc1e6
fix: fix OpenAI tests for openai==1.99.3 (#9694)
* fix: fix OpenAI tests for openai==1.99.3

* fix async tests
2025-08-08 06:40:57 +00: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
Chinmay Bansal
4b9fb20bab
feat: add image support to HuggingFaceAPIChatGenerator (#9680)
* feat(huggingface-api): #9671 add image support to HuggingFaceAPIChatGenerator

* docs: add release notes for image support in HuggingFaceAPIChatGenerator

* Fixed comments on PR: implementation, testing, default value for validation

* refinements

---------

Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
2025-08-06 16:35:32 +02:00
Stefano Fiorucci
441b487147
fix: ChatMessage bugfixes (#9682)
* fix: ChatMessage bugfixes

* fix + release note

* better condition
2025-08-06 09:29:05 +02:00
Bilge Yücel
323274e174
Add Haystack Enterprise section (#9674)
* Update README.md

* add a full stop

Co-authored-by: Daria Fokina <daria.fokina@deepset.ai>

* Change the enterprise link

---------

Co-authored-by: Daria Fokina <daria.fokina@deepset.ai>
2025-08-05 15:20:22 +02:00
Stefano Fiorucci
f8a71ecf39
feat: add serde methods to ImageContent and TextContent (#9679)
* ChatMessage - minor serde refactoring

* simplifications + more tests

* more tests + release notes
2025-08-05 11:17:08 +02:00
Abdelrahman Kaseb
d0de78ec0a
fix: ensure sentence_transformers_similarity score is a float to not np.float (#9665)
* fix: ensure sentence_transformers_similarity score is a float to prevent serialization issues

* solve PR comments
2025-08-04 11:28:05 +02:00
Daria Fokina
f2012a4521
docs-fix-syntax (#9670) 2025-07-31 16:26:00 +00:00
Sara Calla
61866ba9aa
chore: make the lazy import error message clearer (#9667)
* made the lazy import error message clearer

* add header
2025-07-31 16:10:14 +02:00
Stefano Fiorucci
ed48e9e965
test: fix Datadog tests and unpin ddtrace test dependency (#9659)
* test: fix Datadog tests and unpin ddtrace test dependency

* we need less env vars
2025-07-30 17:20:15 +02:00
Stefano Fiorucci
834a624cdc
chore: re-export missing symbols in __init__.py (#9662) 2025-07-30 10:06:38 +02:00
Sebastian Husch Lee
8efbfc0da6
Update documentation codeowners (#9658) 2025-07-29 17:06:04 +02:00
Stefano Fiorucci
1d96e6e4af
fix: ChatMessage.from_user - raise error if text and content_parts are None; pin ddtrace (#9657)
* fix: allow empty text in ChatMessage.from_user

* pin ddtrace<3.11.0
2025-07-29 12:39:27 +02:00
Sebastian Husch Lee
09476094fa
feat: Add support for the union operator | added in python 3.10 (#9650)
* Add support for | operator

* Add reno

* Use type(None) instead of NoneType

* Make custom UnionType private

* Add check that test should only run if python is 3.10+

* PR comments

* Update test/utils/test_type_serialization.py

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>

* Fix formatting

---------

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
2025-07-28 08:38:53 +00:00
Luca Rolshoven
f72ab7f63f
fix(embeddings): add encoding_format keyword argument when calling OpenAI's client.embeddings.create (#9655)
* fix(embeddings): add `encoding_format` keyword argument when calling OpenAI's `client.embeddings.create`.

* fix mypy

---------

Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
2025-07-28 08:26:39 +00:00
Haystack Bot
5c42256059
Update unstable version to 2.17.0-rc0 (#9653)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-07-24 13:06:40 +02:00
Stefano Fiorucci
23237f76d2
docs: fix DocumentLengthRouter usage example (#9652)
Co-authored-by: David S. Batista <dsbatista@gmail.com>
v2.17.0-rc0
2025-07-24 10:45:05 +00:00
David S. Batista
8af4cf8b01
chore: removing Pipeline.draw() deprecation warnings (#9651)
* cleaning up tests

* adding release notes
2025-07-24 12:35:19 +02:00