SPB Git

Repository Public

interactions-breaking-changes-may-2026.md 29.1 KB 938 lines markdown

1> [!CAUTION]2> **Breaking changes** : The changes described in this guide are3> breaking changes to the Interactions API. The legacy schema will be4> removed on **June 8, 2026** . Use the5> `Api-Revision` request header to6> [manage your migration](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#how-to-migrate).78The `v1beta` Interactions API is introducing breaking changes that restructure the9API shape to support future capabilities like mid-flight steering and10asynchronous tool calls. This page explains what's changing and provides11before-and-after code examples to help you migrate. There are two categories12of changes:13141. [**Steps schema**](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#steps-schema): A new `steps` array replaces the `outputs` array, providing a structured timeline of each interaction turn.152. [**Output format configuration**](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#output-format-config): A new polymorphic `response_format` consolidates all output format controls and removes `response_mime_type`.1617Follow the steps in [How to migrate to the new schema](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#how-to-migrate) to18update your integration.1920## Core change: `outputs` to `steps`2122The new schema replaces the `outputs` array with a `steps` array.2324- **Legacy** : Responses returned a flat `outputs` array containing only the model's generated content.25- **New schema** : Responses return a `steps` array containing structured steps with type discriminators.2627`POST /interactions` returns only output steps. `GET /interactions/{id}`28returns the full step timeline, including the initial `user_input` step.2930### Basic input/output (unary)3132#### Before (legacy)3334### Python3536    # Request37    interaction = client.interactions.create(38        model="gemini-3.8-flash", input="Tell me a joke."39    )4041    # Response access42    print(interaction.outputs[-1].text)4344### JavaScript4546    // Request47    const interaction = await client.interactions.create({48        model: 'gemini-3.8-flash',49        input: 'Tell me a joke.'50    });5152    // Response access53    console.log(interaction.outputs[-1].text);5455### REST5657    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \58      -H "Content-Type: application/json" \59      -d '{60        "model": "gemini-3.8-flash",61        "input": "Tell me a joke."62      }'6364    // Response65    {66      "id": "int_123",67      "role": "model",68      "outputs": \[69    {70    "type": "text",71    "text": "Why did the chicken cross the road?"72    }73    \]74    }7576#### After (new schema)7778### Python7980    # Request81    interaction = client.interactions.create(82        model="gemini-3.8-flash", input="Tell me a joke."83    )8485    # Response access (Recommended sugar)86    print(interaction.output_text)8788### JavaScript8990    // Request91    const interaction = await client.interactions.create({92        model: 'gemini-3.8-flash',93        input: 'Tell me a joke.'94    });9596    // Response access (Recommended sugar)97    console.log(interaction.output_text);9899> [!NOTE]100> **Note:** For details on SDK convenience properties (including `.output_text`, `.output_image`, and `.output_audio`), see \[Access outputs with SDK convenience properties\]\[sdk-convenience\] in the overview.101102\[sdk-convenience\]: /gemini-api/docs/interactions-overview#sdk-sugar103104### REST105106    # Opt-in needed before May 26th107    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \108      -H "Content-Type: application/json" \109      -H "Api-Revision: 2026-05-20" \\110      -d '{111        "model": "gemini-3.8-flash",112        "input": "Tell me a joke."113      }'114115    // POST Response116    {117      "id": "int_123",118      "steps": \[119    {120    "type": "model_output",121    "content": \[122    {123    "type": "text",124    "text": "Why did the chicken cross the road?"125    }126    \]127    }128    \]129    }130131    // GET /v1beta/interactions/int_123 (returns full timeline including input)132    {133      "id": "int_123",134      "steps": [135        {136          "type": "user_input",137          "content": [138            { "type": "text", "text": "Tell me a joke." }139          ]140        },141        {142          "type": "model_output",143          "content": [144            {145              "type": "text",146              "text": "Why did the chicken cross the road?"147            }148          ]149        }150      ]151    }152153### Function calling154155The request structure remains unchanged, but the response replaces the flat156`outputs` content with structured steps.157158#### Before (legacy)159160### Python161162    # Accessing function call in legacy schema163    for output in interaction.outputs:164        if output.type == "function_call":165            print(f"Calling {output.name} with {output.arguments}")166167### JavaScript168169    // Accessing function call in legacy schema170    for (const output of interaction.outputs) {171        if (output.type === 'function_call') {172            console.log(`Calling ${output.name} with ${JSON.stringify(output.arguments)}`);173        }174    }175176### REST177178    // Response179    {180      "id": "int_001",181      "role": "model",182      "status": "requires_action",183      "outputs": \[184    {185    "type": "thought",186    "signature": "abc123..."187    },188    {189    "type": "function_call",190    "id": "fc_1",191    "name": "get_weather",192    "arguments": { "location": "Boston, MA" }193    }194    \]195    }196197#### After (new schema)198199### Python200201    # Accessing function call in new steps schema202    for step in interaction.steps:203        if step.type == "function_call":204            print(f"Calling {step.name} with {step.arguments}")205206### JavaScript207208    // Accessing function call in new steps schema209    for (const step of interaction.steps) {210        if (step.type === 'function_call') {211            console.log(`Calling ${step.name} with ${JSON.stringify(step.arguments)}`);212        }213    }214215### REST216217    // POST Response218    {219      "id": "int_001",220      "status": "requires_action",221      "steps": \[222    {223    "type": "thought",224    "summary": \[{225    "type": "text",226    "text": "I need to check the weather in Boston..."227    }\],228    "signature": "abc123..."229    },230    {231    "type": "function_call",232    "id": "fc_1",233    "name": "get_weather",234    "arguments": { "location": "Boston, MA" }235    }236    \]237    }238239### Server-side tools240241Server-side tools (like Google Search or Code Execution) now yield specific242step types in the `steps` array. While the legacy schema returned these243operations as specific content types within the `outputs` array, the new schema244moves them into the `steps` array. The following examples use Google Search.245246#### Before (legacy)247248### Python249250    # Accessing search results in legacy schema251    for output in interaction.outputs:252        if output.type == "google_search_call":253            print(f"Searched for: {output.arguments.queries}")254        elif output.type == "google_search_result":255            print(f"Found results: {output.result.rendered_content}")256257### JavaScript258259    // Accessing search results in legacy schema260    for (const output of interaction.outputs) {261        if (output.type === 'google_search_call') {262            console.log(`Searched for: ${output.arguments.queries}`);263        } else if (output.type === 'google_search_result') {264            console.log(`Found results: ${output.result.renderedContent}`);265        }266    }267268### REST269270    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \271      -H "Content-Type: application/json" \272      -d '{273        "model": "gemini-3.8-flash",274        "input": "Who won the last Super Bowl?",275        "tools": [276          { "type": "google_search" }277        ]278      }'279280    // Response281    {282      "id": "int_456",283      "outputs": \[284    {285    "type": "google_search_call",286    "id": "gs_1",287    "arguments": { "queries": \["last Super Bowl winner"\] }288    },289    {290    "type": "google_search_result",291    "call_id": "gs_1",292    "result": {293    "rendered_content": "\<div\>...\</div\>",294    "url": "https://www.nfl.com/super-bowl"295    }296    },297    {298    "type": "text",299    "text": "The Kansas City Chiefs won the last Super Bowl.",300    "annotations": \[301    {302    "start_index": 4,303    "end_index": 22,304    "source": "https://www.nfl.com/super-bowl"305    }306    \]307    }308    \],309      "status": "completed"310    }311312#### After (new schema)313314### Python315316    # Accessing search results in new steps schema317    for step in interaction.steps:318        if step.type == "google_search_call":319            print(f"Searched for: {step.arguments.queries}")320        elif step.type == "google_search_result":321            print(f"Found results: {step.result[0].search_suggestions}")322323### JavaScript324325    // Accessing search results in new steps schema326    for (const step of interaction.steps) {327        if (step.type === 'google_search_call') {328            console.log(`Searched for: ${step.arguments.queries}`);329        } else if (step.type === 'google_search_result') {330            console.log(`Found results: ${step.result[0].search_suggestions}`);331        }332    }333334### REST335336    # Opt-in needed before May 26th337    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \338      -H "Content-Type: application/json" \339      -H "Api-Revision: 2026-05-20" \\340      -d '{341        "model": "gemini-3.8-flash",342        "input": "Who won the last Super Bowl?",343        "tools": [344          { "type": "google_search" }345        ]346      }'347348    // POST Response349    {350      "id": "int_456",351      "steps": \[352    {353    "type": "google_search_call",354    "id": "gs_1",355    "arguments": { "queries": \["last Super Bowl winner"\] },356    "signature": "abc123..."357    },358    {359    "type": "google_search_result",360    "call_id": "gs_1",361    "result": {362    "search_suggestions": "\<div\>...\</div\>"363    },364    "signature": "abc123..."365    },366    {367    "type": "model_output",368    "content": \[369    {370    "type": "text",371    "text": "The Kansas City Chiefs won the last Super Bowl.",372    "annotations": \[373    {374    "type": "url_citation",375    "url": "https://www.nfl.com/super-bowl",376    "title": "NFL.com",377    "start_index": 4,378    "end_index": 22379    }380    \]381    }382    \]383    }384    \],385      "status": "completed"386    }387388### Streaming389390Streaming exposes new event types:391392#### New event types393394- `interaction.created`395- `interaction.completed`396- `interaction.in_progress`397- `interaction.requires_action`398- `step.start`399- `step.delta`400- `step.stop`401402#### Deprecated event types403404The following legacy event types are replaced by the new events listed above:405406- `interaction.start` → `interaction.created`407- `content.start` → `step.start`408- `content.delta` → `step.delta`409- `content.stop` → `step.stop`410- `interaction.complete` → `interaction.completed`411- `interaction.status_update` → replaced by `interaction.in_progress`, `interaction.requires_action`, etc.412413**Streaming function calls** : When you use streaming with function calling,414the `step.start` event delivers the function name, and `step.delta` events415stream the arguments as partial JSON strings (using `arguments_delta`). You416must accumulate these deltas to get the full arguments. This differs from417unary calls where you receive the complete function call object at once.418419#### Examples420421##### Before (Legacy)422423### Python424425    # Legacy streaming used content.delta426    stream = client.interactions.create(427        model="gemini-3.8-flash",428        input="Explain quantum entanglement in simple terms.",429        stream=True,430    )431432    for chunk in stream:433        if chunk.event_type == "content.delta":434            if chunk.delta.type == "text":435                print(chunk.delta.text, end="", flush=True)436437### JavaScript438439    // Legacy streaming used content.delta440    const stream = await client.interactions.create({441        model: 'gemini-3.8-flash',442        input: 'Explain quantum entanglement in simple terms.',443        stream: true,444    });445446    for await (const chunk of stream) {447        if (chunk.event_type === 'content.delta') {448            if (chunk.delta.type === 'text') {449                process.stdout.write(chunk.delta.text);450            }451        }452    }453454### REST455456    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \457      -H "Content-Type: application/json" \458      -d '{459        "model": "gemini-3.8-flash",460        "input": "Explain quantum entanglement in simple terms.",461        "stream": true462      }'463464    // Response (SSE Lines)465    // event: interaction.start466    // data: {"id": "int_123", "status": "in_progress"}467    //468    // event: content.start469    // data: {"index": 0, "type": "text"}470    //471    // event: content.delta472    // data: {"delta": {"type": "text", "text": "Quantum entanglement is..."}}473    //474    // event: content.stop475    // data: {"index": 0}476    //477    // event: interaction.complete478    // data: {"id": "int_123", "status": "done", "usage": {"total_tokens": 42}}479480##### After (New Schema)481482### Python483484    # Consuming stream and handling new event types485    for event in client.interactions.create(486        model="gemini-3.8-flash",487        input="Tell me a story.",488        stream=True,489    ):490        if event.event_type == "step.delta":  # CHANGED: step.delta instead of content.delta491            if event.delta.type == "text":492                print(event.delta.text, end="")493494### JavaScript495496    // Consuming stream and handling new event types497    const stream = await client.interactions.create({498        model: 'gemini-3.8-flash',499        input: 'Tell me a story.',500        stream: true,501    });502503    for await (const event of stream) {504        if (event.event_type === 'step.delta') {  // CHANGED: step.delta instead of content.delta505            if (event.delta.type === 'text') {506                process.stdout.write(event.delta.text);507            }508        }509    }510511### REST512513     # Opt-in needed before May 26th514     curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \515       -H "Content-Type: application/json" \516       -H "Accept: text/event-stream" \517       -H "Api-Revision: 2026-05-20" \\518       -d '{519         "model": "gemini-3.8-flash",520         "input": "Tell me a story.",521         "stream": true522       }'523524     // Response (SSE Lines)525     // event: interaction.created526     // data: {"interaction": {"id": "int_xyz", "status": "in_progress", "object": "interaction", "model": "gemini-3.8-flash"}, "event_type": "interaction.created"}527     //528     // event: interaction.in_progress529     // data: {"interaction_id": "int_xyz", "event_type": "interaction.in_progress"}530     //531     // event: step.start532     // data: {"index": 0, "step": {"type": "thought", "signature": "abc123..."}, "event_type": "step.start"}533     //534     // event: step.stop535     // data: {"index": 0, "event_type": "step.stop"}536     //537     // event: step.start538     // data: {"index": 1, "step": {"content": [{"text": "Once upon", "type": "text"}], "type": "model_output"}, "event_type": "step.start"}539     //540     // event: step.delta541     // data: {"index": 1, "delta": {"text": " a time...", "type": "text"}, "event_type": "step.delta"}542     //543     // event: step.stop544     // data: {"type": "step.stop", "index": 1, "status": "done"}545     //546     // event: interaction.completed547     // data: {"type": "interaction.completed", "interaction": {"id": "int_xyz", "status": "completed", "usage": {"prompt_tokens": 10, "completion_tokens": 5, "total_tokens": 15}}} // NEW: Dedicated completion event548549### Stateless Conversation History550551If you manage conversation history manually on the client side (stateless use552case), you must update how you string along previous turns.553554- **Legacy** : Developers often collected the `outputs` array from responses and sent them back in the `input` field on the next turn.555- **New schema** : You should now collect the `steps` array from the response and pass it in the `input` field of the next request, appending your new user turn as a `user_input` step.556557## Output format configuration: `response_format` changes558559The updated API consolidates all output format controls into a unified,560polymorphic `response_format` field. This centralizes output configuration at561the top level and keeps `generation_config` focused on model behavior (like562temperature, top_p, and thinking).563564### Key changes565566- **The API removes `response_mime_type`.** You now specify the MIME type per format entry inside `response_format`.567- **`response_format` is now a polymorphic object (or array).** Each entry has a `type` discriminator (`text`, `audio`, `image`) and type-specific fields. To request multiple output modalities, pass an array of format entries.568- **`image_config` moves from `generation_config` to `response_format`.** You now specify image output settings like `aspect_ratio` and `image_size` in a `response_format` entry with `"type": "image"`.569570### Structured output (JSON)571572The new schema removes the `response_mime_type` field. Instead, specify the573MIME type and JSON schema inside a `response_format` object with574`"type": "text"`.575576#### Before (legacy)577578### Python579580    interaction = client.interactions.create(581        model="gemini-3.8-flash",582        input="Summarize this article.",583        response_mime_type="application/json",584        response_format={585            "type": "object",586            "properties": {587                "summary": {"type": "string"}588            }589        },590    )591592    print(interaction.outputs[-1].text)593594### JavaScript595596    const interaction = await client.interactions.create({597        model: 'gemini-3.8-flash',598        input: 'Summarize this article.',599        response_mime_type: 'application/json',600        response_format: {601            type: 'object',602            properties: {603                summary: { type: 'string' }604            }605        },606    });607608    console.log(interaction.outputs[-1].text);609610### REST611612    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \613      -H "Content-Type: application/json" \614      -d '{615        "model": "gemini-3.8-flash",616        "input": "Summarize this article.",617        "response_mime_type": "application/json",618        "response_format": {619          "type": "object",620          "properties": {621            "summary": { "type": "string" }622          }623        }624      }'625626#### After (new schema)627628### Python629630    interaction = client.interactions.create(631        model="gemini-3.8-flash",632        input="Summarize this article.",633        # response_mime_type is removed --- specify mime_type inside response_format634        response_format={635            "type": "text",636            "mime_type": "application/json",637            "schema": {638                "type": "object",639                "properties": {640                    "summary": {"type": "string"}641                }642            }643        },644    )645646    # Print response647    print(interaction.output_text)648649### JavaScript650651    const interaction = await client.interactions.create({652        model: 'gemini-3.8-flash',653        input: 'Summarize this article.',654        // response_mime_type is removed --- specify mime_type inside response_format655        response_format: {656            type: 'text',657            mime_type: 'application/json',658            schema: {659                type: 'object',660                properties: {661                    summary: { type: 'string' }662                }663            }664        },665    });666667    // Print response668    console.log(interaction.output_text);669670### REST671672    # Opt-in needed before May 26th673    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \674      -H "Content-Type: application/json" \675      -H "Api-Revision: 2026-05-20" \\676      -d '{677        "model": "gemini-3.8-flash",678        "input": "Summarize this article.",679        "response_format": {680          "type": "text",681          "mime_type": "application/json",682          "schema": {683            "type": "object",684            "properties": {685              "summary": { "type": "string" }686            }687          }688        }689      }'690691### Image configuration692693The new schema removes `image_config` from `generation_config`. You now specify694image output settings in a `response_format` entry with `"type": "image"`.695696#### Before (legacy)697698### Python699700    interaction = client.interactions.create(701        model="gemini-3.8-flash",702        input="Generate an image of a sunset over the ocean.",703        generation_config={704            "image_config": {705                "aspect_ratio": "1:1",706                "image_size": "1K"707            }708        },709    )710711### JavaScript712713    const interaction = await client.interactions.create({714        model: 'gemini-3.8-flash',715        input: 'Generate an image of a sunset over the ocean.',716        generation_config: {717            image_config: {718                aspect_ratio: '1:1',719                image_size: '1K'720            }721        },722    });723724### REST725726    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \727      -H "Content-Type: application/json" \728      -d '{729        "model": "gemini-3.8-flash",730        "input": "Generate an image of a sunset over the ocean.",731        "generation_config": {732          "image_config": {733            "aspect_ratio": "1:1",734            "image_size": "1K"735          }736        }737      }'738739#### After (new schema)740741### Python742743    interaction = client.interactions.create(744        model="gemini-3.8-flash",745        input="Generate an image of a sunset over the ocean.",746        # image_config is removed from generation_config --- use response_format747        response_format={748            "type": "image",749            "mime_type": "image/jpeg",750            "aspect_ratio": "1:1",751            "image_size": "1K"752        },753    )754755### JavaScript756757    const interaction = await client.interactions.create({758        model: 'gemini-3.8-flash',759        input: 'Generate an image of a sunset over the ocean.',760        // image_config is removed from generation_config --- use response_format761        response_format: {762            type: 'image',763            mime_type: 'image/jpeg',764            aspect_ratio: '1:1',765            image_size: '1K'766        },767    });768769### REST770771    # Opt-in needed before May 26th772    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \773      -H "Content-Type: application/json" \774      -H "Api-Revision: 2026-05-20" \\775      -d '{776        "model": "gemini-3.8-flash",777        "input": "Generate an image of a sunset over the ocean.",778        "response_format": {779          "type": "image",780          "mime_type": "image/jpeg",781          "aspect_ratio": "1:1",782          "image_size": "1K"783        }784      }'785786### Audio configuration787788The new schema replaces `response_modalities: ["audio"]` with a `response_format` entry of `"type": "audio"`.789790#### Before (legacy)791792### Python793794    interaction = client.interactions.create(795        model="gemini-3.1-flash-tts-preview",796        input="Say cheerfully: Have a wonderful day!",797        response_modalities=["audio"],798        generation_config={799            "speech_config": [800                {"voice": "Kore"}801            ]802        }803    )804805### JavaScript806807    const interaction = await client.interactions.create({808        model: 'gemini-3.1-flash-tts-preview',809        input: 'Say cheerfully: Have a wonderful day!',810        response_modalities: ['audio'],811        generation_config: {812            speech_config: [813                { voice: 'Kore' }814            ]815        },816    });817818### REST819820    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \821      -H "Content-Type: application/json" \822      -d '{823        "model": "gemini-3.1-flash-tts-preview",824        "input": "Say cheerfully: Have a wonderful day!",825        "response_modalities": ["audio"],826        "generation_config": {827          "speech_config": [828            { "voice": "Kore" }829          ]830        }831      }'832833#### After (new schema)834835### Python836837    interaction = client.interactions.create(838        model="gemini-3.1-flash-tts-preview",839        input="Say cheerfully: Have a wonderful day!",840        # response_modalities is removed --- use response_format841        response_format={842            "type": "audio"843        },844        generation_config={845            "speech_config": [846                {"voice": "Kore"}847            ]848        }849    )850851### JavaScript852853    const interaction = await client.interactions.create({854        model: 'gemini-3.1-flash-tts-preview',855        input: 'Say cheerfully: Have a wonderful day!',856        // response_modalities is removed --- use response_format857        response_format: {858            type: 'audio'859        },860        generation_config: {861            speech_config: [862                { voice: 'Kore' }863            ]864        },865    });866867### REST868869    # Opt-in needed before May 26th870    curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \871      -H "Content-Type: application/json" \872      -H "Api-Revision: 2026-05-20" \873      -d '{874        "model": "gemini-3.1-flash-tts-preview",875        "input": "Say cheerfully: Have a wonderful day!",876        "response_format": {877          "type": "audio"878        },879        "generation_config": {880          "speech_config": [881            { "voice": "Kore" }882          ]883        }884      }'885886To request multiple output modalities (for example, text and audio together),887pass an array of format entries to `response_format` instead of a single888object.889890## How to migrate to the new schema891892### SDK users893894Upgrade to the latest SDK version (Python ≥2.0.0, JavaScript ≥2.0.0). The895SDK automatically opts you into the new schema --- no code changes needed beyond896updating how you read responses (see examples above). Note that only the new897schema is supported in these SDK versions. Older SDK versions898(Python 1.x.x, JavaScript 1.x.x) will continue to work until the legacy899schema is removed on **June 8, 2026**.900901### REST API users902903Add the `Api-Revision: 2026-05-20` header to your requests to opt in to904the new schema now. After **May 26** , the new schema becomes the default for all905requests. You can temporarily opt out with `Api-Revision: 2026-05-07`906until **June 8**, when the API permanently removes the legacy schema.907908### Timeline909910| Date | Phase | SDK users | REST API users |911|---|---|---|---|912| **May 7** | Opt-in | New SDK version available (Python ≥2.0.0, JS ≥2.0.0). Upgrade to get the new schema automatically. | Add `Api-Revision: 2026-05-20` header to opt in. Default remains legacy. |913| **May 26** | Default flip | No action needed if already upgraded. Older SDKs (Python 1.x.x, JS 1.x.x) still work but return legacy responses. | New schema is now the default. Send `Api-Revision: 2026-05-07` header to opt out. |914| **June 8** | Sunset | Python 1.x.x and JS 1.x.x SDK versions will break for Interactions API calls. | Legacy schema removed for Interactions API. `Api-Revision` header ignored. |915916> [!NOTE]917> **Note** : New features shipped after May 7 will only918> appear in `steps` responses. Users on the legacy `outputs`919> schema will not receive new capabilities until they migrate.920921## Migration Checklist922923### Steps schema (`steps`)924925- Update code to read response content from the `steps` array instead of `outputs`. [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#basic-unary).926- Verify that your code handles both `user_input` and `model_output` step types. [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#basic-unary).927- (Function Calling) Update code to find `function_call` steps in the `steps` array. [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#function-calling).928- (Server-Side Tools) Update code to handle tool-specific steps (e.g., `google_search_call`, `google_search_result`). [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#server-side-tools).929- (Stateless History) Update history management to pass the `steps` array in the `input` field of the next request. [See details](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#stateless-history).930- (Streaming only) Update client to listen for new SSE event types (`interaction.created`, `step.delta`, etc.). [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#streaming).931932### Output format configuration (`response_format`)933934- Replace `response_mime_type` with a `mime_type` field inside `response_format`. [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#structured-output).935- Wrap your existing `response_format` JSON schema inside a `{"type": "text", "schema": ...}` object. [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#structured-output).936- (Image Generation) Move `image_config` from `generation_config` to a `{"type": "image", ...}` entry in `response_format`. [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#image-config).937- (Speech Generation) Replace `response_modalities=["audio"]` with a `{"type": "audio"}` entry in `response_format`. [See examples](https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026#audio-config).938- (Multimodal) Convert `response_format` from a single object to an array when requesting multiple output modalities.
Files main
Menu

Theme