File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.' ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments