Skip to content

Add JSON mode support for Gemini models #79

@KotlinFactory

Description

@KotlinFactory

Gemini models support a native JSON mode via the responseMimeType parameter, but this is not currently exposed through AnyLanguageModel.

Proposed Solution

Extend the existing GenerationOptions for GeminiLanguageModel.

  1. Set responseMimeType: "application/json" for Gemini requests
  2. Optionally supports responseSchema for typed JSON output

Use Case

Structured outputs for:

  • Data extraction
  • Tool/function calling
  • API response formatting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions