Skip to content

Commit 79c5ce2

Browse files
committed
feat(genai): update to use gemini 2.5 flash
1 parent a874b21 commit 79c5ce2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+58
-59
lines changed

genai/batch_prediction/batchpredict_with_bq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def generate_content(output_uri: str) -> str:
2626
# output_uri = f"bq://your-project.your_dataset.your_table"
2727

2828
job = client.batches.create(
29-
model="gemini-2.0-flash-001",
29+
model="gemini-2.5-flash-preview-05-20",
3030
src="bq://storage-samples.generative_ai.batch_requests_for_multimodal_input",
3131
config=CreateBatchJobConfig(dest=output_uri),
3232
)

genai/batch_prediction/batchpredict_with_gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def generate_content(output_uri: str) -> str:
2626

2727
# See the documentation: https://googleapis.github.io/python-genai/genai.html#genai.batches.Batches.create
2828
job = client.batches.create(
29-
model="gemini-2.0-flash-001",
29+
model="gemini-2.5-flash-preview-05-20",
3030
# Source link: https://storage.cloud.google.com/cloud-samples-data/batch/prompt_for_batch_gemini_predict.jsonl
3131
src="gs://cloud-samples-data/batch/prompt_for_batch_gemini_predict.jsonl",
3232
config=CreateBatchJobConfig(dest=output_uri),

genai/bounding_box/boundingbox_with_txt_img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def plot_bounding_boxes(image_uri: str, bounding_boxes: list[BoundingBox]) -> No
9494
image_uri = "https://storage.googleapis.com/generativeai-downloads/images/socks.jpg"
9595

9696
response = client.models.generate_content(
97-
model="gemini-2.0-flash-001",
97+
model="gemini-2.5-flash-preview-05-20",
9898
contents=[
9999
Part.from_uri(
100100
file_uri=image_uri,

genai/content_cache/contentcache_create_with_txt_gcs_pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def create_content_cache() -> str:
4242
]
4343

4444
content_cache = client.caches.create(
45-
model="gemini-2.0-flash-001",
45+
model="gemini-2.5-flash-preview-05-20",
4646
config=CreateCachedContentConfig(
4747
contents=contents,
4848
system_instruction=system_instruction,

genai/content_cache/contentcache_use_with_txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def generate_content(cache_name: str) -> str:
2323
# Use content cache to generate text response
2424
# E.g cache_name = 'projects/111111111111/locations/us-central1/cachedContents/1111111111111111111'
2525
response = client.models.generate_content(
26-
model="gemini-2.0-flash-001",
26+
model="gemini-2.5-flash-preview-05-20",
2727
contents="Summarize the pdfs",
2828
config=GenerateContentConfig(
2929
cached_content=cache_name,

genai/controlled_generation/ctrlgen_with_class_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Recipe(BaseModel):
2626

2727
client = genai.Client(http_options=HttpOptions(api_version="v1"))
2828
response = client.models.generate_content(
29-
model="gemini-2.0-flash-001",
29+
model="gemini-2.5-flash-preview-05-20",
3030
contents="List a few popular cookie recipes.",
3131
config=GenerateContentConfig(
3232
response_mime_type="application/json",

genai/controlled_generation/ctrlgen_with_enum_class_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class InstrumentClass(enum.Enum):
2929

3030
client = genai.Client(http_options=HttpOptions(api_version="v1"))
3131
response = client.models.generate_content(
32-
model="gemini-2.0-flash-001",
32+
model="gemini-2.5-flash-preview-05-20",
3333
contents="What type of instrument is a guitar?",
3434
config={
3535
"response_mime_type": "text/x.enum",

genai/controlled_generation/ctrlgen_with_enum_schema.py

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

2121
client = genai.Client(http_options=HttpOptions(api_version="v1"))
2222
response = client.models.generate_content(
23-
model="gemini-2.0-flash-001",
23+
model="gemini-2.5-flash-preview-05-20",
2424
contents="What type of instrument is an oboe?",
2525
config=GenerateContentConfig(
2626
response_mime_type="text/x.enum",

genai/controlled_generation/ctrlgen_with_nested_class_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Recipe(BaseModel):
3636

3737
client = genai.Client(http_options=HttpOptions(api_version="v1"))
3838
response = client.models.generate_content(
39-
model="gemini-2.0-flash-001",
39+
model="gemini-2.5-flash-preview-05-20",
4040
contents="List about 10 home-baked cookies and give them grades based on tastiness.",
4141
config=GenerateContentConfig(
4242
response_mime_type="application/json",

genai/controlled_generation/ctrlgen_with_nullable_schema.py

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

5252
client = genai.Client(http_options=HttpOptions(api_version="v1"))
5353
response = client.models.generate_content(
54-
model="gemini-2.0-flash-001",
54+
model="gemini-2.5-flash-preview-05-20",
5555
contents=prompt,
5656
config=GenerateContentConfig(
5757
response_mime_type="application/json",

0 commit comments

Comments
 (0)