Skip to content

Commit 56fc175

Browse files
author
Guiners
committed
fixing functions names
1 parent 1d4a86d commit 56fc175

10 files changed

+28
-28
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const {GoogleGenAI, Modality} = require('@google/genai');
2121
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2222
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2323

24-
async function generateContent(
24+
async function generateLiveCodeExec(
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,
@@ -63,7 +63,7 @@ async function generateContent(
6363
return turns;
6464
}
6565

66-
const session = await ai.live.connect({
66+
const session = await client.live.connect({
6767
model: modelId,
6868
config: config,
6969
callbacks: {
@@ -97,5 +97,5 @@ async function generateContent(
9797
// [END googlegenaisdk_live_code_exec_with_txt]
9898

9999
module.exports = {
100-
generateContent,
100+
generateLiveCodeExec,
101101
};

genai/live/live-conversation-audio-with-audio.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function writeWavefile(filepath, audioFrames, rate = OUTPUT_RATE) {
5858
console.log(`Model response saved to ${filepath}`);
5959
}
6060

61-
async function generateContent(
61+
async function generateLiveConversation(
6262
projectId = GOOGLE_CLOUD_PROJECT,
6363
location = GOOGLE_CLOUD_LOCATION
6464
) {
@@ -162,5 +162,5 @@ async function generateContent(
162162
// [END googlegenaisdk_live_conversation_audio_with_audio]
163163

164164
module.exports = {
165-
generateContent,
165+
generateLiveConversation,
166166
};

genai/live/live-func-call-with-txt.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const {GoogleGenAI, Modality} = require('@google/genai');
2121
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2222
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2323

24-
async function generateContent(
24+
async function generateLiveFunctionCall(
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,
@@ -85,7 +85,7 @@ async function generateContent(
8585
return turns;
8686
}
8787

88-
const session = await ai.live.connect({
88+
const session = await client.live.connect({
8989
model: modelId,
9090
config: config,
9191
callbacks: {
@@ -121,5 +121,5 @@ async function generateContent(
121121
// [END googlegenaisdk_live_func_call_with_txt]
122122

123123
module.exports = {
124-
generateContent,
124+
generateLiveFunctionCall,
125125
};

genai/live/live-ground-googsearch-with-txt.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const {GoogleGenAI, Modality} = require('@google/genai');
1919
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2020
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2121

22-
async function generateContent(
22+
async function generateLiveGoogleSearch(
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,
@@ -58,7 +58,7 @@ async function generateContent(
5858
return turns;
5959
}
6060

61-
const session = await ai.live.connect({
61+
const session = await client.live.connect({
6262
model: modelId,
6363
config: config,
6464
callbacks: {
@@ -95,5 +95,5 @@ async function generateContent(
9595
// [END googlegenaisdk_live_ground_googsearch_with_txt]
9696

9797
module.exports = {
98-
generateContent,
98+
generateLiveGoogleSearch,
9999
};

genai/live/live-with-txt.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const {GoogleGenAI, Modality} = require('@google/genai');
2121
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2222
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2323

24-
async function generateContent(
24+
async function generateLiveConversation(
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,
@@ -56,7 +56,7 @@ async function generateContent(
5656
return turns;
5757
}
5858

59-
const session = await ai.live.connect({
59+
const session = await client.live.connect({
6060
model: modelId,
6161
config: config,
6262
callbacks: {
@@ -89,5 +89,5 @@ async function generateContent(
8989
// [END googlegenaisdk_live_with_txt]
9090

9191
module.exports = {
92-
generateContent,
92+
generateLiveConversation,
9393
};

genai/test/live-code-exec-with-txt.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../live/live-code-exec-with-txt');
2222

2323
describe('live-code-exec-with-txt', () => {
24-
it('should generate text content from a text prompt and multiple images', async function () {
24+
it('should generate code execution in a live session from a text prompt', async function () {
2525
this.timeout(180000);
26-
const output = await sample.generateContent(projectId);
26+
const output = await sample.generateLiveCodeExec(projectId);
2727
console.log('Generated output:', output);
2828
assert(output.length > 0);
2929
});

genai/test/live-conversation-audio-with-audio.js.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../live/live-conversation-audio-with-audio');
2222

2323
describe('live-conversation-audio-with-audio', () => {
24-
it('should generate text content from a text prompt and multiple images', async function () {
24+
it('should generate content in a live session conversation from a text prompt', async function () {
2525
this.timeout(180000);
26-
const output = await sample.generateContent(projectId);
26+
const output = await sample.generateLiveConversation(projectId);
2727
console.log('Generated output:', output);
2828
assert(output.length > 0);
2929
});

genai/test/live-func-call-with-txt.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../live/live-func-call-with-txt');
2222

2323
describe('live-func-call-with-txt', () => {
24-
it('should generate text content from a text prompt and multiple images', async function () {
24+
it('should generate function call in a live session from a text prompt', async function () {
2525
this.timeout(180000);
26-
const output = await sample.generateContent(projectId);
26+
const output = await sample.generateLiveFunctionCall(projectId);
2727
console.log('Generated output:', output);
2828
assert(output.length > 0);
2929
});

genai/test/live-ground-googsearch-with-txt.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../live/live-ground-googsearch-with-txt.js');
2222

2323
describe('live-ground-googsearch-with-txt', () => {
24-
it('should generate text content from a text prompt and multiple images', async function () {
24+
it('should generate Google Search in a live session from a text prompt', async function () {
2525
this.timeout(180000);
26-
const output = await sample.generateContent(projectId);
26+
const output = await sample.generateLiveGoogleSearch(projectId);
2727
console.log('Generated output:', output);
2828
assert(output.length > 0);
2929
});

genai/test/live-with-txt.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../live/live-with-txt');
2222

2323
describe('live-with-txt', () => {
24-
it('should generate text content from a text prompt and multiple images', async function () {
24+
it('should generate content in a live session from a text prompt', async function () {
2525
this.timeout(180000);
26-
const output = await sample.generateContent(projectId);
26+
const output = await sample.generateLiveConversation(projectId);
2727
console.log('Generated output:', output);
2828
assert(output.length > 0);
2929
});

0 commit comments

Comments
 (0)