Skip to content

chore(generative_ai): unmark test as fixture #13397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions generative_ai/embeddings/batch_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
from google.cloud.aiplatform import BatchPredictionJob

PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
OUTPUT_URI = os.getenv("GCS_OUTPUT_URI")


def embed_text_batch() -> BatchPredictionJob:
def embed_text_batch(OUTPUT_URI: str) -> BatchPredictionJob:
"""Example of how to generate embeddings from text using batch processing.

Read more: https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/batch-prediction-genai-embeddings
Expand Down
5 changes: 1 addition & 4 deletions generative_ai/embeddings/test_embeddings_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from google.cloud import aiplatform
from google.cloud.aiplatform import initializer as aiplatform_init

import pytest

import batch_example
import code_retrieval_example
Expand All @@ -35,10 +34,8 @@


@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
@pytest.fixture(scope="session")
def test_embed_text_batch() -> None:
os.environ["GCS_OUTPUT_URI"] = "gs://python-docs-samples-tests/"
batch_prediction_job = batch_example.embed_text_batch()
batch_prediction_job = batch_example.embed_text_batch("gs://python-docs-samples-tests/")
assert batch_prediction_job


Expand Down