haystack-core-integrations
haystack-core-integrations copied to clipboard
Add Toolset support in GoogleAIGeminiChatGenerator
Is your feature request related to a problem? Please describe.
GoogleAIGeminiChatGenerator only accepts a flat List[Tool] for tools. Since Haystack 2.13 added the higher-level Toolset abstraction (see deepset-ai/haystack#9177), projects that rely on grouped/typed tooling have to manually flatten their Toolset into a list before calling Gemini. That’s annoying boilerplate, easy to get wrong, and inconsistent with other Haystack chat generators which now take Tool | Toolset interchangeably.
Describe the solution you’d like
- Extend the
GoogleAIGeminiChatGeneratorconstructor andrun/run_asyncsignatures to accepttools: Optional[List[Tool | Toolset]]. - Add unit tests that pass a nested
Toolsetcontaining ≥2 tools. - Update docs & type hints.
Describe alternatives you’ve considered Considered but N/A
Additional context
- Just like core ChatGenerators were updated in deepset-ai/haystack#9177; Gemini should behave the same for API parity.