Skip to content

Commit 16ebde7

Browse files
feat(genai): model and SDK updates for 2025 May (#13381)
* feat(genai): update to use latest SDK version * feat(genai): update to use global endpoint as location * fix(genai): copyright year All genai samples are created only in 2025. * feat(genai): update to use gemini 2.5 flash * fix(genai): lint error * fix(genai): error * fix(genai): lint error * fix(genai): No global endpoint support for Model optimiser * fix(genai): rollback model updates for function calling
1 parent 1013b37 commit 16ebde7

File tree

67 files changed

+83
-82
lines changed

Some content is hidden

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

67 files changed

+83
-82
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-genai==1.7.0
1+
google-genai==1.16.1

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/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.7.0
1+
google-genai==1.16.1
22
pillow==11.1.0

genai/bounding_box/test_bounding_box_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import boundingbox_with_txt_img
2222

2323
os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True"
24-
os.environ["GOOGLE_CLOUD_LOCATION"] = "us-central1"
24+
os.environ["GOOGLE_CLOUD_LOCATION"] = "global" # "us-central1"
2525
# The project name is included in the CICD pipeline
2626
# os.environ['GOOGLE_CLOUD_PROJECT'] = "add-your-project-name"
2727

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/content_cache/requirements.txt

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

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",

0 commit comments

Comments
 (0)