spring-projects / spring-projects/spring-ai

Support Gemini Structured Outputs

Open
#4,426 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Expected Behavior

Currently, we cannot use structured outputs with Google Gemini models through Vertex. This is supported and would be extremely beneficial. We allow customers to define the output that they want the want to output in so we would want to pass this through to the API.

Current Behavior

We are currently including additional prompting to get Gemini to behave how the user wants, but there are times where this output is still not enforced.

Context

https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Vertex AI documentation on controlled generated output and trace how Spring AI currently handles Gemini requests and additional prompting. Identify the existing customer output-definition path, then verify that it reaches the Vertex API as structured output configuration and that responses follow the requested schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, java, spring
Domain
ai, api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.