Skip to content

Commit 5c6651b

Browse files
author
Guiners
committed
sample update
1 parent 725b465 commit 5c6651b

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

genai/batch-prediction/batchpredict-embeddings-with-gcs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
const {GoogleGenAI} = require('@google/genai');
1919

2020
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
21-
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
21+
const GOOGLE_CLOUD_LOCATION =
22+
process.env.GOOGLE_CLOUD_LOCATION || 'us-central1';
2223
const OUTPUT_URI = 'gs://your-bucket/your-prefix';
2324

2425
async function runBatchPredictionJob(
@@ -35,7 +36,7 @@ async function runBatchPredictionJob(
3536
},
3637
});
3738

38-
// See the documentation: https://googleapis.github.io/python-genai/genai.html#genai.batches.Batches.create
39+
// See the documentation: https://googleapis.github.io/js-genai/release_docs/classes/batches.Batches.html
3940
let job = await client.batches.create({
4041
model: 'text-embedding-005',
4142
// Source link: https://storage.cloud.google.com/cloud-samples-data/batch/prompt_for_batch_gemini_predict.jsonl

genai/batch-prediction/batchpredict-with-bq.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
const {GoogleGenAI} = require('@google/genai');
1919

2020
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
21-
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
22-
// const OUTPUT_URI = 'bq://your-project.your_dataset.your_table';
23-
const OUTPUT_URI = 'bq://cloud-ai-devrel-softserve.gen_ai_batch_prediction.tes'
21+
const GOOGLE_CLOUD_LOCATION =
22+
process.env.GOOGLE_CLOUD_LOCATION || 'us-central1';
23+
const OUTPUT_URI = 'bq://your-project.your_dataset.your_table';
2424

2525
async function runBatchPredictionJob(
2626
outputUri = OUTPUT_URI,
@@ -36,7 +36,7 @@ async function runBatchPredictionJob(
3636
},
3737
});
3838

39-
// See the documentation: https://googleapis.github.io/python-genai/genai.html#genai.batches.Batches.create
39+
// See the documentation: https://googleapis.github.io/js-genai/release_docs/classes/batches.Batches.html
4040
let job = await client.batches.create({
4141
// To use a tuned model, set the model param to your tuned model using the following format:
4242
// model="projects/{PROJECT_ID}/locations/{LOCATION}/models/{MODEL_ID}"

genai/batch-prediction/batchpredict-with-gcs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
const {GoogleGenAI} = require('@google/genai');
1919

2020
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
21-
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
21+
const GOOGLE_CLOUD_LOCATION =
22+
process.env.GOOGLE_CLOUD_LOCATION || 'us-central1';
2223
const OUTPUT_URI = 'gs://your-bucket/your-prefix';
2324

2425
async function runBatchPredictionJob(
@@ -35,7 +36,7 @@ async function runBatchPredictionJob(
3536
},
3637
});
3738

38-
// See the documentation: https://googleapis.github.io/python-genai/genai.html#genai.batches.Batches.create
39+
// See the documentation: https://googleapis.github.io/js-genai/release_docs/classes/batches.Batches.html
3940
let job = await client.batches.create({
4041
// To use a tuned model, set the model param to your tuned model using the following format:
4142
// model="projects/{PROJECT_ID}/locations/{LOCATION}/models/{MODEL_ID}"

0 commit comments

Comments
 (0)