Skip to content

Commit 3ec7931

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent 0c01cdf commit 3ec7931

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

genai/text-generation/textgen-transcript-with-gcs-audio.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ 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,
@@ -33,7 +33,7 @@ async function generateContent(
3333
const prompt = `Transcribe the interview, in the format of timecode, speaker, caption.
3434
Use speaker A, speaker B, etc. to identify speakers.`;
3535

36-
const response = await ai.models.generateContent({
36+
const response = await client.models.generateContent({
3737
model: 'gemini-2.5-flash',
3838
contents: [
3939
{text: prompt},

genai/text-generation/textgen-with-gcs-audio.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ 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,
@@ -33,7 +33,7 @@ async function generateContent(
3333
const prompt =
3434
'Provide a concise summary of the main points in the audio file.';
3535

36-
const response = await ai.models.generateContent({
36+
const response = await client.models.generateContent({
3737
model: 'gemini-2.5-flash',
3838
contents: [
3939
{

genai/text-generation/textgen-with-local-video.js

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

3434
const videoContent = fs.readFileSync('test-data/describe_video_content.mp4');
3535

36-
const response = await ai.models.generateContent({
36+
const response = await client.models.generateContent({
3737
model: 'gemini-2.5-flash',
3838
contents: [
3939
{text: 'hello-world'},

genai/text-generation/textgen-with-pdf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ 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,
@@ -41,7 +41,7 @@ async function generateContent(
4141
},
4242
};
4343

44-
const response = await ai.models.generateContent({
44+
const response = await client.models.generateContent({
4545
model: 'gemini-2.5-flash',
4646
contents: [pdfFile, prompt],
4747
});

genai/text-generation/textgen-with-youtube-video.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ 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,
@@ -39,7 +39,7 @@ async function generateContent(
3939
},
4040
};
4141

42-
const response = await ai.models.generateContent({
42+
const response = await client.models.generateContent({
4343
model: 'gemini-2.5-flash',
4444
contents: [ytVideo, prompt],
4545
});

0 commit comments

Comments
 (0)