From 28e0915b4b57607badafb3181b19c67fb7b475c9 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Wed, 7 Oct 2026 08:06:34 -0700 Subject: [PATCH] docs: update generated SDK docstring examples to use gemini-flash-latest PiperOrigin-RevId: 995114254 --- google/genai/batches.py | 4 +-- google/genai/models.py | 62 ++++++++++++++++++++--------------------- google/genai/types.py | 12 ++++---- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/google/genai/batches.py b/google/genai/batches.py index 16fb077af..e460734fe 100644 --- a/google/genai/batches.py +++ b/google/genai/batches.py @@ -2286,7 +2286,7 @@ def create( .. code-block:: python batch_job = client.batches.create( - model="gemini-2.0-flash-001", + model="gemini-flash-latest", src="gs://path/to/input/data", ) print(batch_job.state) @@ -2916,7 +2916,7 @@ async def create( .. code-block:: python batch_job = await client.aio.batches.create( - model="gemini-2.0-flash-001", + model="gemini-flash-latest", src="gs://path/to/input/data", ) """ diff --git a/google/genai/models.py b/google/genai/models.py index 5d50e6f6a..6d62e249e 100644 --- a/google/genai/models.py +++ b/google/genai/models.py @@ -5748,7 +5748,7 @@ def count_tokens( .. code-block:: python response = client.models.count_tokens( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='What is your name?', ) print(response) @@ -5859,7 +5859,7 @@ def compute_tokens( .. code-block:: python response = client.models.compute_tokens( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='What is your name?', ) print(response) @@ -6119,18 +6119,18 @@ def generate_content( For the `model` parameter, supported formats for Gemini Enterprise Agent Platform API include: - - The Gemini model ID, for example: 'gemini-2.0-flash' + - The Gemini model ID, for example: 'gemini-flash-latest' - The full resource name starts with 'projects/', for example: - 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash' + 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest' - The partial resource name with 'publishers/', for example: - 'publishers/google/models/gemini-2.0-flash' or + 'publishers/google/models/gemini-flash-latest' or - `/` separated publisher and model name, for example: - 'google/gemini-2.0-flash' + 'google/gemini-flash-latest' For the `model` parameter, supported formats for Gemini API include: - - The Gemini model ID, for example: 'gemini-2.0-flash' + - The Gemini model ID, for example: 'gemini-flash-latest' - The model name starts with 'models/', for example: - 'models/gemini-2.0-flash' + 'models/gemini-flash-latest' - For tuned models, the model name starts with 'tunedModels/', for example: 'tunedModels/1234567890123456789' @@ -6151,7 +6151,7 @@ def generate_content( ) response = client.models.generate_content( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='''What is a good name for a flower shop that specializes in selling bouquets of dried flowers?''' ) @@ -6162,7 +6162,7 @@ def generate_content( # * Timeless Petals response = client.models.generate_content( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents=[ types.Part.from_text(text='What is shown in this image?'), types.Part.from_uri(file_uri='gs://generativeai-downloads/images/scones.jpg', @@ -6290,18 +6290,18 @@ def generate_content_stream( For the `model` parameter, supported formats for Gemini Enterprise Agent Platform API include: - - The Gemini model ID, for example: 'gemini-2.0-flash' + - The Gemini model ID, for example: 'gemini-flash-latest' - The full resource name starts with 'projects/', for example: - 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash' + 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest' - The partial resource name with 'publishers/', for example: - 'publishers/google/models/gemini-2.0-flash' or + 'publishers/google/models/gemini-flash-latest' or - `/` separated publisher and model name, for example: - 'google/gemini-2.0-flash' + 'google/gemini-flash-latest' For the `model` parameter, supported formats for Gemini API include: - - The Gemini model ID, for example: 'gemini-2.0-flash' + - The Gemini model ID, for example: 'gemini-flash-latest' - The model name starts with 'models/', for example: - 'models/gemini-2.0-flash' + 'models/gemini-flash-latest' - For tuned models, the model name starts with 'tunedModels/', for example: 'tunedModels/1234567890123456789' @@ -6322,7 +6322,7 @@ def generate_content_stream( ) for chunk in client.models.generate_content_stream( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='''What is a good name for a flower shop that specializes in selling bouquets of dried flowers?''' ): @@ -6333,7 +6333,7 @@ def generate_content_stream( # * Timeless Petals for chunk in client.models.generate_content_stream( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents=[ types.Part.from_text('What is shown in this image?'), types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg', @@ -6798,7 +6798,7 @@ def list( response=client.models.list(config={'page_size': 5, 'query_base': True}) print(response.page) - # [Model(name='publishers/google/models/gemini-2.0-flash-exp' ... + # [Model(name='publishers/google/models/gemini-flash-latest' ... """ config = ( @@ -7971,7 +7971,7 @@ async def count_tokens( .. code-block:: python response = await client.aio.models.count_tokens( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='What is your name?', ) print(response) @@ -8081,7 +8081,7 @@ async def compute_tokens( .. code-block:: python response = await client.aio.models.compute_tokens( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='What is your name?', ) print(response) @@ -8285,7 +8285,7 @@ async def generate_content( ) response = await client.aio.models.generate_content( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='User input: I like bagels. Answer:', config=types.GenerateContentConfig( system_instruction= @@ -8487,18 +8487,18 @@ async def generate_content_stream( For the `model` parameter, supported formats for Gemini Enterprise Agent Platform API include: - - The Gemini model ID, for example: 'gemini-2.0-flash' + - The Gemini model ID, for example: 'gemini-flash-latest' - The full resource name starts with 'projects/', for example: - 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash' + 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest' - The partial resource name with 'publishers/', for example: - 'publishers/google/models/gemini-2.0-flash' or + 'publishers/google/models/gemini-flash-latest' or - `/` separated publisher and model name, for example: - 'google/gemini-2.0-flash' + 'google/gemini-flash-latest' For the `model` parameter, supported formats for Gemini API include: - - The Gemini model ID, for example: 'gemini-2.0-flash' + - The Gemini model ID, for example: 'gemini-flash-latest' - The model name starts with 'models/', for example: - 'models/gemini-2.0-flash' + 'models/gemini-flash-latest' - For tuned models, the model name starts with 'tunedModels/', for example: 'tunedModels/1234567890123456789' @@ -8519,7 +8519,7 @@ async def generate_content_stream( ) async for chunk in await client.aio.models.generate_content_stream( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents='''What is a good name for a flower shop that specializes in selling bouquets of dried flowers?''' ): @@ -8530,7 +8530,7 @@ async def generate_content_stream( # * Timeless Petals async for chunk in await client.aio.models.generate_content_stream( - model='gemini-2.0-flash', + model='gemini-flash-latest', contents=[ types.Part.from_text('What is shown in this image?'), types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg', @@ -8837,7 +8837,7 @@ async def list( config={'page_size': 5, 'query_base': True} ) print(response.page) - # [Model(name='publishers/google/models/gemini-2.0-flash-exp' ... + # [Model(name='publishers/google/models/gemini-flash-latest' ... """ config = ( diff --git a/google/genai/types.py b/google/genai/types.py index e900db1c1..b0b07fa4e 100644 --- a/google/genai/types.py +++ b/google/genai/types.py @@ -16278,7 +16278,7 @@ class _CreateTuningJobParametersPrivate(_common.BaseModel): base_model: Optional[str] = Field( default=None, - description="""The base model that is being tuned, e.g., "gemini-2.5-flash".""", + description="""The base model that is being tuned, e.g., "gemini-flash-latest".""", ) pre_tuned_model: Optional[PreTunedModel] = Field( default=None, description="""The PreTunedModel that is being tuned.""" @@ -16296,7 +16296,7 @@ class _CreateTuningJobParametersPrivateDict(TypedDict, total=False): """Fine-tuning job creation parameters - optional fields.""" base_model: Optional[str] - """The base model that is being tuned, e.g., "gemini-2.5-flash".""" + """The base model that is being tuned, e.g., "gemini-flash-latest".""" pre_tuned_model: Optional[PreTunedModelDict] """The PreTunedModel that is being tuned.""" @@ -16638,7 +16638,7 @@ class _CreateCachedContentParameters(_common.BaseModel): model: Optional[str] = Field( default=None, - description="""ID of the model to use. Example: gemini-2.0-flash""", + description="""ID of the model to use. Example: gemini-flash-latest""", ) config: Optional[CreateCachedContentConfig] = Field( default=None, @@ -16651,7 +16651,7 @@ class _CreateCachedContentParametersDict(TypedDict, total=False): """Parameters for caches.create method.""" model: Optional[str] - """ID of the model to use. Example: gemini-2.0-flash""" + """ID of the model to use. Example: gemini-flash-latest""" config: Optional[CreateCachedContentConfigDict] """Configuration that contains optional parameters. @@ -22709,7 +22709,7 @@ class CreateTuningJobParameters(_common.BaseModel): base_model: Optional[str] = Field( default=None, - description="""The base model that is being tuned, e.g., "gemini-2.5-flash".""", + description="""The base model that is being tuned, e.g., "gemini-flash-latest".""", ) training_dataset: Optional[TuningDataset] = Field( default=None, @@ -22724,7 +22724,7 @@ class CreateTuningJobParametersDict(TypedDict, total=False): """Fine-tuning job creation parameters - optional fields.""" base_model: Optional[str] - """The base model that is being tuned, e.g., "gemini-2.5-flash".""" + """The base model that is being tuned, e.g., "gemini-flash-latest".""" training_dataset: Optional[TuningDatasetDict] """Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."""