From 9c098450555dd77828e3a077d348526bb8c9078a Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Fri, 24 Jul 2026 07:37:15 -0700 Subject: [PATCH] cleanup: Remove legacy `response_format` field. PiperOrigin-RevId: 953360105 --- .../interactions_structured_output_json.ts | 7 +++++-- .../interactions_tool_call_with_mime_type.ts | 19 +++++++++++-------- .../models/interactions/response-format.ts | 3 +-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sdk-samples/interactions_structured_output_json.ts b/sdk-samples/interactions_structured_output_json.ts index e3c4085a5f..75a8319ad9 100644 --- a/sdk-samples/interactions_structured_output_json.ts +++ b/sdk-samples/interactions_structured_output_json.ts @@ -15,8 +15,11 @@ async function createInteractionsFromMLDev() { const response = await ai.interactions.create({ model: 'gemini-2.5-flash', input: 'Which are the colors of a rainbow', - response_mime_type: 'application/json', - response_format: {type: 'array', description: 'A list of colors'}, + response_format: { + type: 'text', + mime_type: 'application/json', + schema: {type: 'array', description: 'A list of colors'}, + }, }); console.debug(response); diff --git a/sdk-samples/interactions_tool_call_with_mime_type.ts b/sdk-samples/interactions_tool_call_with_mime_type.ts index 17faaaf5a8..b6e194466f 100644 --- a/sdk-samples/interactions_tool_call_with_mime_type.ts +++ b/sdk-samples/interactions_tool_call_with_mime_type.ts @@ -34,16 +34,19 @@ async function createInteractionsFromMLDev() { }, ], response_format: { - type: 'object', - properties: { - location: {type: 'string'}, - temperature: {type: 'number'}, - condition: {type: 'string'}, - recommendation: {type: 'string'}, + type: 'text', + mime_type: 'application/json', + schema: { + type: 'object', + properties: { + location: {type: 'string'}, + temperature: {type: 'number'}, + condition: {type: 'string'}, + recommendation: {type: 'string'}, + }, + required: ['location', 'temperature', 'condition', 'recommendation'], }, - required: ['location', 'temperature', 'condition', 'recommendation'], }, - response_mime_type: 'application/json', }); console.debug(response); diff --git a/src/gaos/models/interactions/response-format.ts b/src/gaos/models/interactions/response-format.ts index 57a3594563..5b22f8a11b 100644 --- a/src/gaos/models/interactions/response-format.ts +++ b/src/gaos/models/interactions/response-format.ts @@ -19,5 +19,4 @@ export type ResponseFormat = | AudioResponseFormat | ImageResponseFormat | TextResponseFormat - | VideoResponseFormat - | { [k: string]: any }; + | VideoResponseFormat;