Skip to content

Commit edd0903

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent 6b9003a commit edd0903

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

genai/text-generation/textgen-async-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
'Compose a song about the adventures of a time-traveling squirrel.',

genai/text-generation/textgen-chat-stream-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 chatSession = ai.chats.create({
33+
const chatSession = client.chats.create({
3434
model: 'gemini-2.5-flash',
3535
});
3636

genai/text-generation/textgen-chat-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 chatSession = ai.chats.create({
33+
const chatSession = client.chats.create({
3434
model: 'gemini-2.5-flash',
3535
history: [
3636
{

genai/text-generation/textgen-config-with-txt.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,
@@ -43,7 +43,7 @@ async function generateContent(
4343
frequencyPenalty: 0.0,
4444
};
4545

46-
const response = await ai.models.generateContent({
46+
const response = await client.models.generateContent({
4747
model: 'gemini-2.5-flash',
4848
contents: 'Why is the sky blue?',
4949
config: config,

genai/text-generation/textgen-with-mute-video.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
{

0 commit comments

Comments
 (0)