From 3ba2ec8a246a964432d5049bf161b72276fd5fd9 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Wed, 8 May 2024 10:33:37 -0700 Subject: [PATCH] chore: update to gemini ga calls --- generative-ai/snippets/functionCallingStreamChat.js | 2 +- generative-ai/snippets/functionCallingStreamContent.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generative-ai/snippets/functionCallingStreamChat.js b/generative-ai/snippets/functionCallingStreamChat.js index 91bf5d94db..8f8b4f846f 100644 --- a/generative-ai/snippets/functionCallingStreamChat.js +++ b/generative-ai/snippets/functionCallingStreamChat.js @@ -61,7 +61,7 @@ async function functionCallingStreamChat( const vertexAI = new VertexAI({project: projectId, location: location}); // Instantiate the model - const generativeModel = vertexAI.preview.getGenerativeModel({ + const generativeModel = vertexAI.getGenerativeModel({ model: model, }); diff --git a/generative-ai/snippets/functionCallingStreamContent.js b/generative-ai/snippets/functionCallingStreamContent.js index 142cf93535..b8ef823208 100644 --- a/generative-ai/snippets/functionCallingStreamContent.js +++ b/generative-ai/snippets/functionCallingStreamContent.js @@ -52,7 +52,7 @@ const functionResponseParts = [ /** * TODO(developer): Update these variables before running the sample. */ -async function functionCallingStreamChat( +async function functionCallingStreamContent( projectId = 'PROJECT_ID', location = 'us-central1', model = 'gemini-1.0-pro-002' @@ -61,7 +61,7 @@ async function functionCallingStreamChat( const vertexAI = new VertexAI({project: projectId, location: location}); // Instantiate the model - const generativeModel = vertexAI.preview.getGenerativeModel({ + const generativeModel = vertexAI.getGenerativeModel({ model: model, }); @@ -90,7 +90,7 @@ async function functionCallingStreamChat( } // [END aiplatform_gemini_function_calling_content] -functionCallingStreamChat(...process.argv.slice(2)).catch(err => { +functionCallingStreamContent(...process.argv.slice(2)).catch(err => { console.error(err.message); process.exitCode = 1; });