* feat: add support for torch xpu device support
* test: xpu based tests ci/cd
* test: add xpu code device support
---------
Co-authored-by: Sebastian Husch Lee <10526848+sjrl@users.noreply.github.com>
Co-authored-by: David S. Batista <dsbatista@gmail.com>
* feat(component.rankers): Add HuggingFace API (text-embeddings-inference for rerank) ranker component
* update test flow & doc loaders
* Support run_async for HuggingFaceAPIRanker
* Add release note for HuggingFace API support in component.rankers
* Add release note for HuggingFace API support in component.rankers
* Add release note for HuggingFace API support in component.rankers
* Add release note for HuggingFace API support in component.rankers
* fix:
1. `hugging_face_api.HuggingFaceAPIRanker` rename to `hugging_face_tei.HuggingFaceAPIRanker`
2. HuggingFaceAPIRanker: use our Secret API for token
3. add the missing modules for `docs/pydoc/config/rankers_api.yml`
4. added function `async_request_with_retry` for `haystack/utils/requests_utils.py` and added unittest on `test/utils/test_requests_utils.py`
4. HuggingFaceAPIRanker: refactor the retry function to support configuration based on attempts and status code.
5. HuggingFaceAPIRanker: refactor the test into unit tests using mocks
* fix(HuggingFaceTEIRanker): change the token check logic to use the resolve_value method.
* fix(format): run `hatch run format`
* fix:
- Force keyword-only arguments in __init__ method by adding *,
- Clarify token docstring that it's not always required
- Copy documents to avoid modifying original objects
- Remove test file from slow workflow
- Add monkeypatch eånvironment variable cleanup in tests
- Fix missing module in rankers_api.yml and sort modules alphabetically
- Remove unnecessary test info from release notes
* fix HuggingFaceTEIRanker:
- "None" of "Optional[Secret]" has no attribute "resolve_value"
- run/run_async: too many parameters
* fix(HuggingFaceTEIRanker) :Revise the docstring of the HuggingFaceTEIRanker, improve the parameter descriptions, ensure consistency and clarity. Add error handling information to enhance the readability of the API response.
* fix:unit test for HuggingFaceTEIRanker raise message
* fix fmt
* minor refinements
* refine release note
---------
Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
* 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
* Expand tests
* New version of type serialization
* Adding more tests
* More tests
* Fix type serialization when using python 3.9
* Deserialization works with Optional now and we don't require 'typing.' to be present anymore
* Don't worry about Literal
* Add reno
* Fix mypy
* Pylint
* Add additional test
* Simplify
* Add back comment
* Fix types
* Fix
* fix: callables can be deserialized from fully qualified import path
* fix: license header
* fix: format
* fix: types
* fix? types
* test: extend test case
* format
* add release notes
* Remove all references to old filter syntax
* More removals
* Lint
* Do not remove test_filter_retriever.py
* Add reno note
* Update ValueError text to match text in haystack-core-integrations
* Getting device_map working to support 8bit loading and multi device inference
* Update to take account the device specified by the user
* add release notes
* Add device_map support for ExtractiveReader
* Update test
* Update to model that doesn't have issues
* Update test
* Update pytest approx
* Update release notes
* Start supporting device map
* Update ExtractiveReader to use new ComponentDevice
* Update similarity ranker to follow extractive reader implementation
* Fixing pylint
* Make mypy mostly happy
* Add new unit test to test device_map
* Adding unit tests
* Some refactoring
* Add more tests
* Add more tests
* Add another unit test
* Update first_device property to return a ComponentDevice to be able to use the to methods
* Updating tests for test_device
* Update tests and now explicitly modify device_map in model_kwargs
* Update haystack/utils/hf.py
Co-authored-by: Madeesh Kannan <shadeMe@users.noreply.github.com>
* Make mypy happy
* mypy
* Remove unneeded optional flag
* Update ExtractiveReader with new logic
* Update ranker to follow new logic
* Removing unneeded code
* Make mypy happy
* fxi pylint
* Fix test
* Adding unit tests for device_map="auto"
* Add unit tests for ranker
* PR comments
* Make util method
* Adding unit tests
* Fix type annotation
* Fix pylint
* Fix test
---------
Co-authored-by: Madeesh Kannan <shadeMe@users.noreply.github.com>
* Add device checking and model_kwargs like we do in ExtractiveReader
* Add release notes
* Make a utility function for the device checking
* Better warning message and updated ExtractiveReader to use the util function
* Add unit tests for get_device
* Fix pylint
* #4071 implemented optional content moderation for OpenAI PromptNode
* added two simple integration tests
* improved documentation & renamed _invoke method to _execute_openai_request
* added a flag to check_openai_policy_violation that will return a full dict of all text violations and their categories
* re-implemented the tests as unit tests & without use of the OpenAI APIs
* removed unused patch
* changed check_openai_policy_violation back to only return a bool
* fixed pylint and test error
---------
Co-authored-by: Julian Risch <julian.risch@deepset.ai>
* Add step to loook up tokenizers by prefix in openai_utils
* Updated tiktoken min version + openai_utils test
* Added test case for GPT-4 and Azure model naming
* Broken down tests
* Added default case
---------
Co-authored-by: ZanSara <sara.zanzottera@deepset.ai>