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
..