diff --git a/README.md b/README.md index 1e38f3f60..0bf196931 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Below is an example `generate_content()` call using `Part` from the `types` modu ```python response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=types.Part.from_text(text='Why is the sky blue?') ) ``` @@ -105,7 +105,7 @@ types: ```python response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents={'text': 'Why is the sky blue?'} ) ``` @@ -367,7 +367,7 @@ See the 'Create a client' section above to initialize a client. ```python response = client.models.generate_content( - model='gemini-flash-latest', contents='Why is the sky blue?' + model='gemini-3.8-flash', contents='Why is the sky blue?' ) print(response.text) ``` @@ -433,7 +433,7 @@ python code. ```python file = client.files.upload(file='a11.txt') response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=['Could you summarize this file?', file] ) print(response.text) @@ -664,7 +664,7 @@ we use `GenerateContentConfig` to specify the desired behavior from the model. from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='high', config=types.GenerateContentConfig( system_instruction='I say high, you say low', @@ -697,14 +697,14 @@ client = genai.Client( # Automatic continuation is enabled by default. response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Write a comprehensive multi-chapter guide on compiler design.', ) print(response.text) # Set automatic_continuation=False to disable automatic continuation. single_hop_response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Write a comprehensive multi-chapter guide on compiler design.', config=types.GenerateContentConfig( automatic_continuation=False, @@ -751,7 +751,7 @@ print(async_pager[0]) from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Say something bad.', config=types.GenerateContentConfig( safety_settings=[ @@ -785,7 +785,7 @@ def get_current_weather(location: str) -> str: response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is the weather like in Boston?', config=types.GenerateContentConfig(tools=[get_current_weather]), ) @@ -803,7 +803,7 @@ as follows: from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is the weather like in Boston?', config=types.GenerateContentConfig( tools=[get_current_weather], @@ -850,7 +850,7 @@ function = types.FunctionDeclaration( tool = types.Tool(function_declarations=[function]) response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is the weather like in Boston?', config=types.GenerateContentConfig(tools=[tool]), ) @@ -894,7 +894,7 @@ function_response_content = types.Content( ) response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=[ user_prompt_content, function_call_content, @@ -929,7 +929,7 @@ def get_current_weather(location: str) -> str: return "sunny" response = client.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents="What is the weather like in Boston?", config=types.GenerateContentConfig( tools=[get_current_weather], @@ -959,7 +959,7 @@ def get_current_weather(location: str) -> str: return "sunny" response = client.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents="What is the weather like in Boston?", config=types.GenerateContentConfig( tools=[get_current_weather], @@ -1010,7 +1010,7 @@ async def run(): # Send request to the model with MCP function declarations response = await client.aio.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents=prompt, config=genai.types.GenerateContentConfig( tools=[session], # uses the session, will automatically call the tool using automatic function calling @@ -1045,7 +1045,7 @@ client = genai.Client(enterprise=True, project=PROJECT_ID, location=LOCATION) async def agent_platform_mcp(): response = await client.aio.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents=f"List my endpoints in {LOCATION} for my {PROJECT_ID} project.", config = types.GenerateContentConfig( tools=[ @@ -1109,7 +1109,7 @@ user_profile = { } response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Give me a random user profile.', config={ 'response_mime_type': 'application/json', @@ -1139,7 +1139,7 @@ class CountryInfo(BaseModel): response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Give me information for the United States.', config=types.GenerateContentConfig( response_mime_type='application/json', @@ -1153,7 +1153,7 @@ print(response.text) from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Give me information for the United States.', config=types.GenerateContentConfig( response_mime_type='application/json', @@ -1192,7 +1192,7 @@ to you, rather than being returned as one chunk. ```python for chunk in client.models.generate_content_stream( - model='gemini-flash-latest', contents='Tell me a story in 300 words.' + model='gemini-3.8-flash', contents='Tell me a story in 300 words.' ): print(chunk.text, end='') ``` @@ -1206,7 +1206,7 @@ you can use the `from_uri` class method to create a `Part` object. from google.genai import types for chunk in client.models.generate_content_stream( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=[ 'What is this image about?', types.Part.from_uri( @@ -1230,7 +1230,7 @@ with open(YOUR_IMAGE_PATH, 'rb') as f: image_bytes = f.read() for chunk in client.models.generate_content_stream( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=[ 'What is this image about?', types.Part.from_bytes(data=image_bytes, mime_type=YOUR_IMAGE_MIME_TYPE), @@ -1249,7 +1249,7 @@ of `client.models.generate_content` ```python response = await client.aio.models.generate_content( - model='gemini-flash-latest', contents='Tell me a story in 300 words.' + model='gemini-3.8-flash', contents='Tell me a story in 300 words.' ) print(response.text) @@ -1259,7 +1259,7 @@ print(response.text) ```python async for chunk in await client.aio.models.generate_content_stream( - model='gemini-flash-latest', contents='Tell me a story in 300 words.' + model='gemini-3.8-flash', contents='Tell me a story in 300 words.' ): print(chunk.text, end='') ``` @@ -1268,7 +1268,7 @@ async for chunk in await client.aio.models.generate_content_stream( ```python response = client.models.count_tokens( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='why is the sky blue?', ) print(response) @@ -1280,7 +1280,7 @@ Compute tokens is only supported in Gemini Enterprise Agent Platform. ```python response = client.models.compute_tokens( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='why is the sky blue?', ) print(response) @@ -1290,7 +1290,7 @@ print(response) ```python response = await client.aio.models.count_tokens( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='why is the sky blue?', ) print(response) @@ -1313,7 +1313,7 @@ pip install "google-genai[local-tokenizer-transformers]" ```python from google.genai import local_tokenizer -tokenizer = local_tokenizer.LocalTokenizer(model_name='gemini-flash-latest') +tokenizer = local_tokenizer.LocalTokenizer(model_name='gemini-3.8-flash') result = tokenizer.count_tokens("What is your name?") ``` @@ -1322,7 +1322,7 @@ result = tokenizer.count_tokens("What is your name?") ```python from google.genai import local_tokenizer -tokenizer = local_tokenizer.LocalTokenizer(model_name='gemini-flash-latest') +tokenizer = local_tokenizer.LocalTokenizer(model_name='gemini-3.8-flash') result = tokenizer.compute_tokens("What is your name?") ``` @@ -1545,7 +1545,7 @@ that it can reflect on its previous responses (i.e., engage in an ongoing ### Send Message (Synchronous Non-Streaming) ```python -chat = client.chats.create(model='gemini-flash-latest') +chat = client.chats.create(model='gemini-3.8-flash') response = chat.send_message('tell me a story') print(response.text) response = chat.send_message('summarize the story you told me in 1 sentence') @@ -1555,7 +1555,7 @@ print(response.text) ### Send Message (Synchronous Streaming) ```python -chat = client.chats.create(model='gemini-flash-latest') +chat = client.chats.create(model='gemini-3.8-flash') for chunk in chat.send_message_stream('tell me a story'): print(chunk.text) ``` @@ -1563,7 +1563,7 @@ for chunk in chat.send_message_stream('tell me a story'): ### Send Message (Asynchronous Non-Streaming) ```python -chat = client.aio.chats.create(model='gemini-flash-latest') +chat = client.aio.chats.create(model='gemini-3.8-flash') response = await chat.send_message('tell me a story') print(response.text) ``` @@ -1571,7 +1571,7 @@ print(response.text) ### Send Message (Asynchronous Streaming) ```python -chat = client.aio.chats.create(model='gemini-flash-latest') +chat = client.aio.chats.create(model='gemini-3.8-flash') async for chunk in await chat.send_message_stream('tell me a story'): print(chunk.text) ``` @@ -1630,7 +1630,7 @@ else: file_uris = [file1.uri, file2.uri] cached_content = client.caches.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', config=types.CreateCachedContentConfig( contents=[ types.Content( @@ -1665,7 +1665,7 @@ cached_content = client.caches.get(name=cached_content.name) from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Summarize the pdfs', config=types.GenerateContentConfig( cached_content=cached_content.name, @@ -1684,7 +1684,7 @@ See the [documentation site](https://ai.google.dev/gemini-api/docs/interactions) ```python interaction = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', input='Tell me a short joke about programming.' ) print(interaction.output_text) @@ -1698,14 +1698,14 @@ The Interactions API supports server-side state management. You can continue a c ```python # 1. First turn interaction1 = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', input='Hi, my name is Amir.' ) print(f"Model: {interaction1.output_text}") # 2. Second turn (passing previous_interaction_id) interaction2 = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', input='What is my name?', previous_interaction_id=interaction1.id ) @@ -1755,7 +1755,7 @@ import base64 # base64_image = ... interaction = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', input=[ {'type': 'text', 'text': 'Describe the image.'}, {'type': 'image', 'data': base64_image, 'mime_type': 'image/png'} @@ -1790,7 +1790,7 @@ weather_tool = { # 2. Send the request with tools interaction = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', input='What is the weather in Mountain View, CA?', tools=[weather_tool] ) @@ -1805,7 +1805,7 @@ for step in (interaction.steps or []): # Send result back to the model interaction = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', previous_interaction_id=interaction.id, input=[{ 'type': 'function_result', @@ -1825,7 +1825,7 @@ You can also use Google's built-in tools, such as **Google Search** or **Code Ex ```python interaction = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', input='Who won the last Super Bowl?', tools=[{'type': 'google_search'}] ) @@ -1837,7 +1837,7 @@ print(interaction.output_text) ```python interaction = client.interactions.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', input='Calculate the 50th Fibonacci number.', tools=[{'type': 'code_execution'}] ) @@ -1897,7 +1897,7 @@ section above to initialize a client. ```python from google.genai import types -model = 'gemini-flash-latest' +model = 'gemini-3.8-flash' training_dataset = types.TuningDataset( # or gcs_uri=my_enterprise_multimodal_dataset gcs_uri='gs://your-gcs-bucket/your-tuning-data.jsonl', @@ -2051,7 +2051,7 @@ Gemini Enterprise Agent Platform: ```python # Specify model and source file only, destination and job display name will be auto-populated job = client.batches.create( - model='gemini-flash-latest', + model='gemini-3.8-flash', src='bq://my-project.my-dataset.my-table', # or "gs://path/to/input/data" ) @@ -2063,7 +2063,7 @@ Gemini Developer API: ```python # Create a batch job with inlined requests batch_job = client.batches.create( - model="gemini-flash-latest", + model="gemini-3.8-flash", src=[{ "contents": [{ "parts": [{ @@ -2098,7 +2098,7 @@ file = client.files.upload( # Create a batch job with file name batch_job = client.batches.create( - model="gemini-flash-latest", + model="gemini-3.8-flash", src="files/test-json", ) ``` @@ -2200,7 +2200,7 @@ The structure of the dictionary must match the backend API's request structure. ```python response = client.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents="What is the weather in Boston? and how about Sunnyvale?", config=types.GenerateContentConfig( tools=[get_current_weather], diff --git a/docs/source/index.rst b/docs/source/index.rst index 60dc7f62b..0ba6b1fce 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -302,7 +302,7 @@ with text content input (text output) .. code:: python response = client.models.generate_content( - model='gemini-flash-latest', contents='Why is the sky blue?' + model='gemini-3.8-flash', contents='Why is the sky blue?' ) print(response.text) @@ -374,7 +374,7 @@ python code. file = client.files.upload(file='a11.txt') response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=['Could you summarize this file?', file] ) print(response.text) @@ -614,7 +614,7 @@ and `Gemini API docs `_ respectively. from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='high', config=types.GenerateContentConfig( system_instruction='I say high, you say low', @@ -635,7 +635,7 @@ dictionaries. You can get the type from ``google.genai.types``. from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=types.Part.from_text(text='Why is the sky blue?'), config=types.GenerateContentConfig( temperature=0, @@ -694,7 +694,7 @@ Safety Settings from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Say something bad.', config=types.GenerateContentConfig( safety_settings=[ @@ -730,7 +730,7 @@ called and responded by default. response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is the weather like in Boston?', config=types.GenerateContentConfig( tools=[get_current_weather], @@ -751,7 +751,7 @@ as follows: from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is the weather like in Boston?', config=types.GenerateContentConfig( tools=[get_current_weather], @@ -800,7 +800,7 @@ Then you will receive a function call part in the response. tool = types.Tool(function_declarations=[function]) response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is the weather like in Boston?', config=types.GenerateContentConfig( tools=[tool], @@ -845,7 +845,7 @@ The following example shows how to do it for a simple function invocation. ) response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=[ user_prompt_content, function_call_content, @@ -882,7 +882,7 @@ If you'd like to disable automatic function calling in `ANY` mode: return "sunny" response = client.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents="What is the weather like in Boston?", config=types.GenerateContentConfig( tools=[get_current_weather], @@ -912,7 +912,7 @@ Assuming you prefer ``1`` turn for automatic function calling: return "sunny" response = client.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents="What is the weather like in Boston?", config=types.GenerateContentConfig( tools=[get_current_weather], @@ -960,7 +960,7 @@ experimental feature. You can pass a local MCP server as a tool directly. # Send request to the model with MCP function declarations response = await client.aio.models.generate_content( - model="gemini-flash-latest", + model="gemini-3.8-flash", contents=prompt, config=genai.types.GenerateContentConfig( temperature=0, @@ -1008,7 +1008,7 @@ Schemas can be provided as standard JSON schema. } response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Give me a random user profile.', config={ 'response_mime_type': 'application/json', @@ -1040,7 +1040,7 @@ Schemas can be provided as Pydantic Models. response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Give me information for the United States.', config=types.GenerateContentConfig( response_mime_type='application/json', @@ -1054,7 +1054,7 @@ Schemas can be provided as Pydantic Models. from google.genai import types response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Give me information for the United States.', config=types.GenerateContentConfig( response_mime_type='application/json', @@ -1104,7 +1104,7 @@ values as the response. KEYBOARD = 'Keyboard' response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What instrument plays multiple notes at once?', config={ 'response_mime_type': 'text/x.enum', @@ -1131,7 +1131,7 @@ identical but in quotes. KEYBOARD = 'Keyboard' response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What instrument plays multiple notes at once?', config={ 'response_mime_type': 'application/json', @@ -1152,7 +1152,7 @@ Streaming for text content .. code:: python for chunk in client.models.generate_content_stream( - model='gemini-flash-latest', contents='Tell me a story in 300 words.' + model='gemini-3.8-flash', contents='Tell me a story in 300 words.' ): print(chunk.text, end='') @@ -1166,7 +1166,7 @@ If your image is stored in `Google Cloud Storage None: enterprise=True, project='my-project-id', location='us-central1' ).aio response_1 = await async_client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Hello World', ) response_2 = await async_client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Hello World', ) # Close the client to release resources. @@ -641,11 +641,11 @@ def close(self) -> None: enterprise=True, project='my-project-id', location='us-central1' ) response_1 = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Hello World', ) response_2 = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='Hello World', ) # Close the client to release resources. diff --git a/google/genai/models.py b/google/genai/models.py index 2e8a4ee50..ddb378e50 100644 --- a/google/genai/models.py +++ b/google/genai/models.py @@ -5426,7 +5426,7 @@ def count_tokens( .. code-block:: python response = client.models.count_tokens( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is your name?', ) print(response) @@ -5537,7 +5537,7 @@ def compute_tokens( .. code-block:: python response = client.models.compute_tokens( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is your name?', ) print(response) @@ -5836,18 +5836,18 @@ def generate_content( For the `model` parameter, supported formats for Gemini Enterprise Agent Platform API include: - - The Gemini model ID, for example: 'gemini-flash-latest' + - The Gemini model ID, for example: 'gemini-3.8-flash' - The full resource name starts with 'projects/', for example: - 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest' + 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-3.8-flash' - The partial resource name with 'publishers/', for example: - 'publishers/google/models/gemini-flash-latest' or + 'publishers/google/models/gemini-3.8-flash' or - `/` separated publisher and model name, for example: - 'google/gemini-flash-latest' + 'google/gemini-3.8-flash' For the `model` parameter, supported formats for Gemini API include: - - The Gemini model ID, for example: 'gemini-flash-latest' + - The Gemini model ID, for example: 'gemini-3.8-flash' - The model name starts with 'models/', for example: - 'models/gemini-flash-latest' + 'models/gemini-3.8-flash' - For tuned models, the model name starts with 'tunedModels/', for example: 'tunedModels/1234567890123456789' @@ -5876,7 +5876,7 @@ def generate_content( ) response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='''What is a good name for a flower shop that specializes in selling bouquets of dried flowers?''' ) @@ -5887,7 +5887,7 @@ def generate_content( # * Timeless Petals response = client.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=[ types.Part.from_text(text='What is shown in this image?'), types.Part.from_uri(file_uri='gs://generativeai-downloads/images/scones.jpg', @@ -6015,18 +6015,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-flash-latest' + - The Gemini model ID, for example: 'gemini-3.8-flash' - The full resource name starts with 'projects/', for example: - 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest' + 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-3.8-flash' - The partial resource name with 'publishers/', for example: - 'publishers/google/models/gemini-flash-latest' or + 'publishers/google/models/gemini-3.8-flash' or - `/` separated publisher and model name, for example: - 'google/gemini-flash-latest' + 'google/gemini-3.8-flash' For the `model` parameter, supported formats for Gemini API include: - - The Gemini model ID, for example: 'gemini-flash-latest' + - The Gemini model ID, for example: 'gemini-3.8-flash' - The model name starts with 'models/', for example: - 'models/gemini-flash-latest' + 'models/gemini-3.8-flash' - For tuned models, the model name starts with 'tunedModels/', for example: 'tunedModels/1234567890123456789' @@ -6056,7 +6056,7 @@ def generate_content_stream( ) for chunk in client.models.generate_content_stream( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='''What is a good name for a flower shop that specializes in selling bouquets of dried flowers?''' ): @@ -6067,7 +6067,7 @@ def generate_content_stream( # * Timeless Petals for chunk in client.models.generate_content_stream( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=[ types.Part.from_text('What is shown in this image?'), types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg', @@ -6532,7 +6532,7 @@ def list( response=client.models.list(config={'page_size': 5, 'query_base': True}) print(response.page) - # [Model(name='publishers/google/models/gemini-flash-latest' ... + # [Model(name='publishers/google/models/gemini-3.8-flash' ... """ config = ( @@ -7705,7 +7705,7 @@ async def count_tokens( .. code-block:: python response = await client.aio.models.count_tokens( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is your name?', ) print(response) @@ -7815,7 +7815,7 @@ async def compute_tokens( .. code-block:: python response = await client.aio.models.compute_tokens( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='What is your name?', ) print(response) @@ -8067,7 +8067,7 @@ async def generate_content( ) response = await client.aio.models.generate_content( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='User input: I like bagels. Answer:', config=types.GenerateContentConfig( system_instruction= @@ -8269,18 +8269,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-flash-latest' + - The Gemini model ID, for example: 'gemini-3.8-flash' - The full resource name starts with 'projects/', for example: - 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-flash-latest' + 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-3.8-flash' - The partial resource name with 'publishers/', for example: - 'publishers/google/models/gemini-flash-latest' or + 'publishers/google/models/gemini-3.8-flash' or - `/` separated publisher and model name, for example: - 'google/gemini-flash-latest' + 'google/gemini-3.8-flash' For the `model` parameter, supported formats for Gemini API include: - - The Gemini model ID, for example: 'gemini-flash-latest' + - The Gemini model ID, for example: 'gemini-3.8-flash' - The model name starts with 'models/', for example: - 'models/gemini-flash-latest' + 'models/gemini-3.8-flash' - For tuned models, the model name starts with 'tunedModels/', for example: 'tunedModels/1234567890123456789' @@ -8310,7 +8310,7 @@ async def generate_content_stream( ) async for chunk in await client.aio.models.generate_content_stream( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents='''What is a good name for a flower shop that specializes in selling bouquets of dried flowers?''' ): @@ -8321,7 +8321,7 @@ async def generate_content_stream( # * Timeless Petals async for chunk in await client.aio.models.generate_content_stream( - model='gemini-flash-latest', + model='gemini-3.8-flash', contents=[ types.Part.from_text('What is shown in this image?'), types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg', @@ -8627,7 +8627,7 @@ async def list( config={'page_size': 5, 'query_base': True} ) print(response.page) - # [Model(name='publishers/google/models/gemini-flash-latest' ... + # [Model(name='publishers/google/models/gemini-3.8-flash' ... """ config = ( diff --git a/google/genai/types.py b/google/genai/types.py index 6055e1363..e37c171ba 100644 --- a/google/genai/types.py +++ b/google/genai/types.py @@ -16408,7 +16408,7 @@ class _CreateTuningJobParametersPrivate(_common.BaseModel): base_model: Optional[str] = Field( default=None, - description="""The base model that is being tuned, e.g., "gemini-flash-latest".""", + description="""The base model that is being tuned, e.g., "gemini-3.8-flash".""", ) pre_tuned_model: Optional[PreTunedModel] = Field( default=None, description="""The PreTunedModel that is being tuned.""" @@ -16426,7 +16426,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-flash-latest".""" + """The base model that is being tuned, e.g., "gemini-3.8-flash".""" pre_tuned_model: Optional[PreTunedModelDict] """The PreTunedModel that is being tuned.""" @@ -16768,7 +16768,7 @@ class _CreateCachedContentParameters(_common.BaseModel): model: Optional[str] = Field( default=None, - description="""ID of the model to use. Example: gemini-flash-latest""", + description="""ID of the model to use. Example: gemini-3.8-flash""", ) config: Optional[CreateCachedContentConfig] = Field( default=None, @@ -16781,7 +16781,7 @@ class _CreateCachedContentParametersDict(TypedDict, total=False): """Parameters for caches.create method.""" model: Optional[str] - """ID of the model to use. Example: gemini-flash-latest""" + """ID of the model to use. Example: gemini-3.8-flash""" config: Optional[CreateCachedContentConfigDict] """Configuration that contains optional parameters. @@ -23042,7 +23042,7 @@ class CreateTuningJobParameters(_common.BaseModel): base_model: Optional[str] = Field( default=None, - description="""The base model that is being tuned, e.g., "gemini-flash-latest".""", + description="""The base model that is being tuned, e.g., "gemini-3.8-flash".""", ) training_dataset: Optional[TuningDataset] = Field( default=None, @@ -23057,7 +23057,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-flash-latest".""" + """The base model that is being tuned, e.g., "gemini-3.8-flash".""" training_dataset: Optional[TuningDatasetDict] """Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."""