Skip to content

Add support for GoogleGenAi service_tier in GoogleGenAiChatOptions #5900

@symphony-enrico

Description

@symphony-enrico

Expected Behavior

Users should be able to specify the service_tier parameter when making calls to Gemini through Spring AI's GoogleGenAi. This parameter should be configurable via GoogleGenAiChatOptions.

Example usage:

GoogleGenAiChatOptions.builder().model(modelName).serviceTier(GoogleGenAiServiceTier.FLEX) // or STANDARD or `priority`

Current Behavior
Currently, there's no way for users to set this parameter when making API calls to Gemini through Spring AI.

Context

  • Impact: Without this parameter, we cannot explicitly control the service tier for Gemini requests, which affects:
    • Cost management (different tiers have different pricing)
    • Performance characteristics (priority vs default processing)
    • Dedicated capacity usage (for enterprise deployments)
  • Use Case: We need to specify service tiers for:
    • Production workloads requiring guaranteed capacity ("priority")
    • Cost-sensitive applications ("standard")
    • Dynamic scaling scenarios ("flex")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions