haystack-core-integrations icon indicating copy to clipboard operation
haystack-core-integrations copied to clipboard

Add Toolset support in GoogleAIGeminiChatGenerator

Open vblagoje opened this issue 6 months ago • 0 comments

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 GoogleAIGeminiChatGenerator constructor and run / run_async signatures to accept tools: Optional[List[Tool | Toolset]].
  • Add unit tests that pass a nested Toolset containing ≥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.

vblagoje avatar May 12 '25 09:05 vblagoje