Skip to content

Commit

Permalink
generate/response -> create/job
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeriy-Burlaka committed Jan 31, 2025
1 parent bc39bf4 commit 4769391
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions genai/batch_predict/batch_prediction_with_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from google.genai.types import BatchJob


def generate_content(output_uri: str) -> BatchJob:
def create_job(output_uri: str) -> BatchJob:
# [START googlegenaisdk_batch_prediction_with_gcs]
import time

Expand Down Expand Up @@ -61,6 +61,6 @@ def generate_content(output_uri: str) -> BatchJob:


if __name__ == "__main__":
generate_content(
create_job(
output_uri="gs://gemini-batch-prediction-results/..."
)
10 changes: 5 additions & 5 deletions genai/batch_predict/test_batch_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def gcs_output_uri():


def test_batch_prediction_with_gcs(gcs_output_uri) -> None:
response = batch_prediction_with_gcs.generate_content(output_uri=gcs_output_uri)
assert response
assert response.state == "JOB_STATE_SUCCEEDED"
assert response.dest.gcs_uri == gcs_output_uri
assert response.state == JobState.JOB_STATE_SUCCEEDED
job = batch_prediction_with_gcs.create_job(output_uri=gcs_output_uri)
assert job
assert job.state == "JOB_STATE_SUCCEEDED"
assert job.dest.gcs_uri == gcs_output_uri
assert job.state == JobState.JOB_STATE_SUCCEEDED

0 comments on commit 4769391

Please sign in to comment.