Skip to content

feat: Add support for GenAI (Google) GoogleGenAIChatGenerator structured output #2895

@aelhajj

Description

@aelhajj

Is your feature request related to a problem? Please describe.

GoogleGenAIChatGenerator doesn't support structured outputs. Users coming from OpenAIChatGenerator expect generation_kwargs={"response_format": MyModel} to work, but it's silently ignored.

Describe the solution you'd like

Accept response_format in generation_kwargs (Pydantic model or JSON schema dict) and internally translate it to Google's native response_schema + response_mime_type: "application/json" in GenerateContentConfig. Should work for both run() and run_async().

Describe alternatives you've considered

  • Passing response_schema + response_mime_type directly in generation_kwargs. Works but undocumented, requires Google SDK internals knowledge, and breaks cross-provider portability.
  • Wrapping the component in a custom pre-processing layer. Adds boilerplate and puts the burden on users.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIdeas to improve an integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions