Skip to content

Commit 57120ce

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent 5e6e4a5 commit 57120ce

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function generateContent(
2828
projectId = GOOGLE_CLOUD_PROJECT,
2929
location = GOOGLE_CLOUD_LOCATION
3030
) {
31-
const ai = new GoogleGenAI({
31+
const client = new GoogleGenAI({
3232
vertexai: true,
3333
project: projectId,
3434
location: location,
@@ -37,7 +37,7 @@ async function generateContent(
3737
},
3838
});
3939

40-
const response = await ai.models.generateContent({
40+
const response = await client.models.generateContent({
4141
model: 'gemini-2.5-flash',
4242
contents: "How do I make an appointment to renew my driver's license?",
4343
config: {
@@ -55,10 +55,12 @@ async function generateContent(
5555

5656
console.debug(response.text);
5757

58+
// Example response:
59+
// 'The process for making an appointment to renew your driver's license varies depending on your location. To provide you with the most accurate instructions...'
60+
5861
return response.text;
5962
}
60-
// Example response:
61-
// 'The process for making an appointment to renew your driver's license varies depending on your location. To provide you with the most accurate instructions...'
63+
6264
// [END googlegenaisdk_tools_vais_with_txt]
6365

6466
module.exports = {

0 commit comments

Comments
 (0)