Skip to content

Commit 28e0915

Browse files
google-genai-botcopybara-github
authored andcommitted
docs: update generated SDK docstring examples to use gemini-flash-latest
PiperOrigin-RevId: 995114254
1 parent fa4acc7 commit 28e0915

3 files changed

Lines changed: 39 additions & 39 deletions

File tree

‎google/genai/batches.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ def create(
22862286
.. code-block:: python
22872287
22882288
batch_job = client.batches.create(
2289-
model="gemini-2.0-flash-001",
2289+
model="gemini-flash-latest",
22902290
src="gs://path/to/input/data",
22912291
)
22922292
print(batch_job.state)
@@ -2916,7 +2916,7 @@ async def create(
29162916
.. code-block:: python
29172917
29182918
batch_job = await client.aio.batches.create(
2919-
model="gemini-2.0-flash-001",
2919+
model="gemini-flash-latest",
29202920
src="gs://path/to/input/data",
29212921
)
29222922
"""

‎google/genai/models.py‎

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5748,7 +5748,7 @@ def count_tokens(
57485748
.. code-block:: python
57495749
57505750
response = client.models.count_tokens(
5751-
model='gemini-2.0-flash',
5751+
model='gemini-flash-latest',
57525752
contents='What is your name?',
57535753
)
57545754
print(response)
@@ -5859,7 +5859,7 @@ def compute_tokens(
58595859
.. code-block:: python
58605860
58615861
response = client.models.compute_tokens(
5862-
model='gemini-2.0-flash',
5862+
model='gemini-flash-latest',
58635863
contents='What is your name?',
58645864
)
58655865
print(response)
@@ -6119,18 +6119,18 @@ def generate_content(
61196119
61206120
For the `model` parameter, supported formats for Gemini Enterprise Agent
61216121
Platform API include:
6122-
- The Gemini model ID, for example: 'gemini-2.0-flash'
6122+
- The Gemini model ID, for example: 'gemini-flash-latest'
61236123
- The full resource name starts with 'projects/', for example:
6124-
'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
6124+
'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest'
61256125
- The partial resource name with 'publishers/', for example:
6126-
'publishers/google/models/gemini-2.0-flash' or
6126+
'publishers/google/models/gemini-flash-latest' or
61276127
- `/` separated publisher and model name, for example:
6128-
'google/gemini-2.0-flash'
6128+
'google/gemini-flash-latest'
61296129
61306130
For the `model` parameter, supported formats for Gemini API include:
6131-
- The Gemini model ID, for example: 'gemini-2.0-flash'
6131+
- The Gemini model ID, for example: 'gemini-flash-latest'
61326132
- The model name starts with 'models/', for example:
6133-
'models/gemini-2.0-flash'
6133+
'models/gemini-flash-latest'
61346134
- For tuned models, the model name starts with 'tunedModels/',
61356135
for example:
61366136
'tunedModels/1234567890123456789'
@@ -6151,7 +6151,7 @@ def generate_content(
61516151
)
61526152
61536153
response = client.models.generate_content(
6154-
model='gemini-2.0-flash',
6154+
model='gemini-flash-latest',
61556155
contents='''What is a good name for a flower shop that specializes in
61566156
selling bouquets of dried flowers?'''
61576157
)
@@ -6162,7 +6162,7 @@ def generate_content(
61626162
# * Timeless Petals
61636163
61646164
response = client.models.generate_content(
6165-
model='gemini-2.0-flash',
6165+
model='gemini-flash-latest',
61666166
contents=[
61676167
types.Part.from_text(text='What is shown in this image?'),
61686168
types.Part.from_uri(file_uri='gs://generativeai-downloads/images/scones.jpg',
@@ -6290,18 +6290,18 @@ def generate_content_stream(
62906290
62916291
For the `model` parameter, supported formats for Gemini Enterprise Agent
62926292
Platform API include:
6293-
- The Gemini model ID, for example: 'gemini-2.0-flash'
6293+
- The Gemini model ID, for example: 'gemini-flash-latest'
62946294
- The full resource name starts with 'projects/', for example:
6295-
'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
6295+
'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest'
62966296
- The partial resource name with 'publishers/', for example:
6297-
'publishers/google/models/gemini-2.0-flash' or
6297+
'publishers/google/models/gemini-flash-latest' or
62986298
- `/` separated publisher and model name, for example:
6299-
'google/gemini-2.0-flash'
6299+
'google/gemini-flash-latest'
63006300
63016301
For the `model` parameter, supported formats for Gemini API include:
6302-
- The Gemini model ID, for example: 'gemini-2.0-flash'
6302+
- The Gemini model ID, for example: 'gemini-flash-latest'
63036303
- The model name starts with 'models/', for example:
6304-
'models/gemini-2.0-flash'
6304+
'models/gemini-flash-latest'
63056305
- For tuned models, the model name starts with 'tunedModels/',
63066306
for example:
63076307
'tunedModels/1234567890123456789'
@@ -6322,7 +6322,7 @@ def generate_content_stream(
63226322
)
63236323
63246324
for chunk in client.models.generate_content_stream(
6325-
model='gemini-2.0-flash',
6325+
model='gemini-flash-latest',
63266326
contents='''What is a good name for a flower shop that specializes in
63276327
selling bouquets of dried flowers?'''
63286328
):
@@ -6333,7 +6333,7 @@ def generate_content_stream(
63336333
# * Timeless Petals
63346334
63356335
for chunk in client.models.generate_content_stream(
6336-
model='gemini-2.0-flash',
6336+
model='gemini-flash-latest',
63376337
contents=[
63386338
types.Part.from_text('What is shown in this image?'),
63396339
types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg',
@@ -6798,7 +6798,7 @@ def list(
67986798
67996799
response=client.models.list(config={'page_size': 5, 'query_base': True})
68006800
print(response.page)
6801-
# [Model(name='publishers/google/models/gemini-2.0-flash-exp' ...
6801+
# [Model(name='publishers/google/models/gemini-flash-latest' ...
68026802
"""
68036803

68046804
config = (
@@ -7971,7 +7971,7 @@ async def count_tokens(
79717971
.. code-block:: python
79727972
79737973
response = await client.aio.models.count_tokens(
7974-
model='gemini-2.0-flash',
7974+
model='gemini-flash-latest',
79757975
contents='What is your name?',
79767976
)
79777977
print(response)
@@ -8081,7 +8081,7 @@ async def compute_tokens(
80818081
.. code-block:: python
80828082
80838083
response = await client.aio.models.compute_tokens(
8084-
model='gemini-2.0-flash',
8084+
model='gemini-flash-latest',
80858085
contents='What is your name?',
80868086
)
80878087
print(response)
@@ -8285,7 +8285,7 @@ async def generate_content(
82858285
)
82868286
82878287
response = await client.aio.models.generate_content(
8288-
model='gemini-2.0-flash',
8288+
model='gemini-flash-latest',
82898289
contents='User input: I like bagels. Answer:',
82908290
config=types.GenerateContentConfig(
82918291
system_instruction=
@@ -8487,18 +8487,18 @@ async def generate_content_stream(
84878487
84888488
For the `model` parameter, supported formats for Gemini Enterprise Agent
84898489
Platform API include:
8490-
- The Gemini model ID, for example: 'gemini-2.0-flash'
8490+
- The Gemini model ID, for example: 'gemini-flash-latest'
84918491
- The full resource name starts with 'projects/', for example:
8492-
'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
8492+
'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest'
84938493
- The partial resource name with 'publishers/', for example:
8494-
'publishers/google/models/gemini-2.0-flash' or
8494+
'publishers/google/models/gemini-flash-latest' or
84958495
- `/` separated publisher and model name, for example:
8496-
'google/gemini-2.0-flash'
8496+
'google/gemini-flash-latest'
84978497
84988498
For the `model` parameter, supported formats for Gemini API include:
8499-
- The Gemini model ID, for example: 'gemini-2.0-flash'
8499+
- The Gemini model ID, for example: 'gemini-flash-latest'
85008500
- The model name starts with 'models/', for example:
8501-
'models/gemini-2.0-flash'
8501+
'models/gemini-flash-latest'
85028502
- For tuned models, the model name starts with 'tunedModels/',
85038503
for example:
85048504
'tunedModels/1234567890123456789'
@@ -8519,7 +8519,7 @@ async def generate_content_stream(
85198519
)
85208520
85218521
async for chunk in await client.aio.models.generate_content_stream(
8522-
model='gemini-2.0-flash',
8522+
model='gemini-flash-latest',
85238523
contents='''What is a good name for a flower shop that specializes in
85248524
selling bouquets of dried flowers?'''
85258525
):
@@ -8530,7 +8530,7 @@ async def generate_content_stream(
85308530
# * Timeless Petals
85318531
85328532
async for chunk in await client.aio.models.generate_content_stream(
8533-
model='gemini-2.0-flash',
8533+
model='gemini-flash-latest',
85348534
contents=[
85358535
types.Part.from_text('What is shown in this image?'),
85368536
types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg',
@@ -8837,7 +8837,7 @@ async def list(
88378837
config={'page_size': 5, 'query_base': True}
88388838
)
88398839
print(response.page)
8840-
# [Model(name='publishers/google/models/gemini-2.0-flash-exp' ...
8840+
# [Model(name='publishers/google/models/gemini-flash-latest' ...
88418841
"""
88428842

88438843
config = (

‎google/genai/types.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16278,7 +16278,7 @@ class _CreateTuningJobParametersPrivate(_common.BaseModel):
1627816278

1627916279
base_model: Optional[str] = Field(
1628016280
default=None,
16281-
description="""The base model that is being tuned, e.g., "gemini-2.5-flash".""",
16281+
description="""The base model that is being tuned, e.g., "gemini-flash-latest".""",
1628216282
)
1628316283
pre_tuned_model: Optional[PreTunedModel] = Field(
1628416284
default=None, description="""The PreTunedModel that is being tuned."""
@@ -16296,7 +16296,7 @@ class _CreateTuningJobParametersPrivateDict(TypedDict, total=False):
1629616296
"""Fine-tuning job creation parameters - optional fields."""
1629716297

1629816298
base_model: Optional[str]
16299-
"""The base model that is being tuned, e.g., "gemini-2.5-flash"."""
16299+
"""The base model that is being tuned, e.g., "gemini-flash-latest"."""
1630016300

1630116301
pre_tuned_model: Optional[PreTunedModelDict]
1630216302
"""The PreTunedModel that is being tuned."""
@@ -16638,7 +16638,7 @@ class _CreateCachedContentParameters(_common.BaseModel):
1663816638

1663916639
model: Optional[str] = Field(
1664016640
default=None,
16641-
description="""ID of the model to use. Example: gemini-2.0-flash""",
16641+
description="""ID of the model to use. Example: gemini-flash-latest""",
1664216642
)
1664316643
config: Optional[CreateCachedContentConfig] = Field(
1664416644
default=None,
@@ -16651,7 +16651,7 @@ class _CreateCachedContentParametersDict(TypedDict, total=False):
1665116651
"""Parameters for caches.create method."""
1665216652

1665316653
model: Optional[str]
16654-
"""ID of the model to use. Example: gemini-2.0-flash"""
16654+
"""ID of the model to use. Example: gemini-flash-latest"""
1665516655

1665616656
config: Optional[CreateCachedContentConfigDict]
1665716657
"""Configuration that contains optional parameters.
@@ -22709,7 +22709,7 @@ class CreateTuningJobParameters(_common.BaseModel):
2270922709

2271022710
base_model: Optional[str] = Field(
2271122711
default=None,
22712-
description="""The base model that is being tuned, e.g., "gemini-2.5-flash".""",
22712+
description="""The base model that is being tuned, e.g., "gemini-flash-latest".""",
2271322713
)
2271422714
training_dataset: Optional[TuningDataset] = Field(
2271522715
default=None,
@@ -22724,7 +22724,7 @@ class CreateTuningJobParametersDict(TypedDict, total=False):
2272422724
"""Fine-tuning job creation parameters - optional fields."""
2272522725

2272622726
base_model: Optional[str]
22727-
"""The base model that is being tuned, e.g., "gemini-2.5-flash"."""
22727+
"""The base model that is being tuned, e.g., "gemini-flash-latest"."""
2272822728

2272922729
training_dataset: Optional[TuningDatasetDict]
2273022730
"""Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."""

0 commit comments

Comments
 (0)