Skip to content

Commit 78c193a

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent 24fadf1 commit 78c193a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

genai/test/tools-vais-with-txt.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../tools/tools-vais-with-txt.js');
22+
const datastore = `projects/${projectId}/locations/global/collections/default_collection/dataStores/grounding-test-datastore`;
23+
const location = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2224

2325
describe('tools-vais-with-txt', () => {
2426
it('should generate a function call', async function () {
2527
this.timeout(60000);
26-
const output = await sample.generateContent(projectId);
28+
const output = await sample.generateContent(datastore, projectId, location);
2729
assert(output.length > 0);
2830
});
2931
});

genai/tools/tools-vais-with-txt.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ const {GoogleGenAI} = require('@google/genai');
1919

2020
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2121
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
22+
const DATASTORE =
23+
'projects/cloud-ai-devrel-softserve/locations/global/collections/default_collection/dataStores/example-adk-website-datastore_1755611010401';
2224

2325
async function generateContent(
26+
datastore = DATASTORE,
2427
projectId = GOOGLE_CLOUD_PROJECT,
2528
location = GOOGLE_CLOUD_LOCATION
2629
) {
@@ -33,10 +36,6 @@ async function generateContent(
3336
},
3437
});
3538

36-
const datastore =
37-
'projects/cloud-ai-devrel-softserve/locations/global/collections/default_collection/dataStores/example-adk-website-datastore_1755611010401';
38-
39-
// const datastore = `projects/${projectId}/locations/global/collections/default_collection/dataStores/grounding-test-datastore`;
4039
const response = await ai.models.generateContent({
4140
model: 'gemini-2.5-flash',
4241
contents: "How do I make an appointment to renew my driver's license?",

0 commit comments

Comments
 (0)