Skip to content

Commit c79f7d5

Browse files
feat(genai): gemini 2.5 model name update (#13438)
* feat(genai): Update google gemini model names * feat(genai): Update google genai SDK version * fix(genai): add bug fixes.
1 parent 242fb36 commit c79f7d5

File tree

62 files changed

+66
-64
lines changed

Some content is hidden

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

62 files changed

+66
-64
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-genai==1.16.1
1+
google-genai==1.20.0

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.5-flash-preview-05-20",
97+
model="gemini-2.5-flash",
9898
contents=[
9999
Part.from_uri(
100100
file_uri=image_uri,

genai/bounding_box/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-genai==1.16.1
1+
google-genai==1.20.0
22
pillow==11.1.0

genai/content_cache/contentcache_create_with_txt_gcs_pdf.py

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

4444
content_cache = client.caches.create(
45-
model="gemini-2.5-flash-preview-05-20",
45+
model="gemini-2.5-flash",
4646
config=CreateCachedContentConfig(
4747
contents=contents,
4848
system_instruction=system_instruction,
49+
# (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/..."
4951
display_name="example-cache",
5052
ttl="86400s",
5153
),

genai/content_cache/contentcache_use_with_txt.py

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

genai/content_cache/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-genai==1.16.1
1+
google-genai==1.20.0

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.5-flash-preview-05-20",
29+
model="gemini-2.5-flash",
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.5-flash-preview-05-20",
32+
model="gemini-2.5-flash",
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.5-flash-preview-05-20",
23+
model="gemini-2.5-flash",
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.5-flash-preview-05-20",
39+
model="gemini-2.5-flash",
4040
contents="List about 10 home-baked cookies and give them grades based on tastiness.",
4141
config=GenerateContentConfig(
4242
response_mime_type="application/json",

0 commit comments

Comments
 (0)