Skip to content

Commit 53191cb

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent 44c2426 commit 53191cb

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

genai/tools/tools-code-exec-with-txt-local-img.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function generateContent(
2727
projectId = GOOGLE_CLOUD_PROJECT,
2828
location = GOOGLE_CLOUD_LOCATION
2929
) {
30-
const ai = new GoogleGenAI({
30+
const client = new GoogleGenAI({
3131
vertexai: true,
3232
project: projectId,
3333
location: location,
@@ -69,7 +69,7 @@ async function generateContent(
6969
},
7070
];
7171

72-
const response = await ai.models.generateContent({
72+
const response = await client.models.generateContent({
7373
model: 'gemini-2.5-flash',
7474
contents: contents,
7575
config: {

genai/tools/tools-code-exec-with-txt.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ async function generateContent(
2424
projectId = GOOGLE_CLOUD_PROJECT,
2525
location = GOOGLE_CLOUD_LOCATION
2626
) {
27-
const ai = new GoogleGenAI({
27+
const client = new GoogleGenAI({
2828
vertexai: true,
2929
project: projectId,
3030
location: location,
3131
});
3232

33-
const response = await ai.models.generateContent({
33+
const response = await client.models.generateContent({
3434
model: 'gemini-2.5-flash',
3535
contents:
3636
'What is the sum of the first 50 prime numbers? Generate and run code for the calculation, and make sure you get all 50.',

genai/tools/tools-func-desc-with-txt.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async function generateContent(
2323
projectId = GOOGLE_CLOUD_PROJECT,
2424
location = GOOGLE_CLOUD_LOCATION
2525
) {
26-
const ai = new GoogleGenAI({
26+
const client = new GoogleGenAI({
2727
vertexai: true,
2828
project: projectId,
2929
location: location,
@@ -70,7 +70,7 @@ async function generateContent(
7070
trends in music consumption.
7171
`;
7272

73-
const response = await ai.models.generateContent({
73+
const response = await client.models.generateContent({
7474
model: 'gemini-2.5-flash',
7575
contents: prompt,
7676
config: {

genai/tools/tools-google-search-with-txt.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ async function generateContent(
2424
projectId = GOOGLE_CLOUD_PROJECT,
2525
location = GOOGLE_CLOUD_LOCATION
2626
) {
27-
const ai = new GoogleGenAI({
27+
const client = new GoogleGenAI({
2828
vertexai: true,
2929
project: projectId,
3030
location: location,
3131
});
3232

33-
const response = await ai.models.generateContent({
33+
const response = await client.models.generateContent({
3434
model: 'gemini-2.5-flash',
3535
contents: 'When is the next total solar eclipse in Poland?',
3636
config: {

0 commit comments

Comments
 (0)