From 897582ce07aca43d37cc53764ac139e6d2f6e249 Mon Sep 17 00:00:00 2001 From: "pattishin@google.com" Date: Tue, 19 Dec 2023 20:33:59 -0800 Subject: [PATCH 1/3] refactor: updating tests to run on same gcp project as ai platform snippets --- generative-ai/snippets/test/countTokens.test.js | 11 +++++------ generative-ai/snippets/test/nonStreamingChat.test.js | 11 +++++------ .../snippets/test/nonStreamingContent.test.js | 11 +++++------ .../test/nonStreamingMultipartContent.test.js | 10 +++++----- generative-ai/snippets/test/safetySettings.test.js | 11 +++++------ .../test/sendMultiModalPromptWithImage.test.js | 11 +++++------ .../test/sendMultiModalPromptWithVideo.test.js | 11 +++++------ generative-ai/snippets/test/streamChat.test.js | 11 +++++------ generative-ai/snippets/test/streamContent.test.js | 11 +++++------ .../snippets/test/streamMultipartContent.test.js | 10 +++++----- 10 files changed, 50 insertions(+), 58 deletions(-) diff --git a/generative-ai/snippets/test/countTokens.test.js b/generative-ai/snippets/test/countTokens.test.js index d168b26fe5..56e6002927 100644 --- a/generative-ai/snippets/test/countTokens.test.js +++ b/generative-ai/snippets/test/countTokens.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Count tokens', async () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro'; +describe('Count tokens', async () => { it('should count tokens', async () => { const output = execSync( - `node ./countTokens.js ${project} ${location} ${model}` + `node ./countTokens.js ${projectId} ${location} ${model}` ); // Expect 6 tokens diff --git a/generative-ai/snippets/test/nonStreamingChat.test.js b/generative-ai/snippets/test/nonStreamingChat.test.js index 24ffe5a58b..202d8237f7 100644 --- a/generative-ai/snippets/test/nonStreamingChat.test.js +++ b/generative-ai/snippets/test/nonStreamingChat.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Generative AI NonStreaming Chat', async () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro'; +describe('Generative AI NonStreaming Chat', async () => { it('should create nonstreaming chat and begin the conversation the same in each instance', async () => { const output = execSync( - `node ./nonStreamingChat.js ${project} ${location} ${model}` + `node ./nonStreamingChat.js ${projectId} ${location} ${model}` ); // Ensure that the beginning of the conversation is consistent diff --git a/generative-ai/snippets/test/nonStreamingContent.test.js b/generative-ai/snippets/test/nonStreamingContent.test.js index 51134de8b2..16ca584f58 100644 --- a/generative-ai/snippets/test/nonStreamingContent.test.js +++ b/generative-ai/snippets/test/nonStreamingContent.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Generative AI NonStreaming Content', () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro'; +describe('Generative AI NonStreaming Content', () => { it('should create nonstreaming content and begin the conversation the same in each instance', async () => { const output = execSync( - `node ./nonStreamingContent.js ${project} ${location} ${model}` + `node ./nonStreamingContent.js ${projectId} ${location} ${model}` ); // Ensure that the beginning of the conversation is consistent diff --git a/generative-ai/snippets/test/nonStreamingMultipartContent.test.js b/generative-ai/snippets/test/nonStreamingMultipartContent.test.js index 5e0888bb86..369110e81c 100644 --- a/generative-ai/snippets/test/nonStreamingMultipartContent.test.js +++ b/generative-ai/snippets/test/nonStreamingMultipartContent.test.js @@ -17,18 +17,18 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro-vision'; + describe('Generative AI NonStreaming Multipart Content', () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro-vision'; const image = 'gs://generativeai-downloads/images/scones.jpg'; it('should create nonstreaming multipart content and begin the conversation the same in each instance', async () => { const output = execSync( - `node ./nonStreamingMultipartContent.js ${project} ${location} ${model} ${image}` + `node ./nonStreamingMultipartContent.js ${projectId} ${location} ${model} ${image}` ); // Ensure that the conversation is what we expect for this scone image diff --git a/generative-ai/snippets/test/safetySettings.test.js b/generative-ai/snippets/test/safetySettings.test.js index 265def1791..ab364577a7 100644 --- a/generative-ai/snippets/test/safetySettings.test.js +++ b/generative-ai/snippets/test/safetySettings.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Safety settings', async () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro'; +describe('Safety settings', async () => { it('should reject a dangerous request', async () => { const output = execSync( - `node ./safetySettings.js ${project} ${location} ${model}` + `node ./safetySettings.js ${projectId} ${location} ${model}` ); // Expect rejection due to safety concerns diff --git a/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js b/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js index a421893228..3ca33dd30e 100644 --- a/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js +++ b/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Generative AI Stream MultiModal with Image', () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro-vision'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro-vision'; +describe('Generative AI Stream MultiModal with Image', () => { it('should create stream multimodal content', async () => { const output = execSync( - `node ./sendMultiModalPromptWithImage.js ${project} ${location} ${model}` + `node ./sendMultiModalPromptWithImage.js ${projectId} ${location} ${model}` ); // Ensure that the conversation is what we expect for these images assert(output.match(/Paris/)); diff --git a/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js b/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js index 91d6fedb56..da34548a93 100644 --- a/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js +++ b/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Generative AI Stream MultiModal with Video', () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro-vision'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro-vision'; +describe('Generative AI Stream MultiModal with Video', () => { it('should create stream multimodal content', async () => { const output = execSync( - `node ./sendMultiModalPromptWithVideo.js ${project} ${location} ${model}` + `node ./sendMultiModalPromptWithVideo.js ${projectId} ${location} ${model}` ); // Ensure that the conversation is what we expect for these images assert(output.match(/advertisement/)); diff --git a/generative-ai/snippets/test/streamChat.test.js b/generative-ai/snippets/test/streamChat.test.js index 823fe6ccce..7c8f3eb215 100644 --- a/generative-ai/snippets/test/streamChat.test.js +++ b/generative-ai/snippets/test/streamChat.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Generative AI Stream Chat', () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro'; +describe('Generative AI Stream Chat', () => { it('should create stream chat and begin the conversation the same in each instance', async () => { const output = execSync( - `node ./streamChat.js ${project} ${location} ${model}` + `node ./streamChat.js ${projectId} ${location} ${model}` ); // Assert that the advice given for learning is what we expect diff --git a/generative-ai/snippets/test/streamContent.test.js b/generative-ai/snippets/test/streamContent.test.js index 769b68372e..a2fa00da48 100644 --- a/generative-ai/snippets/test/streamContent.test.js +++ b/generative-ai/snippets/test/streamContent.test.js @@ -17,17 +17,16 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -describe('Generative AI Stream Content', () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro'; +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro'; +describe('Generative AI Stream Content', () => { it('should create stream content', async () => { const output = execSync( - `node ./streamContent.js ${project} ${location} ${model}` + `node ./streamContent.js ${projectId} ${location} ${model}` ); // Ensure that the beginning of the conversation is consistent assert(output.match(/Prompt:/)); diff --git a/generative-ai/snippets/test/streamMultipartContent.test.js b/generative-ai/snippets/test/streamMultipartContent.test.js index d9b4fb061a..7920e49ad2 100644 --- a/generative-ai/snippets/test/streamMultipartContent.test.js +++ b/generative-ai/snippets/test/streamMultipartContent.test.js @@ -17,18 +17,18 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); - const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); +const projectId = process.env.CAIP_PROJECT_ID; +const location = 'europe-west4'; +const model = 'gemini-pro-vision'; + describe('Generative AI Stream Multipart Content', () => { - const project = 'cloud-llm-preview1'; - const location = 'us-central1'; - const model = 'gemini-pro-vision'; const image = 'gs://generativeai-downloads/images/scones.jpg'; it('should create stream multipart content', async () => { const output = execSync( - `node ./streamMultipartContent.js ${project} ${location} ${model} ${image}` + `node ./streamMultipartContent.js ${projectId} ${location} ${model} ${image}` ); // Split up conversation output const conversation = output.split('\n'); From 02b6a8202267b1e9608c99e83552dc6f1623ddac Mon Sep 17 00:00:00 2001 From: "pattishin@google.com" Date: Tue, 19 Dec 2023 20:49:28 -0800 Subject: [PATCH 2/3] refactor: replace hardcoded location with environment variable --- generative-ai/snippets/test/countTokens.test.js | 2 +- generative-ai/snippets/test/nonStreamingChat.test.js | 2 +- generative-ai/snippets/test/nonStreamingContent.test.js | 2 +- .../snippets/test/nonStreamingMultipartContent.test.js | 2 +- generative-ai/snippets/test/safetySettings.test.js | 2 +- .../snippets/test/sendMultiModalPromptWithImage.test.js | 2 +- .../snippets/test/sendMultiModalPromptWithVideo.test.js | 2 +- generative-ai/snippets/test/streamChat.test.js | 2 +- generative-ai/snippets/test/streamContent.test.js | 2 +- generative-ai/snippets/test/streamMultipartContent.test.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/generative-ai/snippets/test/countTokens.test.js b/generative-ai/snippets/test/countTokens.test.js index 56e6002927..9069f7a018 100644 --- a/generative-ai/snippets/test/countTokens.test.js +++ b/generative-ai/snippets/test/countTokens.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro'; describe('Count tokens', async () => { diff --git a/generative-ai/snippets/test/nonStreamingChat.test.js b/generative-ai/snippets/test/nonStreamingChat.test.js index 202d8237f7..53af894b9f 100644 --- a/generative-ai/snippets/test/nonStreamingChat.test.js +++ b/generative-ai/snippets/test/nonStreamingChat.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro'; describe('Generative AI NonStreaming Chat', async () => { diff --git a/generative-ai/snippets/test/nonStreamingContent.test.js b/generative-ai/snippets/test/nonStreamingContent.test.js index 16ca584f58..21e3f5e6a1 100644 --- a/generative-ai/snippets/test/nonStreamingContent.test.js +++ b/generative-ai/snippets/test/nonStreamingContent.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro'; describe('Generative AI NonStreaming Content', () => { diff --git a/generative-ai/snippets/test/nonStreamingMultipartContent.test.js b/generative-ai/snippets/test/nonStreamingMultipartContent.test.js index 369110e81c..16625ebcf9 100644 --- a/generative-ai/snippets/test/nonStreamingMultipartContent.test.js +++ b/generative-ai/snippets/test/nonStreamingMultipartContent.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro-vision'; describe('Generative AI NonStreaming Multipart Content', () => { diff --git a/generative-ai/snippets/test/safetySettings.test.js b/generative-ai/snippets/test/safetySettings.test.js index ab364577a7..3c58262022 100644 --- a/generative-ai/snippets/test/safetySettings.test.js +++ b/generative-ai/snippets/test/safetySettings.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro'; describe('Safety settings', async () => { diff --git a/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js b/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js index 3ca33dd30e..d4016f9f45 100644 --- a/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js +++ b/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro-vision'; describe('Generative AI Stream MultiModal with Image', () => { diff --git a/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js b/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js index da34548a93..00d5186ede 100644 --- a/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js +++ b/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro-vision'; describe('Generative AI Stream MultiModal with Video', () => { diff --git a/generative-ai/snippets/test/streamChat.test.js b/generative-ai/snippets/test/streamChat.test.js index 7c8f3eb215..bf0317e14e 100644 --- a/generative-ai/snippets/test/streamChat.test.js +++ b/generative-ai/snippets/test/streamChat.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro'; describe('Generative AI Stream Chat', () => { diff --git a/generative-ai/snippets/test/streamContent.test.js b/generative-ai/snippets/test/streamContent.test.js index a2fa00da48..2422efe30d 100644 --- a/generative-ai/snippets/test/streamContent.test.js +++ b/generative-ai/snippets/test/streamContent.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro'; describe('Generative AI Stream Content', () => { diff --git a/generative-ai/snippets/test/streamMultipartContent.test.js b/generative-ai/snippets/test/streamMultipartContent.test.js index 7920e49ad2..2b3062baa9 100644 --- a/generative-ai/snippets/test/streamMultipartContent.test.js +++ b/generative-ai/snippets/test/streamMultipartContent.test.js @@ -20,7 +20,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const projectId = process.env.CAIP_PROJECT_ID; -const location = 'europe-west4'; +const location = process.env.LOCATION; const model = 'gemini-pro-vision'; describe('Generative AI Stream Multipart Content', () => { From 5c2c985f3ec097e83cacdb675118cafe39880d9c Mon Sep 17 00:00:00 2001 From: "pattishin@google.com" Date: Fri, 16 Feb 2024 14:32:20 -0800 Subject: [PATCH 3/3] fix: resolve linting --- generative-ai/snippets/test/countTokens.test.js | 6 +++--- generative-ai/snippets/test/nonStreamingChat.test.js | 1 + generative-ai/snippets/test/safetySettings.test.js | 2 +- .../snippets/test/sendMultiModalPromptWithImage.test.js | 2 +- .../snippets/test/sendMultiModalPromptWithVideo.test.js | 2 +- generative-ai/snippets/test/streamChat.test.js | 2 +- generative-ai/snippets/test/streamContent.test.js | 2 +- generative-ai/snippets/test/streamMultipartContent.test.js | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/generative-ai/snippets/test/countTokens.test.js b/generative-ai/snippets/test/countTokens.test.js index f6cdb477f3..027151d3f2 100644 --- a/generative-ai/snippets/test/countTokens.test.js +++ b/generative-ai/snippets/test/countTokens.test.js @@ -18,12 +18,12 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); - + const projectId = process.env.CAIP_PROJECT_ID; const location = process.env.LOCATION; const model = 'gemini-1.0-pro'; -describe('Count tokens', async () => { +describe('Count tokens', async () => { /** * TODO(developer): Uncomment these variables before running the sample.\ * (Not necessary if passing values as arguments) @@ -31,7 +31,7 @@ describe('Count tokens', async () => { // const projectId = 'YOUR_PROJECT_ID'; // const location = 'YOUR_LOCATION'; // const model = 'gemini-1.0-pro'; - + it('should count tokens', async () => { const output = execSync( `node ./countTokens.js ${projectId} ${location} ${model}` diff --git a/generative-ai/snippets/test/nonStreamingChat.test.js b/generative-ai/snippets/test/nonStreamingChat.test.js index e44e9574dc..73eea8fae4 100644 --- a/generative-ai/snippets/test/nonStreamingChat.test.js +++ b/generative-ai/snippets/test/nonStreamingChat.test.js @@ -44,3 +44,4 @@ describe('Generative AI NonStreaming Chat', async () => { assert(output.match(/User: How can I learn more about that?/)); }); }); +}); diff --git a/generative-ai/snippets/test/safetySettings.test.js b/generative-ai/snippets/test/safetySettings.test.js index 8f421e2455..046b0dfca1 100644 --- a/generative-ai/snippets/test/safetySettings.test.js +++ b/generative-ai/snippets/test/safetySettings.test.js @@ -31,7 +31,7 @@ describe('Safety settings', async () => { // const projectId = 'YOUR_PROJECT_ID'; // const location = 'YOUR_LOCATION'; // const model = 'gemini-1.0-pro'; - + it('should reject a dangerous request', async () => { const output = execSync( `node ./safetySettings.js ${projectId} ${location} ${model}` diff --git a/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js b/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js index 2214b96269..37db1d2349 100644 --- a/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js +++ b/generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js @@ -31,7 +31,7 @@ describe('Generative AI Stream MultiModal with Image', () => { // const projectId = 'YOUR_PROJECT_ID'; // const location = 'YOUR_LOCATION'; // const model = 'gemini-1.0-pro-vision'; - + it('should create stream multimodal content', async () => { const output = execSync( `node ./sendMultiModalPromptWithImage.js ${projectId} ${location} ${model}` diff --git a/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js b/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js index 9247c9d1e4..fc6f3090ac 100644 --- a/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js +++ b/generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js @@ -31,7 +31,7 @@ describe('Generative AI Stream MultiModal with Video', () => { // const projectId = 'YOUR_PROJECT_ID'; // const location = 'YOUR_LOCATION'; // const model = 'gemini-1.0-pro-vision'; - + it('should create stream multimodal content', async () => { const output = execSync( `node ./sendMultiModalPromptWithVideo.js ${projectId} ${location} ${model}` diff --git a/generative-ai/snippets/test/streamChat.test.js b/generative-ai/snippets/test/streamChat.test.js index 82349a0c54..117a6dfe47 100644 --- a/generative-ai/snippets/test/streamChat.test.js +++ b/generative-ai/snippets/test/streamChat.test.js @@ -31,7 +31,7 @@ describe('Generative AI Stream Chat', () => { // const projectId = 'YOUR_PROJECT_ID'; // const location = 'YOUR_LOCATION'; // const model = 'gemini-1.0-pro'; - + it('should create stream chat and begin the conversation the same in each instance', async () => { const output = execSync( `node ./streamChat.js ${projectId} ${location} ${model}` diff --git a/generative-ai/snippets/test/streamContent.test.js b/generative-ai/snippets/test/streamContent.test.js index e54469e739..3882905cb3 100644 --- a/generative-ai/snippets/test/streamContent.test.js +++ b/generative-ai/snippets/test/streamContent.test.js @@ -31,7 +31,7 @@ describe('Generative AI Stream Content', () => { // const projectId = 'YOUR_PROJECT_ID'; // const location = 'YOUR_LOCATION'; // const model = 'gemini-1.0-pro'; - + it('should create stream content', async () => { const output = execSync( `node ./streamContent.js ${projectId} ${location} ${model}` diff --git a/generative-ai/snippets/test/streamMultipartContent.test.js b/generative-ai/snippets/test/streamMultipartContent.test.js index c3d0809f71..14ef562e71 100644 --- a/generative-ai/snippets/test/streamMultipartContent.test.js +++ b/generative-ai/snippets/test/streamMultipartContent.test.js @@ -31,7 +31,7 @@ describe('Generative AI Stream Multipart Content', () => { // const projectId = 'YOUR_PROJECT_ID'; // const location = 'YOUR_LOCATION'; // const model = 'gemini-1.0-pro-vision'; - + const image = 'gs://generativeai-downloads/images/scones.jpg'; it('should create stream multipart content', async () => {