Get all your news in one place.
100’s of premium titles.
One app.
Start reading
Android Central
Android Central
Technology
Brady Snyder

Google is making it easier to use the Gemini API in multi-agent workflows

A graphic for structured outputs in the Gemini API. .

What you need to know

  • Google's latest Gemini API update adds enhanced support for structured outputs.
  • JSON Schema in the Gemini API allows developers, businesses, and schools to ensure data consistency between AI workflows.
  • The functionality is helpful for agentic workflows and LLM processing.

Enjoy our content? Make sure to set Android Central as a preferred source in Google Search, and find out why you should so that you can stay up-to-date on the latest news, reviews, features, and more.

Google is updating the Gemini API to include better support for structured outputs, and the improvements will make it easier to use the API across multiple AI agents. The feature specifically adds support for JSON Schema, with allows the Gemini API to tap into data validation libraries like Pydantic and Zod. Previously, the Gemini API only support schemas based on the OpenAI 3.0 specification.

"Structured Outputs enable AI models to generate responses that guarantee adherence to a specific schema, which is important for tasks like data extraction and database population," Google explains in a blog post. "They are also important for agent communication: one agent’s output becomes another’s formatted input, enabling complex multi-agent systems to collaborate without translation layers."

JSON Schema support applies to all Gemini models that are still actively supported by Google, including all Gemini 2.5 models. One feature, implicit property ordering, also works with Google's OpenAI compatibility API. In the example code provided by Google below, you'll see the revised Gemini API in action, which keeps an identical order to the ordering of schema keys:

from google import genaifrom pydantic import BaseModel, Fieldfrom typing import Union, Literalclass SpamDetails(BaseModel):    """Details for content classified as spam."""    reason: str = Field(description="The reason why the content is considered spam.")    spam_type: Literal["phishing", "scam", "unsolicited promotion", "other"] = Field(description="The type of spam.")class NotSpamDetails(BaseModel):    """Details for content classified as not spam."""    summary: str = Field(description="A brief summary of the content.")    is_safe: bool = Field(description="Whether the content is safe for all audiences.")class ModerationResult(BaseModel):    """The result of content moderation."""    decision: Union[SpamDetails, NotSpamDetails]client = genai.Client()prompt = """Please moderate the following content and provide a decision.Content: 'Congratulations! You've won a free cruise to the Bahamas. Click here to claim your prize: www.definitely-not-a-scam.com'"""response = client.models.generate_content(    model="gemini-2.5-flash",    contents=prompt,    config={        "response_mime_type": "application/json",        "response_json_schema": ModerationResult.model_json_schema(),    },)recipe = ModerationResult.model_validate_json(response.text)print(recipe)

Structured outputs, including JSON Schema, are available in the Gemini API starting today. Users can check out the official documentation in Google's Gemini API Docs to learn more.

Gemini API's schema support is built for agentic AI systems

(Image credit: Android Central)

You might be wondering, how are structured outputs used in the real world? Google's answer to that question is simple: agentic AI. Google has been touting the future of agentic AI for a while now, starting with an appearance at Samsung's Galaxy Unpacked event in January 2025 and continuing at Google I/O in May 2025. There are consumer-facing projects that leverage agentic help, like Agent Mode, and more developer and enterprise tools — like the Gemini API.

In this case, businesses, schools, and developers can use the Gemini API to create multi-agent workflows for processing data. It ensures that schemas remain consistent across various AI agents and LLMs, which is critical for data processing an extraction. While you might not use structured outputs as the average Android user, you'll certainly encounter software applications that leverage the Gemini API's newest features.

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.