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;