diff --git a/sdk-samples/interactions_basic.ts b/sdk-samples/interactions_basic.ts index 07f6e1e51..ae04c885a 100644 --- a/sdk-samples/interactions_basic.ts +++ b/sdk-samples/interactions_basic.ts @@ -21,7 +21,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_function_calling_client_state.ts b/sdk-samples/interactions_function_calling_client_state.ts index ac00322c7..acd2ade9a 100644 --- a/sdk-samples/interactions_function_calling_client_state.ts +++ b/sdk-samples/interactions_function_calling_client_state.ts @@ -100,7 +100,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_function_calling_server_state.ts b/sdk-samples/interactions_function_calling_server_state.ts index c5ca4fde3..d146e0e61 100644 --- a/sdk-samples/interactions_function_calling_server_state.ts +++ b/sdk-samples/interactions_function_calling_server_state.ts @@ -83,7 +83,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_get.ts b/sdk-samples/interactions_get.ts index 401b78060..e05b2afd3 100644 --- a/sdk-samples/interactions_get.ts +++ b/sdk-samples/interactions_get.ts @@ -24,7 +24,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_input_text_and_audio.ts b/sdk-samples/interactions_multimodal_input_text_and_audio.ts index 6ac22b84d..196582b0e 100644 --- a/sdk-samples/interactions_multimodal_input_text_and_audio.ts +++ b/sdk-samples/interactions_multimodal_input_text_and_audio.ts @@ -40,7 +40,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_input_text_and_audio_with_generate_content.ts b/sdk-samples/interactions_multimodal_input_text_and_audio_with_generate_content.ts index 116fd8f89..1eea9de4a 100644 --- a/sdk-samples/interactions_multimodal_input_text_and_audio_with_generate_content.ts +++ b/sdk-samples/interactions_multimodal_input_text_and_audio_with_generate_content.ts @@ -68,7 +68,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_input_text_and_image.ts b/sdk-samples/interactions_multimodal_input_text_and_image.ts index 3b1e695c1..69955bc6c 100644 --- a/sdk-samples/interactions_multimodal_input_text_and_image.ts +++ b/sdk-samples/interactions_multimodal_input_text_and_image.ts @@ -40,7 +40,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_input_text_and_image_with_generate_content.ts b/sdk-samples/interactions_multimodal_input_text_and_image_with_generate_content.ts index bbe652a98..17777e109 100644 --- a/sdk-samples/interactions_multimodal_input_text_and_image_with_generate_content.ts +++ b/sdk-samples/interactions_multimodal_input_text_and_image_with_generate_content.ts @@ -66,7 +66,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_response_audio.ts b/sdk-samples/interactions_multimodal_response_audio.ts index b59f3edcc..8e92d7fcc 100644 --- a/sdk-samples/interactions_multimodal_response_audio.ts +++ b/sdk-samples/interactions_multimodal_response_audio.ts @@ -32,7 +32,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_response_audio_with_generate_content.ts b/sdk-samples/interactions_multimodal_response_audio_with_generate_content.ts index f1395fd71..f000ef5aa 100644 --- a/sdk-samples/interactions_multimodal_response_audio_with_generate_content.ts +++ b/sdk-samples/interactions_multimodal_response_audio_with_generate_content.ts @@ -60,7 +60,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_response_image.ts b/sdk-samples/interactions_multimodal_response_image.ts index a0a14b996..645b06355 100644 --- a/sdk-samples/interactions_multimodal_response_image.ts +++ b/sdk-samples/interactions_multimodal_response_image.ts @@ -29,7 +29,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_multimodal_response_image_with_generate_content.ts b/sdk-samples/interactions_multimodal_response_image_with_generate_content.ts index 34f46848d..9b31e5106 100644 --- a/sdk-samples/interactions_multimodal_response_image_with_generate_content.ts +++ b/sdk-samples/interactions_multimodal_response_image_with_generate_content.ts @@ -57,7 +57,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_stateful.ts b/sdk-samples/interactions_stateful.ts index 0da7a12a7..2df64dfb7 100644 --- a/sdk-samples/interactions_stateful.ts +++ b/sdk-samples/interactions_stateful.ts @@ -32,7 +32,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_stateless.ts b/sdk-samples/interactions_stateless.ts index 0deafb09f..3c365dfae 100644 --- a/sdk-samples/interactions_stateless.ts +++ b/sdk-samples/interactions_stateless.ts @@ -46,7 +46,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_streaming.ts b/sdk-samples/interactions_streaming.ts index 20e4daf26..906444b71 100644 --- a/sdk-samples/interactions_streaming.ts +++ b/sdk-samples/interactions_streaming.ts @@ -34,7 +34,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_structured_output_json.ts b/sdk-samples/interactions_structured_output_json.ts index 14ad2fd5a..e3c4085a5 100644 --- a/sdk-samples/interactions_structured_output_json.ts +++ b/sdk-samples/interactions_structured_output_json.ts @@ -24,7 +24,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_tool_call_with_code_execution.ts b/sdk-samples/interactions_tool_call_with_code_execution.ts index c9aaa9915..48bc533bd 100644 --- a/sdk-samples/interactions_tool_call_with_code_execution.ts +++ b/sdk-samples/interactions_tool_call_with_code_execution.ts @@ -23,7 +23,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_tool_call_with_computer_use.ts b/sdk-samples/interactions_tool_call_with_computer_use.ts index 5aee37d9b..94ef51f69 100644 --- a/sdk-samples/interactions_tool_call_with_computer_use.ts +++ b/sdk-samples/interactions_tool_call_with_computer_use.ts @@ -24,7 +24,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_tool_call_with_functions.ts b/sdk-samples/interactions_tool_call_with_functions.ts index 7e092e55b..2e251148d 100644 --- a/sdk-samples/interactions_tool_call_with_functions.ts +++ b/sdk-samples/interactions_tool_call_with_functions.ts @@ -54,7 +54,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_tool_call_with_google_search.ts b/sdk-samples/interactions_tool_call_with_google_search.ts index dac412118..9798f4e3d 100644 --- a/sdk-samples/interactions_tool_call_with_google_search.ts +++ b/sdk-samples/interactions_tool_call_with_google_search.ts @@ -23,7 +23,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_tool_call_with_mcp_server.ts b/sdk-samples/interactions_tool_call_with_mcp_server.ts index 661175a09..a96d0f086 100644 --- a/sdk-samples/interactions_tool_call_with_mcp_server.ts +++ b/sdk-samples/interactions_tool_call_with_mcp_server.ts @@ -31,7 +31,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_tool_call_with_mime_type.ts b/sdk-samples/interactions_tool_call_with_mime_type.ts index 0327bd24c..17faaaf5a 100644 --- a/sdk-samples/interactions_tool_call_with_mime_type.ts +++ b/sdk-samples/interactions_tool_call_with_mime_type.ts @@ -51,9 +51,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error( - 'This version of the GenAI SDK does not support Vertex AI API for interactions.', - ); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_tool_call_with_url_context.ts b/sdk-samples/interactions_tool_call_with_url_context.ts index 64e819e81..398573acc 100644 --- a/sdk-samples/interactions_tool_call_with_url_context.ts +++ b/sdk-samples/interactions_tool_call_with_url_context.ts @@ -24,7 +24,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/interactions_with_config.ts b/sdk-samples/interactions_with_config.ts index 951130a04..e7ffb0744 100644 --- a/sdk-samples/interactions_with_config.ts +++ b/sdk-samples/interactions_with_config.ts @@ -23,7 +23,7 @@ async function createInteractionsFromMLDev() { async function main() { if (GOOGLE_GENAI_USE_VERTEXAI) { - throw new Error('Interactions API is not yet supported on Vertex'); + console.log('Interactions API is not yet supported on Vertex'); } else { await createInteractionsFromMLDev().catch((e) => console.error('got error', e), diff --git a/sdk-samples/live_ephemeral.ts b/sdk-samples/live_ephemeral.ts index 8fd10c872..805538300 100644 --- a/sdk-samples/live_ephemeral.ts +++ b/sdk-samples/live_ephemeral.ts @@ -11,6 +11,7 @@ import { } from '@google/genai'; const GEMINI_API_KEY = process.env.GEMINI_API_KEY; +const GOOGLE_GENAI_USE_VERTEXAI = process.env.GOOGLE_GENAI_USE_VERTEXAI; class AsyncQueue { private queue: T[] = []; @@ -127,6 +128,10 @@ async function live(client: GoogleGenAI, model: string) { } async function main() { + if (GOOGLE_GENAI_USE_VERTEXAI) { + console.log('This sample is not yet supported by Vertex AI.'); + return; + } let client = new GoogleGenAI({ apiKey: GEMINI_API_KEY, apiVersion: 'v1alpha', diff --git a/sdk-samples/run_samples.sh b/sdk-samples/run_samples.sh old mode 100644 new mode 100755