Skip to content

Commit 243596e

Browse files
committed
refactor test: pass the output_uri as a parameter, rather than environ
1 parent 08044c7 commit 243596e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

generative_ai/embeddings/batch_example.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
from google.cloud.aiplatform import BatchPredictionJob
1717

1818
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
19-
OUTPUT_URI = os.getenv("GCS_OUTPUT_URI")
2019

2120

22-
def embed_text_batch() -> BatchPredictionJob:
21+
def embed_text_batch(OUTPUT_URI) -> BatchPredictionJob:
2322
"""Example of how to generate embeddings from text using batch processing.
2423
2524
Read more: https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/batch-prediction-genai-embeddings

generative_ai/embeddings/test_embeddings_examples.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535

3636
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
3737
def test_embed_text_batch() -> None:
38-
os.environ["GCS_OUTPUT_URI"] = "gs://python-docs-samples-tests/"
39-
batch_prediction_job = batch_example.embed_text_batch()
38+
batch_prediction_job = batch_example.embed_text_batch("gs://python-docs-samples-tests/")
4039
assert batch_prediction_job
4140

4241

0 commit comments

Comments
 (0)