Skip to content

Commit 760af87

Browse files
committed
chore(genai): update code comments for batch prediction samples.
1 parent 4b791e0 commit 760af87

9 files changed

Lines changed: 12 additions & 12 deletions

genai/batch_prediction/batchpredict_embeddings_with_gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def generate_content(output_uri: str) -> str:
3434
print(f"Job name: {job.name}")
3535
print(f"Job state: {job.state}")
3636
# Example response:
37-
# Job name: projects/%PROJECT_ID%/locations/us-central1/batchPredictionJobs/9876453210000000000
37+
# Job name: projects/.../locations/.../batchPredictionJobs/9876453210000000000
3838
# Job state: JOB_STATE_PENDING
3939

4040
# See the documentation: https://googleapis.github.io/python-genai/genai.html#genai.types.BatchJob

genai/batch_prediction/batchpredict_with_bq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def generate_content(output_uri: str) -> str:
3535
print(f"Job name: {job.name}")
3636
print(f"Job state: {job.state}")
3737
# Example response:
38-
# Job name: projects/%PROJECT_ID%/locations/us-central1/batchPredictionJobs/9876453210000000000
38+
# Job name: projects/.../locations/.../batchPredictionJobs/9876453210000000000
3939
# Job state: JOB_STATE_PENDING
4040

4141
# See the documentation: https://googleapis.github.io/python-genai/genai.html#genai.types.BatchJob

genai/batch_prediction/batchpredict_with_gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def generate_content(output_uri: str) -> str:
3636
print(f"Job name: {job.name}")
3737
print(f"Job state: {job.state}")
3838
# Example response:
39-
# Job name: projects/%PROJECT_ID%/locations/us-central1/batchPredictionJobs/9876453210000000000
39+
# Job name: projects/.../locations/.../batchPredictionJobs/9876453210000000000
4040
# Job state: JOB_STATE_PENDING
4141

4242
# See the documentation: https://googleapis.github.io/python-genai/genai.html#genai.types.BatchJob

genai/batch_prediction/get_batch_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_batch_job(batch_job_name: str) -> types.BatchJob:
2323
client = genai.Client(http_options=HttpOptions(api_version="v1"))
2424

2525
# Get the batch job
26-
# Eg. batch_job_name = "projects/123456789012/locations/us-central1/batchPredictionJobs/1234567890123456789"
26+
# Eg. batch_job_name = "projects/123456789012/locations/ABCDEF/batchPredictionJobs/1234567890123456789"
2727
batch_job = client.batches.get(name=batch_job_name)
2828

2929
print(f"Job state: {batch_job.state}")

genai/content_cache/contentcache_create_with_txt_gcs_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def create_content_cache() -> str:
4747
contents=contents,
4848
system_instruction=system_instruction,
4949
# (Optional) For enhanced security, the content cache can be encrypted using a Cloud KMS key
50-
# kms_key_name = "projects/.../locations/us-central1/keyRings/.../cryptoKeys/..."
50+
# kms_key_name = "projects/.../locations/.../keyRings/.../cryptoKeys/..."
5151
display_name="example-cache",
5252
ttl="86400s",
5353
),
@@ -56,7 +56,7 @@ def create_content_cache() -> str:
5656
print(content_cache.name)
5757
print(content_cache.usage_metadata)
5858
# Example response:
59-
# projects/111111111111/locations/us-central1/cachedContents/1111111111111111111
59+
# projects/111111111111/locations/.../cachedContents/1111111111111111111
6060
# CachedContentUsageMetadata(audio_duration_seconds=None, image_count=167,
6161
# text_count=153, total_token_count=43130, video_duration_seconds=None)
6262
# [END googlegenaisdk_contentcache_create_with_txt_gcs_pdf]

genai/content_cache/contentcache_delete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ def delete_context_caches(cache_name: str) -> str:
1919

2020
client = genai.Client()
2121
# Delete content cache using name
22-
# E.g cache_name = 'projects/111111111111/locations/us-central1/cachedContents/1111111111111111111'
22+
# E.g cache_name = 'projects/111111111111/locations/.../cachedContents/1111111111111111111'
2323
client.caches.delete(name=cache_name)
2424
print("Deleted Cache", cache_name)
2525
# Example response
26-
# Deleted Cache projects/111111111111/locations/us-central1/cachedContents/1111111111111111111
26+
# Deleted Cache projects/111111111111/locations/.../cachedContents/1111111111111111111
2727
# [END googlegenaisdk_contentcache_delete]
2828
return cache_name
2929

genai/content_cache/contentcache_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def list_context_caches() -> str:
2929
print(f"Expires at: {content_cache.expire_time}")
3030

3131
# Example response:
32-
# * Cache `projects/111111111111/locations/us-central1/cachedContents/1111111111111111111` for
33-
# model `projects/111111111111/locations/us-central1/publishers/google/models/gemini-XXX-pro-XXX`
32+
# * Cache `projects/111111111111/locations/.../cachedContents/1111111111111111111` for
33+
# model `projects/111111111111/locations/.../publishers/google/models/gemini-XXX-pro-XXX`
3434
# * Last updated at: 2025-02-13 14:46:42.620490+00:00
3535
# * CachedContentUsageMetadata(audio_duration_seconds=None, image_count=167, text_count=153, total_token_count=43130, video_duration_seconds=None)
3636
# ...

genai/content_cache/contentcache_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def update_content_cache(cache_name: str) -> str:
2525
client = genai.Client(http_options=HttpOptions(api_version="v1"))
2626

2727
# Get content cache by name
28-
# cache_name = "projects/111111111111/locations/us-central1/cachedContents/1111111111111111111"
28+
# cache_name = "projects/.../locations/.../cachedContents/1111111111111111111"
2929
content_cache = client.caches.get(name=cache_name)
3030
print("Expire time", content_cache.expire_time)
3131
# Example response

genai/content_cache/contentcache_use_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def generate_content(cache_name: str) -> str:
2020

2121
client = genai.Client(http_options=HttpOptions(api_version="v1"))
2222
# Use content cache to generate text response
23-
# E.g cache_name = 'projects/111111111111/locations/us-central1/cachedContents/1111111111111111111'
23+
# E.g cache_name = 'projects/.../locations/.../cachedContents/1111111111111111111'
2424
response = client.models.generate_content(
2525
model="gemini-2.5-flash",
2626
contents="Summarize the pdfs",

0 commit comments

Comments
 (0)