Skip to content

Commit 652746c

Browse files
committed
chore: remove .preview from generative ai methods
1 parent f7f4545 commit 652746c

10 files changed

+11
-11
lines changed

generative-ai/snippets/countTokens.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ async function countTokens(
2424
model = 'gemini-pro'
2525
) {
2626
// Initialize Vertex with your Cloud project and location
27-
const vertex_ai = new VertexAI({project: projectId, location: location});
27+
const vertexAI = new VertexAI({project: projectId, location: location});
2828

2929
// Instantiate the model
30-
const generativeModel = vertex_ai.preview.getGenerativeModel({
30+
const generativeModel = vertexAI.getGenerativeModel({
3131
model: model,
3232
});
3333

generative-ai/snippets/nonStreamingChat.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function createNonStreamingChat(
2727
const vertexAI = new VertexAI({project: projectId, location: location});
2828

2929
// Instantiate the model
30-
const generativeModel = vertexAI.preview.getGenerativeModel({
30+
const generativeModel = vertexAI.getGenerativeModel({
3131
model: model,
3232
});
3333

generative-ai/snippets/nonStreamingContent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function createNonStreamingContent(
2727
const vertexAI = new VertexAI({project: projectId, location: location});
2828

2929
// Instantiate the model
30-
const generativeModel = vertexAI.preview.getGenerativeModel({
30+
const generativeModel = vertexAI.getGenerativeModel({
3131
model: model,
3232
});
3333

generative-ai/snippets/nonStreamingMultipartContent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function createNonStreamingMultipartContent(
2929
const vertexAI = new VertexAI({project: projectId, location: location});
3030

3131
// Instantiate the model
32-
const generativeVisionModel = vertexAI.preview.getGenerativeModel({
32+
const generativeVisionModel = vertexAI.getGenerativeModel({
3333
model: model,
3434
});
3535

generative-ai/snippets/safetySettings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function setSafetySettings(
3131
const vertexAI = new VertexAI({project: projectId, location: location});
3232

3333
// Instantiate the model
34-
const generativeModel = vertexAI.preview.getGenerativeModel({
34+
const generativeModel = vertexAI.getGenerativeModel({
3535
model: model,
3636
// The following parameters are optional
3737
// They can also be passed to individual content generation requests

generative-ai/snippets/sendMultiModalPromptWithImage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function sendMultiModalPromptWithImage(
4343
// Initialize Vertex with your Cloud project and location
4444
const vertexAI = new VertexAI({project: projectId, location: location});
4545

46-
const generativeVisionModel = vertexAI.preview.getGenerativeModel({
46+
const generativeVisionModel = vertexAI.getGenerativeModel({
4747
model: model,
4848
});
4949

generative-ai/snippets/sendMultiModalPromptWithVideo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function sendMultiModalPromptWithVideo(
2626
// Initialize Vertex with your Cloud project and location
2727
const vertexAI = new VertexAI({project: projectId, location: location});
2828

29-
const generativeVisionModel = vertexAI.preview.getGenerativeModel({
29+
const generativeVisionModel = vertexAI.getGenerativeModel({
3030
model: model,
3131
});
3232

generative-ai/snippets/streamChat.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function createStreamChat(
2727
const vertexAI = new VertexAI({project: projectId, location: location});
2828

2929
// Instantiate the model
30-
const generativeModel = vertexAI.preview.getGenerativeModel({
30+
const generativeModel = vertexAI.getGenerativeModel({
3131
model: model,
3232
});
3333

generative-ai/snippets/streamContent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function createStreamContent(
2727
const vertexAI = new VertexAI({project: projectId, location: location});
2828

2929
// Instantiate the model
30-
const generativeModel = vertexAI.preview.getGenerativeModel({
30+
const generativeModel = vertexAI.getGenerativeModel({
3131
model: model,
3232
});
3333

generative-ai/snippets/streamMultipartContent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function createStreamMultipartContent(
2929
const vertexAI = new VertexAI({project: projectId, location: location});
3030

3131
// Instantiate the model
32-
const generativeVisionModel = vertexAI.preview.getGenerativeModel({
32+
const generativeVisionModel = vertexAI.getGenerativeModel({
3333
model: model,
3434
});
3535

0 commit comments

Comments
 (0)