166 Commits

Author SHA1 Message Date
Stefano Fiorucci
e22c208232
test: improve some tests + retry others (#10239) 2025-12-15 09:41:36 +01:00
Vladimir Blagojevic
0c214c1f9a
feat: Update HuggingFaceLocalChatGenerator default model to Qwen/Qwen3-0.6B (#10176)
* Update HuggingFaceLocalChatGenerator default model to Qwen/Qwen3-0.6B

* Add enable_thinking init parameter

* Pydoc wording

* Format test

* Add tests for enable_thinking flag

* Add reno note for HuggingFaceLocalChatGenerator updates

* Update haystack/components/generators/chat/hugging_face_local.py

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

* Update release notes for HuggingFaceLocalChatGenerator

Updated the release notes to reflect changes in the HuggingFaceLocalChatGenerator, including the new default model and the addition of the enable_thinking parameter.

* Simplify test_live_run with/out enable_thinking flag

* Test shuffle

---------

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
2025-12-11 12:20:23 +01:00
David S. Batista
ca9c8a5ae6
fix: _handle_async_stream_response() in OpenAIChatGenerator handles asyncio.CancelledError closing the response stream (#10175)
* adding tests + fixing a test on openai_responses tests

* adding release notes

* fixing license header

* fixing license header

* Update releasenotes/notes/fix-OpenAIChatGenerator-handles-asyncio.CancelledError-closing-response-stream-37e1e85255e1dc41.yaml

Co-authored-by: Michele Pangrazzi <xmikex83@gmail.com>

---------

Co-authored-by: Michele Pangrazzi <xmikex83@gmail.com>
2025-12-10 13:06:51 +01:00
Sebastian Husch Lee
277f697a00
feat: Have components auto run warm_up on first use instead of erroring when not pre-warmed up (#10181)
* refactor

* Update tests

* Add reno

* Fix types

* fix type

* Fix test

* fix unit tests

* Add asserts to make mypy happy

* Fix unit test

* Update releasenotes/notes/refactor-warm-up-components-c2777fef28a70b61.yaml

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

* start getting rid of asserts

* remove more asserts

* remove last assert

* Remove assert

---------

Co-authored-by: David S. Batista <dsbatista@gmail.com>
2025-12-10 10:38:36 +01:00
OscarPindaro
bad2937aee
feat: add run async filter and automerging retriever (#9897)
* added run_async to filter retriever. implementation identical to run

* created a test for the FilterRetriever, with the same logic of the original sync test

* AutoMergingRetriever has now a run_async method identical to run, but with an async call on the document_store

* added async test, which contains async version of original run tests. discovered incorrect async await call in my previous commit

* modified documentation to specify that the method is asyncronous

* added patch file

* fixing typing error for filter_documents_async

* updating release notes

* fixing unit test

---------

Co-authored-by: Amna Mubashar <amnahkhan.ak@gmail.com>
Co-authored-by: David S. Batista <dsbatista@gmail.com>
2025-12-03 16:18:35 +01:00
Vladimir Blagojevic
152a16c82b
Fix flaky parallel tool test with stronger model (#10183)
Co-authored-by: David S. Batista <dsbatista@gmail.com>
2025-12-03 13:29:27 +00:00
Vladimir Blagojevic
adcd4ae361
chore: Update Azure default model to gpt-4.1-mini (#10167)
* Update Azure default model to gpt-4.1-mini

* Add version

* Version updates

* Experiment

* Update experiment with 2024-12-01-preview

* Fix test

* Add reno note

* Fix typo
2025-12-03 14:13:49 +01:00
Vladimir Blagojevic
3ebe9b2df2
chore: Update default OpenAI model to gpt-5-mini (#10144)
* Update default OpenAI model to gpt-5-mini

* Update tests

* Fix tool invoker tests

* Update integration tests

* Update fragile test

* More robust tests

* Harden test

* More test improvements

* Better prompting, to trigger tools

* Simplify

* Simplify more

* Simplify even more, less maintenance in the future

* Mark two integration tests flaky

* Fixing fine details

* Add release note for OpenAI default model update to gpt-5-mini

* Add upgrade section to OpenAI default model release note
2025-12-01 13:55:53 +01:00
Amna Mubashar
248b5a81a1
chore: increase test coverage for OpenAIResponsesChatGenerator (#10154)
* Update tests

* Add new tests

* Fix tests

* Small fixes

* Update openai_responses.py

---------

Co-authored-by: David S. Batista <dsbatista@gmail.com>
2025-11-29 04:11:38 +05:00
Amna Mubashar
538e483068
feat: return logprobs in OpenAIChatGenerator and OpenAIResponsesChatGenerator (#10035)
* Return logprobs

* Add log probs in responses

* Get logprobs from streaming

* Fix linting

* Update tests

* Fix formatting

* Update

* Fix tests

* Loosen up tests

* updates

* Update logprobs

* linting

* Fix test
2025-11-11 13:16:36 +01:00
Amna Mubashar
564780b768
fix: to_dict in OpenAIResponsesChatGenerator and json_schema for structured outputs (#10043)
* Fix to dict and json schema support

* Update Azure Responses

* Add tests

* Fix tests

* Fix tests

* remove print

* Change model

* Add a new test

* Loosen tests
2025-11-11 12:16:52 +01:00
Sebastian Husch Lee
4e19612a54
fix: Fix conversion of streaming chunks to chat message when handling reasoning content in OpenAIResponsesChatGenerator (#10036)
* Update information in streaming chunks and fix convert streaming chunks to chat message when handling reasoning content

* Fix unit test

* fix mypy

* try to make integration test more reliable

* Remove unused imports
2025-11-10 10:57:51 +01:00
Sebastian Husch Lee
bd927da680
feat: Add AzureOpenAIResponsesChatGenerator (#10019)
* Add working ChatGenerator

* rename

* Improve and add live tests

* Updates

* Update the tests

* Fix errors

* Add release notes

* Add support for openai tools

* Remove openai tools test that times out

* fix tool calls

* Update release notes

* PR comments

* remove edits to chat message

* Add a test

* PR comments

* Send back reasoning to model

* Fix reasoning support

* Add reasoning support

* Fix tests

* Refactor

* Simplify methods

* Fix mypy

* Stream responses, tool calls etc

* Update docstrings

* Fix errors while using in Agent

* Fix call_id and fc_id

* Update tests

* Updates

* Add extra in ToolCall and ToolCallDelta

* Update streaming chunk

* Fix tests and linting

* Update api key resolve

* PR comments

* PR comments

* Updates

* some type fixes and also make sure to use flatten_tools_or_toolsets

* fix docs

* Fix streaming chunks so assistant header is properly captured

* Add finish_reason and update test

* Skip streaming + pydantic model test b/c of known issue in openai python sdk https://github.com/openai/openai-python/issues/2305

* Fix pylint

* Initial commit adding AzureOpenAIResponsesChatGenerator support

* fix unit test

* Starting to refactor to use new recommended way to connect to Azure OpenAI

* Updates

* Fix tests

* More tests

* fix integration tests

* Add to docs

* Don't need warm_up method anymore

* fix unit test

* Fix pylint

* fix docstrings

* fix mypy typing

* fix reno

* Add another unit test

---------

Co-authored-by: Amna Mubashar <amnahkhan.ak@gmail.com>
2025-11-06 14:27:10 +01:00
Amna Mubashar
2a0a6f1bc6
feat: Add Chat Generator supporting OpenAI Responses API (#9808)
* Add working ChatGenerator

* rename

* Improve and add live tests

* Updates

* Update the tests

* Fix errors

* Add release notes

* Add support for openai tools

* Remove openai tools test that times out

* fix tool calls

* Update release notes

* PR comments

* remove edits to chat message

* Add a test

* PR comments

* Send back reasoning to model

* Fix reasoning support

* Add reasoning support

* Fix tests

* Refactor

* Simplify methods

* Fix mypy

* Stream responses, tool calls etc

* Update docstrings

* Fix errors while using in Agent

* Fix call_id and fc_id

* Update tests

* Updates

* Add extra in ToolCall and ToolCallDelta

* Update streaming chunk

* Fix tests and linting

* Update api key resolve

* PR comments

* PR comments

* Updates

* some type fixes and also make sure to use flatten_tools_or_toolsets

* fix docs

* Fix streaming chunks so assistant header is properly captured

* Add finish_reason and update test

* Skip streaming + pydantic model test b/c of known issue in openai python sdk https://github.com/openai/openai-python/issues/2305

* Fix pylint

---------

Co-authored-by: Sebastian Husch Lee <sjrl423@gmail.com>
2025-11-06 12:55:18 +01:00
HamidOna
6c78f1048c
feat: Add warm_up() method to ChatGenerators for tool initialization (#9942)
* Add warm_up() method to OpenAIChatGenerator

- Add warm_up() method that calls warm_up_tools()
- Add _is_warmed_up flag for idempotency
- Import warm_up_tools from haystack.tools
- Add comprehensive tests:
  - test_warm_up_with_tools: single tool case
  - test_warm_up_with_no_tools: no tools case
  - test_warm_up_with_multiple_tools: multiple tools case
- All tests passing

Part of issue #9907

* Add warm_up() method to AzureOpenAIChatGenerator

- Add warm_up() method that calls warm_up_tools()
- Add _is_warmed_up flag for idempotency
- Import warm_up_tools from haystack.tools
- Add comprehensive tests:
  - test_warm_up_with_tools: single tool case
  - test_warm_up_with_no_tools: no tools case
  - test_warm_up_with_multiple_tools: multiple tools case
- All tests passing

Part of issue #9907

* Add warm_up() method to HuggingFaceAPIChatGenerator

- Add warm_up() method that calls warm_up_tools()
- Add _is_warmed_up flag for idempotency
- Import warm_up_tools from haystack.tools
- Add comprehensive tests:
  - test_warm_up_with_tools: single tool case
  - test_warm_up_with_no_tools: no tools case
  - test_warm_up_with_multiple_tools: multiple tools case
- All tests passing

Part of issue #9907

* Enhance warm_up() method in HuggingFaceLocalChatGenerator

- Add warm_up_tools import from haystack.tools.utils
- Add _is_warmed_up flag for idempotency
- Enhance existing warm_up() to also warm up tools
- Preserve existing pipeline initialization logic
- Add comprehensive tests:
  - test_warm_up_with_tools: single tool case
  - test_warm_up_with_no_tools: no tools case
  - test_warm_up_with_multiple_tools: multiple tools case

Part of issue #9907

* Add warm_up() method to FallbackChatGenerator

- Add warm_up() method that delegates to underlying generators
- Uses hasattr check to gracefully handle generators without warm_up
- Add comprehensive tests:
  - test_warm_up_delegates_to_generators: verify delegation works
  - test_warm_up_with_no_warm_up_method: handle missing warm_up gracefully
  - test_warm_up_mixed_generators: mix of generators with/without warm_up
- All tests passing

Part of issue #9907

* docs: Add release notes for warm_up() feature

---------

Co-authored-by: HamidOna13 <abdulhamid.onawole@aizatron.com>
2025-10-29 11:06:55 +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
Vladimir Blagojevic
90edcdacee
feat: Add FallbackChatGenerator (#9859)
* Add FallbackChatGenerator

* Update licence files

* Use typing.Optional/Union for Python 3.9 compat

* Use the right logger

* Lint fix

* PR review

* Rewrite release note

* Add FallbackChatGenerator to docs

* Update haystack/components/generators/chat/fallback.py

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

* Rename generator -> chat_generators

* Lint

* Rename generators -> chat_generators in meta, docs, tests

* Update haystack/components/generators/chat/fallback.py

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

* Update pydocs

* Minor pydocs fix

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
Co-authored-by: Amna Mubashar <amnahkhan.ak@gmail.com>
2025-10-17 15:46:31 +02:00
Sebastian Husch Lee
0cd297adc8
docs: Update docstrings of OpenAI Generators to use max_completion_tokens (#9874)
* Update docstrings to use max_completion_tokens instead of deprecated max_tokens

* Change more instances of max_tokens

* update tests
2025-10-15 09:26:59 +00:00
Stefano Fiorucci
2a27e0d131
fix: fix OpenAIChatGenerator response_format serialization errors (#9858)
* fix: fix OpenAIChatGenerator response_format serialization errors

* relnote fix
2025-10-08 09:30:34 +00:00
Sebastian Husch Lee
143b0b00e8
tests: Add more tests for OpenAIChatGenerator with different response_format options (#9810)
* Fix: only put in response_format into api args if it's not None

* Add reno

* Add more tests

* Update test

* Remove test
2025-09-23 14:51:52 +02:00
Amna Mubashar
35c1cabb4e
feat: support structured outputs in OpenAIChatGenerator (#9754)
* Add parse for response format

* Update response_format

* Add tests

* Add release notes

* Update checks

* remove instance var

* Add tests for azure

* Add schema test

* Add comments

* Add streaming support

* PR comments

* PR comments

* Add tests

* Fix tests

* Add unit tests

* Update Azure files

* PR comments

* Small fix

* Include message.parsed

* Fix seriliaztion

* Update the async method

* Update release notes

* Loosen tests to prevent failure

* PR comments

* Fix release notes

* Fix error
2025-09-16 11:15:28 +02:00
Stefano Fiorucci
d38c32e393
chore: change model and provider for HF API multimodal test (#9715) 2025-08-18 10:00:12 +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
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
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
Amna Mubashar
8e792a3d12
fix: update _convert_streaming_chunks_to_chat_message to handle tool calls with empty arguments (#9639)
* Update util function

* Add a new test

* PR comments
2025-07-23 13:28:05 +02:00
Stefano Fiorucci
868ea41698
feat: add SentenceTransformersDocumentImageEmbedder (#9635) 2025-07-22 13:10:33 +02:00
Stefano Fiorucci
4d75ff42b4
feat: add ImageContent class methods (#9632) 2025-07-22 09:46:47 +02:00
Stefano Fiorucci
6a591bd027
feat: add ImageContent dataclass to include images in ChatMessage + OpenAI support (#9626) 2025-07-21 14:39:31 +02:00
Stefano Fiorucci
3fb2cef9e3
fix: test HFAPIChatGenerator with a different model (#9607) 2025-07-11 11:39:41 +02:00
Stefano Fiorucci
646eedf26a
chore: reenable HF API Embedders tests + improve HFAPIChatGenerator docstrings (#9589)
* chore: reenable some HF API tests + improve docstrings

* revert deletion
2025-07-04 09:39:43 +02: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
Sebastian Husch Lee
16fc41cd95
feat: Relax requirement for creating a ToolCallDelta dataclass (#9582)
* Relax our requirement for ToolCallDelta to better match ChoiceDeltaToolCall and ChoiceDeltaToolCallFunction from OpenAI

* Add reno

* Update tests
2025-07-03 08:50:29 +02:00
Stefano Fiorucci
848115c65e
fix: fix print_streaming_chunk + add tests (#9579)
* fix: fix print_streaming_chunk + add tests

* rel note
2025-07-01 16:49:18 +02:00
Sebastian Husch Lee
fc64884819
fix: Fix _convert_streaming_chunks_to_chat_message (#9566)
* Fix conversion

* Add reno

* Add unit test
2025-06-30 11:51:25 +02:00
Vladimir Blagojevic
91094e1038
feat: Add finish_reason field to StreamingChunk (#9536)
* Initial commit

* Update deprecation version

* Improve comment

* Minor simplification

* Add reno note

* Remove deprecation warning

* Remove fallback in haystack/components/generators/utils.py

* FinishReason alphabetical import

* Add tool_call_results finish reason, adapt codebase

* Define finish_reason to be Optional[FinishReason]

* Add StreamingChunk finish_reason in HF generators

* Update reno note

* Repair merge issue

* Update tests for finish_reason

* Resolve mypy issues

* Lint issue

* Enhance HF finish_reason translation

* Remove irrlevant test

* PR comments

---------

Co-authored-by: Sebastian Husch Lee <sjrl423@gmail.com>
2025-06-25 09:06:01 +00:00
Sebastian Husch Lee
ec371387f0
refactor: Update to StreamingChunk, better index setting and change tool_call to tool_calls (#9525)
* Fixes to setting StreamingChunk.index properly and refactoring tests for conversion

* Make _convert_chat_completion_chunk_to_streaming_chunk a member of OpenAIChatGenerator so we can overwrite it in integrations that inherit from it

* Fixes

* Modify streaming chunk to accept a list of tool call deltas.

* Fix tests

* Fix mypy and update original reno

* Undo change

* Update conversion to return a single streaming chunk

* update to print streaming chunk

* Fix types

* PR comments
2025-06-23 08:14:25 +00:00
Mohammed Abdul Razak Wahab
a28b2851d9
feat: Add async streaming support in HuggingFaceLocalChatGenerator (#9405)
* feat: Add async streaming support in hugging face generator

* enforce streamingcallback to be async

* refactor

* fix: schedule and await async task in Event Loop

* unenforce typecheck

* add integration test

* After merge fixes:
- fix breaking tests
- added component_info to AsyncHFTokenStreamingHandler

* fix integration test

* refactor: improve async handling in HuggingFaceLocalChatGenerator and update tests

* fix typo

* address review comments

* refactors

* typo

* refactor
2025-06-11 14:50:25 +00:00
Sebastian Husch Lee
b61886b138
feat: Update streaming chunk (#9424)
* Start expanding StreamingChunk

* First pass at expanding Streaming Chunk

* Working version!

* Some tweaks and also make ToolInvoker stream a chunk with a finish reason

* Properly update test

* Change to tool_name, remove kw_only since its python 3.10 only and update HuggingFaceAPIChatGenerator to start following new StreamingChunk

* Add reno

* Some cleanup

* Fix unit tests

* Fix mypy and integration test

* Fix pylint

* Start refactoring huggingface local api

* Refactor openai generator and chat generator to reuse util methods

* Did some reorg

* Reusue utility method in HuggingFaceAPI

* Get rid of unneeded default values in tests

* Update conversion of streaming chunks to chat message to not rely on openai dataclass anymore

* Fix tests and loosen check in StreamingChunk post_init

* Fixes

* Fix license header

* Add start and index to HFAPIGenerator

* Fix mypy

* Clean up

* Update haystack/components/generators/utils.py

Co-authored-by: Julian Risch <julian.risch@deepset.ai>

* Update haystack/components/generators/utils.py

Co-authored-by: Julian Risch <julian.risch@deepset.ai>

* Change StreamingChunk.start to only a bool

* PR comments

* Fix unit test

* PR comment

* Fix test

---------

Co-authored-by: Julian Risch <julian.risch@deepset.ai>
2025-06-06 08:17:02 +00:00
Stefano Fiorucci
f85ce19a32
test: replace tool calling model in tests with Qwen2.5-72B-Instruct (#9500) 2025-06-06 08:42:46 +02:00
Sebastian Husch Lee
5fcd7c4732
feat: Allow passing of additional parameters to HF Inference clients in HuggingFaceAPIChatGenerator and HuggingFaceAPIGenerator (#9457)
* Fix tests by allowing passing of provider

* Add reno

* Fix mypy

* Update release note
2025-06-03 10:21:51 +00:00
Sebastian Husch Lee
81c0cefa41
refactor: Refactor hf api chat generator (#9449)
* Refactor HFAPI Chat Generator

* Add component info to generators

* Fix type hint

* Add reno

* Fix unit tests

* Remove incorrect dev comment

* Move _convert_streaming_chunks_to_chat_message to utils file
2025-05-27 15:55:06 +02:00
Sebastian Husch Lee
db3d95b12a
refactor: Refactor openai generator (#9445)
* Refactor openai generator and chat generator to reusue same util methods

* Start fixing tests

* More fixes

* Fix mypy

* Fix
2025-05-27 12:44:17 +02:00
Amna Mubashar
64def6d41b
feat: add component name and type to StreamingChunk (#9426)
* Stream component name in openai

* Fix type

* PR comments

* Update huggingface gen

* Typing fix

* Update huggingfacelocal gen

* Fix errors

* Remove model changes

* Fix minor errors

* Update releasenotes/notes/add-component-info-dataclass-be115dee2fa50abd.yaml

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

* PR comments

* update annotation

* Update hf files

* Fix linting

* Add a from_component method

* use add_component

---------

Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
2025-05-27 12:23:40 +02:00
Stefano Fiorucci
d8487c4d8d
chore: make mypy run with --check-untyped-defs; fix some errors (#9447)
* chore: make mypy run with --check-untyped-defs; fix some errors

* small fixes

* use HfPipeline

* fix license error
2025-05-27 07:35:25 +00:00
David S. Batista
da60156174
chore: removing unused imports from tests (#9446) 2025-05-26 16:22:51 +00:00
Sebastian Husch Lee
af073852d0
feat: Add usage when using HuggingFaceAPIChatGenerator with streaming (#9371)
* Small fix and update tests

* Add usage support to streaming for HuggingFaceAPIChatGenerator

* Add reno

* try using provider='auto'

* Undo provider

* Fix unit tests

* Update releasenotes/notes/add-usage-hf-api-chat-streaming-91fd04705f45d5b3.yaml

Co-authored-by: Julian Risch <julian.risch@deepset.ai>

---------

Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
Co-authored-by: Julian Risch <julian.risch@deepset.ai>
2025-05-15 13:09:36 +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
Sebastian Husch Lee
9f2c0679d4
Small fix and update tests (#9370) 2025-05-12 22:02:26 +02:00