Skip to content

Commit 02b6a82

Browse files
committed
refactor: replace hardcoded location with environment variable
1 parent 897582c commit 02b6a82

10 files changed

+10
-10
lines changed

generative-ai/snippets/test/countTokens.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro';
2525

2626
describe('Count tokens', async () => {

generative-ai/snippets/test/nonStreamingChat.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro';
2525

2626
describe('Generative AI NonStreaming Chat', async () => {

generative-ai/snippets/test/nonStreamingContent.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro';
2525

2626
describe('Generative AI NonStreaming Content', () => {

generative-ai/snippets/test/nonStreamingMultipartContent.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro-vision';
2525

2626
describe('Generative AI NonStreaming Multipart Content', () => {

generative-ai/snippets/test/safetySettings.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro';
2525

2626
describe('Safety settings', async () => {

generative-ai/snippets/test/sendMultiModalPromptWithImage.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro-vision';
2525

2626
describe('Generative AI Stream MultiModal with Image', () => {

generative-ai/snippets/test/sendMultiModalPromptWithVideo.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro-vision';
2525

2626
describe('Generative AI Stream MultiModal with Video', () => {

generative-ai/snippets/test/streamChat.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro';
2525

2626
describe('Generative AI Stream Chat', () => {

generative-ai/snippets/test/streamContent.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro';
2525

2626
describe('Generative AI Stream Content', () => {

generative-ai/snippets/test/streamMultipartContent.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cp = require('child_process');
2020
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2121

2222
const projectId = process.env.CAIP_PROJECT_ID;
23-
const location = 'europe-west4';
23+
const location = process.env.LOCATION;
2424
const model = 'gemini-pro-vision';
2525

2626
describe('Generative AI Stream Multipart Content', () => {

0 commit comments

Comments
 (0)