Submodules

genai.client module

class genai.client.AsyncClient(api_client)

Bases: object

Client for making asynchronous (non-blocking) requests.

property auth_tokens: AsyncTokens
property batches: AsyncBatches
property caches: AsyncCaches
property chats: AsyncChats
property files: AsyncFiles
property live: AsyncLive
property models: AsyncModels
property operations: AsyncOperations
property tunings: AsyncTunings
class genai.client.Client(*, vertexai=None, api_key=None, credentials=None, project=None, location=None, debug_config=None, http_options=None)

Bases: object

Client for making synchronous requests.

Use this client to make a request to the Gemini Developer API or Vertex AI API and then wait for the response.

To initialize the client, provide the required arguments either directly or by using environment variables. Gemini API users and Vertex AI users in express mode can provide API key by providing input argument api_key=”your-api-key” or by defining GOOGLE_API_KEY=”your-api-key” as an environment variable

Vertex AI API users can provide inputs argument as vertexai=True, project=”your-project-id”, location=”us-central1” or by defining GOOGLE_GENAI_USE_VERTEXAI=true, GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION environment variables.

api_key

The API key to use for authentication. Applies to the Gemini Developer API only.

vertexai

Indicates whether the client should use the Vertex AI API endpoints. Defaults to False (uses Gemini Developer API endpoints). Applies to the Vertex AI API only.

credentials

The credentials to use for authentication when calling the Vertex AI APIs. Credentials can be obtained from environment variables and default credentials. For more information, see Set up Application Default Credentials. Applies to the Vertex AI API only.

project

The Google Cloud project ID to use for quota. Can be obtained from environment variables (for example, GOOGLE_CLOUD_PROJECT). Applies to the Vertex AI API only. Find your Google Cloud project ID.

location

The location to send API requests to (for example, us-central1). Can be obtained from environment variables. Applies to the Vertex AI API only.

debug_config

Config settings that control network behavior of the client. This is typically used when running test code.

http_options

Http options to use for the client. These options will be applied to all requests made by the client. Example usage: client = genai.Client(http_options=types.HttpOptions(api_version=’v1’)).

Usage for the Gemini Developer API:

from google import genai

client = genai.Client(api_key='my-api-key')

Usage for the Vertex AI API:

from google import genai

client = genai.Client(
    vertexai=True, project='my-project-id', location='us-central1'
)

Initializes the client.

Parameters:
  • vertexai (bool) – Indicates whether the client should use the Vertex AI API endpoints. Defaults to False (uses Gemini Developer API endpoints). Applies to the Vertex AI API only.

  • api_key (str) –

    The API key to use for authentication. Applies to the Gemini Developer API only.

  • credentials (google.auth.credentials.Credentials) –

    The credentials to use for authentication when calling the Vertex AI APIs. Credentials can be obtained from environment variables and default credentials. For more information, see Set up Application Default Credentials. Applies to the Vertex AI API only.

  • project (str) –

    The Google Cloud project ID to use for quota. Can be obtained from environment variables (for example, GOOGLE_CLOUD_PROJECT). Applies to the Vertex AI API only.

  • location (str) –

    The location to send API requests to (for example, us-central1). Can be obtained from environment variables. Applies to the Vertex AI API only.

  • debug_config (DebugConfig) – Config settings that control network behavior of the client. This is typically used when running test code.

  • http_options (Union[HttpOptions, HttpOptionsDict]) – Http options to use for the client.

property aio: AsyncClient
property auth_tokens: Tokens
property batches: Batches
property caches: Caches
property chats: Chats
property files: Files
property models: Models
property operations: Operations
property tunings: Tunings
property vertexai: bool

Returns whether the client is using the Vertex AI API.

pydantic model genai.client.DebugConfig

Bases: BaseModel

Configuration options that change client network behavior when testing.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DebugConfig",
   "description": "Configuration options that change client network behavior when testing.",
   "type": "object",
   "properties": {
      "client_mode": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "title": "Client Mode"
      },
      "replays_directory": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "title": "Replays Directory"
      },
      "replay_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "title": "Replay Id"
      }
   }
}

Fields:
field client_mode: Optional[str] [Optional]
field replay_id: Optional[str] [Optional]
field replays_directory: Optional[str] [Optional]

genai.batches module

class genai.batches.AsyncBatches(api_client_)

Bases: BaseModule

async cancel(*, name, config=None)

Cancels a batch job.

Only available for batch jobs that are running or pending.

Return type:

None

Parameters:

name (str) –

A fully-qualified BatchJob resource name or ID. Example: “projects/…/locations/…/batchPredictionJobs/123456789” or

”123456789” when project and location are initialized in the client.

Usage:

await client.aio.batches.cancel(name='123456789')
async create(*, model, src, config=None)

Creates a batch job asynchronously.

Return type:

BatchJob

Parameters:
  • model (str) – The model to use for the batch job.

  • src (str) – The source of the batch job. Currently supports GCS URI(-s) or BigQuery URI. Example: “gs://path/to/input/data” or “bq://projectId.bqDatasetId.bqTableId”.

  • config (CreateBatchJobConfig) – Optional configuration for the batch job.

Returns:

A BatchJob object that contains details about the batch job.

Usage:

batch_job = await client.aio.batches.create(
    model="gemini-2.0-flash-001",
    src="gs://path/to/input/data",
)
async delete(*, name, config=None)

Deletes a batch job.

Return type:

DeleteResourceJob

Parameters:

name (str) –

A fully-qualified BatchJob resource name or ID. Example: “projects/…/locations/…/batchPredictionJobs/456” or “456”

when project and location are initialized in the client.

Returns:

A DeleteResourceJob object that shows the status of the deletion.

Usage:

await client.aio.batches.delete(name='123456789')
async get(*, name, config=None)

Gets a batch job.

Return type:

BatchJob

Parameters:

name (str) –

A fully-qualified BatchJob resource name or ID. Example: “projects/…/locations/…/batchPredictionJobs/456” or “456”

when project and location are initialized in the client.

Returns:

A BatchJob object that contains details about the batch job.

Usage:

batch_job = await client.aio.batches.get(name='123456789')
print(f"Batch job: {batch_job.name}, state {batch_job.state}")
async list(*, config=None)

Lists batch jobs asynchronously.

Return type:

AsyncPager[BatchJob]

Parameters:

config (ListBatchJobsConfig) – Optional configuration for the list request.

Returns:

A Pager object that contains one page of batch jobs. When iterating over the pager, it automatically fetches the next page if there are more.

Usage:

batch_jobs = await client.aio.batches.list(config={'page_size': 5})
print(f"current page: {batch_jobs.page}")
await batch_jobs_pager.next_page()
print(f"next page: {batch_jobs_pager.page}")
class genai.batches.Batches(api_client_)

Bases: BaseModule

cancel(*, name, config=None)

Cancels a batch job.

Only available for batch jobs that are running or pending.

Return type:

None

Parameters:

name (str) –

A fully-qualified BatchJob resource name or ID. Example: “projects/…/locations/…/batchPredictionJobs/123456789” or

”123456789” when project and location are initialized in the client.

Usage:

client.batches.cancel(name='123456789')
create(*, model, src, config=None)

Creates a batch job.

Return type:

BatchJob

Parameters:
  • model (str) – The model to use for the batch job.

  • src (str) – The source of the batch job. Currently supports GCS URI(-s) or BigQuery URI. Example: “gs://path/to/input/data” or “bq://projectId.bqDatasetId.bqTableId”.

  • config (CreateBatchJobConfig) – Optional configuration for the batch job.

Returns:

A BatchJob object that contains details about the batch job.

Usage:

batch_job = client.batches.create(
    model="gemini-2.0-flash-001",
    src="gs://path/to/input/data",
)
print(batch_job.state)
delete(*, name, config=None)

Deletes a batch job.

Return type:

DeleteResourceJob

Parameters:

name (str) –

A fully-qualified BatchJob resource name or ID. Example: “projects/…/locations/…/batchPredictionJobs/456” or “456”

when project and location are initialized in the client.

Returns:

A DeleteResourceJob object that shows the status of the deletion.

Usage:

client.batches.delete(name='123456789')
get(*, name, config=None)

Gets a batch job.

Return type:

BatchJob

Parameters:

name (str) –

A fully-qualified BatchJob resource name or ID. Example: “projects/…/locations/…/batchPredictionJobs/456” or “456”

when project and location are initialized in the client.

Returns:

A BatchJob object that contains details about the batch job.

Usage:

batch_job = client.batches.get(name='123456789')
print(f"Batch job: {batch_job.name}, state {batch_job.state}")
list(*, config=None)

Lists batch jobs.

Return type:

Pager[BatchJob]

Parameters:

config (ListBatchJobsConfig) – Optional configuration for the list request.

Returns:

A Pager object that contains one page of batch jobs. When iterating over the pager, it automatically fetches the next page if there are more.

Usage:

batch_jobs = client.batches.list(config={"page_size": 10})
for batch_job in batch_jobs:
  print(f"Batch job: {batch_job.name}, state {batch_job.state}")

genai.caches module

class genai.caches.AsyncCaches(api_client_)

Bases: BaseModule

async create(*, model, config=None)

Creates a cached contents resource.

Usage:

contents = ... // Initialize the content to cache.
response = await client.aio.caches.create(
    model= ... // The publisher model id
    contents=contents,
    config={
        'display_name': 'test cache',
        'system_instruction': 'What is the sum of the two pdfs?',
        'ttl': '86400s',
    },
)
Return type:

CachedContent

async delete(*, name, config=None)

Deletes cached content.

Usage:

await client.aio.caches.delete(name= ... ) // The server-generated
resource name.
Return type:

DeleteCachedContentResponse

async get(*, name, config=None)

Gets cached content configurations.

await client.aio.caches.get(name= ... ) // The server-generated resource
name.
Return type:

CachedContent

async list(*, config=None)
Return type:

AsyncPager[CachedContent]

async update(*, name, config=None)

Updates cached content configurations.

response = await client.aio.caches.update(
    name= ... // The server-generated resource name.
    config={
        'ttl': '7600s',
    },
)
Return type:

CachedContent

class genai.caches.Caches(api_client_)

Bases: BaseModule

create(*, model, config=None)

Creates a cached contents resource.

Usage:

contents = ... // Initialize the content to cache.
response = client.caches.create(
    model= ... // The publisher model id
    contents=contents,
    config={
        'display_name': 'test cache',
        'system_instruction': 'What is the sum of the two pdfs?',
        'ttl': '86400s',
    },
)
Return type:

CachedContent

delete(*, name, config=None)

Deletes cached content.

Usage:

client.caches.delete(name= ... ) // The server-generated resource name.
Return type:

DeleteCachedContentResponse

get(*, name, config=None)

Gets cached content configurations.

client.caches.get(name= ... ) // The server-generated resource name.
Return type:

CachedContent

list(*, config=None)
Return type:

Pager[CachedContent]

update(*, name, config=None)

Updates cached content configurations.

response = client.caches.update(
    name= ... // The server-generated resource name.
    config={
        'ttl': '7600s',
    },
)
Return type:

CachedContent

genai.chats module

class genai.chats.AsyncChat(*, modules, model, config=None, history)

Bases: _BaseChat

Async chat session.

async send_message(message, config=None)

Sends the conversation history with the additional message and returns model’s response.

Return type:

GenerateContentResponse

Parameters:
  • message – The message to send to the model.

  • config – Optional config to override the default Chat config for this request.

Returns:

The model’s response.

Usage:

chat = client.aio.chats.create(model='gemini-2.0-flash')
response = await chat.send_message('tell me a story')
async send_message_stream(message, config=None)

Sends the conversation history with the additional message and yields the model’s response in chunks.

Return type:

AsyncIterator[GenerateContentResponse]

Parameters:
  • message – The message to send to the model.

  • config – Optional config to override the default Chat config for this request.

Yields:

The model’s response in chunks.

Usage:

class genai.chats.AsyncChats(modules)

Bases: object

A util class to create async chat sessions.

create(*, model, config=None, history=None)

Creates a new chat session.

Return type:

AsyncChat

Parameters:
  • model – The model to use for the chat.

  • config – The configuration to use for the generate content request.

  • history – The history to use for the chat.

Returns:

A new chat session.

class genai.chats.Chat(*, modules, model, config=None, history)

Bases: _BaseChat

Chat session.

send_message(message, config=None)

Sends the conversation history with the additional message and returns the model’s response.

Return type:

GenerateContentResponse

Parameters:
  • message – The message to send to the model.

  • config – Optional config to override the default Chat config for this request.

Returns:

The model’s response.

Usage:

chat = client.chats.create(model='gemini-2.0-flash')
response = chat.send_message('tell me a story')
send_message_stream(message, config=None)

Sends the conversation history with the additional message and yields the model’s response in chunks.

Return type:

Iterator[GenerateContentResponse]

Parameters:
  • message – The message to send to the model.

  • config – Optional config to override the default Chat config for this request.

Yields:

The model’s response in chunks.

Usage:

chat = client.chats.create(model='gemini-2.0-flash')
for chunk in chat.send_message_stream('tell me a story'):
  print(chunk.text)
class genai.chats.Chats(modules)

Bases: object

A util class to create chat sessions.

create(*, model, config=None, history=None)

Creates a new chat session.

Return type:

Chat

Parameters:
  • model – The model to use for the chat.

  • config – The configuration to use for the generate content request.

  • history – The history to use for the chat.

Returns:

A new chat session.

genai.files module

class genai.files.AsyncFiles(api_client_)

Bases: BaseModule

async delete(*, name, config=None)

Deletes a remotely stored file.

Return type:

DeleteFileResponse

Parameters:
  • name (str) – The name identifier for the file to delete.

  • config (DeleteFileConfig) – Optional, configuration for the delete method.

Returns:

The response for the delete method

Return type:

DeleteFileResponse

Usage:

await client.aio.files.delete(name='files/...')
async download(*, file, config=None)

Downloads a file’s data from the file service.

The Vertex-AI implementation of the API foes not include the file service.

Files created by upload can’t be downloaded. You can tell which files are downloadable by checking the download_uri property.

Return type:

bytes

Parameters:
  • File (str) – A file name, uri, or file object. Identifying which file to download.

  • config (DownloadFileConfigOrDict) – Optional, configuration for the get method.

Returns:

The file data as bytes.

Return type:

File

Usage:

for file client.files.list():
  if file.download_uri is not None:
    break
else:
  raise ValueError('No files found with a `download_uri`.')
data = client.files.download(file=file)
# data = client.files.download(file=file.name)
# data = client.files.download(file=file.uri)
async get(*, name, config=None)

Retrieves the file information from the service.

Return type:

File

Parameters:
  • name (str) – The name identifier for the file to retrieve.

  • config (GetFileConfig) – Optional, configuration for the get method.

Returns:

The file information.

Return type:

File

Usage:

file = await client.aio.files.get(name='files/...')
print(file.uri)
async list(*, config=None)
Return type:

AsyncPager[File]

async upload(*, file, config=None)

Calls the API to upload a file asynchronously using a supported file service.

Return type:

File

Parameters:
  • file – A path to the file or an IOBase object to be uploaded. If it’s an IOBase object, it must be opened in blocking (the default) mode and binary mode. In other words, do not use non-blocking mode or text mode. The given stream must be seekable, that is, it must be able to call seek() on ‘path’.

  • config – Optional parameters to set diplay_name, mime_type, and name.

class genai.files.Files(api_client_)

Bases: BaseModule

delete(*, name, config=None)

Deletes a remotely stored file.

Return type:

DeleteFileResponse

Parameters:
  • name (str) – The name identifier for the file to delete.

  • config (DeleteFileConfig) – Optional, configuration for the delete method.

Returns:

The response for the delete method

Return type:

DeleteFileResponse

Usage:

client.files.delete(name='files/...')
download(*, file, config=None)

Downloads a file’s data from storage.

Files created by upload can’t be downloaded. You can tell which files are downloadable by checking the source or download_uri property.

Note: This method returns the data as bytes. For Video and GeneratedVideo objects there is an additional side effect, that it also sets the video_bytes property on the Video object.

Return type:

bytes

Parameters:
  • file (str) – A file name, uri, or file object. Identifying which file to download.

  • config (DownloadFileConfigOrDict) – Optional, configuration for the get method.

Returns:

The file data as bytes.

Return type:

File

Usage:

for file client.files.list():
  if file.download_uri is not None:
    break
else:
  raise ValueError('No files found with a `download_uri`.')
data = client.files.download(file=file)
# data = client.files.download(file=file.name)
# data = client.files.download(file=file.download_uri)

video = types.Video(uri=file.uri)
video_bytes = client.files.download(file=video)
video.video_bytes
get(*, name, config=None)

Retrieves the file information from the service.

Return type:

File

Parameters:
  • name (str) – The name identifier for the file to retrieve.

  • config (GetFileConfig) – Optional, configuration for the get method.

Returns:

The file information.

Return type:

File

Usage:

file = client.files.get(name='files/...')
print(file.uri)
list(*, config=None)
Return type:

Pager[File]

upload(*, file, config=None)

Calls the API to upload a file using a supported file service.

Return type:

File

Parameters:
  • file – A path to the file or an IOBase object to be uploaded. If it’s an IOBase object, it must be opened in blocking (the default) mode and binary mode. In other words, do not use non-blocking mode or text mode. The given stream must be seekable, that is, it must be able to call seek() on ‘path’.

  • config – Optional parameters to set diplay_name, mime_type, and name.

genai.live module

[Preview] Live API client.

class genai.live.AsyncLive(api_client)

Bases: BaseModule

[Preview] AsyncLive.

connect(*, model, config=None)

[Preview] Connect to the live server.

Note: the live API is currently in preview.

Usage:

client = genai.Client(api_key=API_KEY)
config = {}
async with client.aio.live.connect(model='...', config=config) as session:
  await session.send_client_content(
    turns=types.Content(
      role='user',
      parts=[types.Part(text='hello!')]
    ),
    turn_complete=True
  )
  async for message in session.receive():
    print(message)
Return type:

AsyncIterator[AsyncSession]

Parameters:
  • model – The model to use for the live session.

  • config – The configuration for the live session.

  • **kwargs – additional keyword arguments.

Yields:

An AsyncSession object.

property music: AsyncLiveMusic
class genai.live.AsyncSession(api_client, websocket)

Bases: object

[Preview] AsyncSession.

async close()
Return type:

None

async receive()

Receive model responses from the server.

The method will yield the model responses from the server. The returned responses will represent a complete model turn. When the returned message is function call, user must call send with the function response to continue the turn.

Return type:

AsyncIterator[LiveServerMessage]

Yields:

The model responses from the server.

Example usage:

client = genai.Client(api_key=API_KEY)

async with client.aio.live.connect(model='...') as session:
  await session.send(input='Hello world!', end_of_turn=True)
  async for message in session.receive():
    print(message)
async send(*, input=None, end_of_turn=False)

[Deprecated] Send input to the model.

> Warning: This method is deprecated and will be removed in a future version (not before Q3 2025). Please use one of the more specific methods: send_client_content, send_realtime_input, or send_tool_response instead.

The method will send the input request to the server.

Return type:

None

Parameters:
  • input – The input request to the model.

  • end_of_turn – Whether the input is the last message in a turn.

Example usage:

client = genai.Client(api_key=API_KEY)

async with client.aio.live.connect(model='...') as session:
  await session.send(input='Hello world!', end_of_turn=True)
  async for message in session.receive():
    print(message)
async send_client_content(*, turns=None, turn_complete=True)

Send non-realtime, turn based content to the model.

There are two ways to send messages to the live API: send_client_content and send_realtime_input.

send_client_content messages are added to the model context in order. Having a conversation using send_client_content messages is roughly equivalent to using the Chat.send_message_stream method, except that the state of the chat history is stored on the API server.

Because of send_client_content’s order guarantee, the model cannot respond as quickly to send_client_content messages as to send_realtime_input messages. This makes the biggest difference when sending objects that have significant preprocessing time (typically images).

The send_client_content message sends a list of Content objects, which has more options than the media:Blob sent by send_realtime_input.

The main use-cases for send_client_content over send_realtime_input are: :rtype: None

  • Prefilling a conversation context (including sending anything that can’t be represented as a realtime message), before starting a realtime conversation.

  • Conducting a non-realtime conversation, similar to client.chat, using the live api.

Caution: Interleaving send_client_content and send_realtime_input

in the same conversation is not recommended and can lead to unexpected results.

Parameters:
  • turns – A Content object or list of Content objects (or equivalent dicts).

  • turn_complete – if true (the default) the model will reply immediately. If false, the model will wait for you to send additional client_content, and will not return until you send turn_complete=True.

Example: ``` import google.genai from google.genai import types import os

if os.environ.get(‘GOOGLE_GENAI_USE_VERTEXAI’):

MODEL_NAME = ‘gemini-2.0-flash-live-preview-04-09’

else:

MODEL_NAME = ‘gemini-2.0-flash-live-001’;

client = genai.Client() async with client.aio.live.connect(

model=MODEL_NAME, config={“response_modalities”: [“TEXT”]}

) as session:
await session.send_client_content(
turns=types.Content(

role=’user’, parts=[types.Part(text=”Hello world!”)]))

async for msg in session.receive():
if msg.text:

print(msg.text)

```

async send_realtime_input(*, media=None, audio=None, audio_stream_end=None, video=None, text=None, activity_start=None, activity_end=None)

Send realtime input to the model, only send one argument per call.

Use send_realtime_input for realtime audio chunks and video frames(images).

With send_realtime_input the api will respond to audio automatically based on voice activity detection (VAD).

send_realtime_input is optimized for responsivness at the expense of deterministic ordering. Audio and video tokens are added to the context when they become available.

Return type:

None

Parameters:

media – A Blob-like object, the realtime media to send.

Example: ``` from pathlib import Path

from google import genai from google.genai import types

import PIL.Image

import os

if os.environ.get(‘GOOGLE_GENAI_USE_VERTEXAI’):

MODEL_NAME = ‘gemini-2.0-flash-live-preview-04-09’

else:

MODEL_NAME = ‘gemini-2.0-flash-live-001’;

client = genai.Client()

async with client.aio.live.connect(

model=MODEL_NAME, config={“response_modalities”: [“TEXT”]},

) as session:
await session.send_realtime_input(

media=PIL.Image.open(‘image.jpg’))

audio_bytes = Path(‘audio.pcm’).read_bytes() await session.send_realtime_input(

media=types.Blob(data=audio_bytes, mime_type=’audio/pcm;rate=16000’))

async for msg in session.receive():
if msg.text is not None:

print(f’{msg.text}’)

```

async send_tool_response(*, function_responses)

Send a tool response to the session.

Use send_tool_response to reply to LiveServerToolCall messages from the server.

To set the available tools, use the config.tools argument when you connect to the session (client.live.connect).

Return type:

None

Parameters:

function_responses – A FunctionResponse-like object or list of FunctionResponse-like objects.

Example: ``` from google import genai from google.genai import types

import os

if os.environ.get(‘GOOGLE_GENAI_USE_VERTEXAI’):

MODEL_NAME = ‘gemini-2.0-flash-live-preview-04-09’

else:

MODEL_NAME = ‘gemini-2.0-flash-live-001’;

client = genai.Client()

tools = [{‘function_declarations’: [{‘name’: ‘turn_on_the_lights’}]}] config = {

“tools”: tools, “response_modalities”: [‘TEXT’]

}

async with client.aio.live.connect(

model=’models/gemini-2.0-flash-live-001’, config=config

) as session:

prompt = “Turn on the lights please” await session.send_client_content(

turns={“parts”: [{‘text’: prompt}]}

)

async for chunk in session.receive():
if chunk.server_content:
if chunk.text is not None:

print(chunk.text)

elif chunk.tool_call:

print(chunk.tool_call) print(‘_’*80) function_response=types.FunctionResponse(

name=’turn_on_the_lights’, response={‘result’: ‘ok’}, id=chunk.tool_call.function_calls[0].id,

)

print(function_response) await session.send_tool_response(

function_responses=function_response

)

print(‘_’*80)

async start_stream(*, stream, mime_type)

[Deprecated] Start a live session from a data stream.

> Warning: This method is deprecated and will be removed in a future version (not before Q2 2025). Please use one of the more specific methods: send_client_content, send_realtime_input, or send_tool_response instead.

The interaction terminates when the input stream is complete. This method will start two async tasks. One task will be used to send the input stream to the model and the other task will be used to receive the responses from the model.

Return type:

AsyncIterator[LiveServerMessage]

Parameters:
  • stream – An iterator that yields the model response.

  • mime_type – The MIME type of the data in the stream.

Yields:

The audio bytes received from the model and server response messages.

Example usage:

client = genai.Client(api_key=API_KEY)
config = {'response_modalities': ['AUDIO']}
async def audio_stream():
  stream = read_audio()
  for data in stream:
    yield data
async with client.aio.live.connect(model='...', config=config) as session:
  for audio in session.start_stream(stream = audio_stream(),
  mime_type = 'audio/pcm'):
    play_audio_chunk(audio.data)
genai.live.live_ephemeral_connect(access_token, model=None, config=None)

[Experimental] Connect to the live server using ephermeral token (Gemini Developer API only).

Note: the live API is currently in experimental.

Usage:

Return type:

AsyncIterator[AsyncSession]

Yields:

An AsyncSession object.

genai.models module

class genai.models.AsyncModels(api_client_)

Bases: BaseModule

async compute_tokens(*, model, contents, config=None)

Given a list of contents, returns a corresponding TokensInfo containing the

list of tokens and list of token ids.

Return type:

ComputeTokensResponse

Parameters:
  • model (str) – The model to use.

  • contents (list[shared.Content]) – The content to compute tokens for.

Usage:

response = await client.aio.models.compute_tokens(
    model='gemini-2.0-flash',
    contents='What is your name?',
)
print(response)
# tokens_info=[TokensInfo(role='user', token_ids=['1841', ...],
# tokens=[b'What', b' is', b' your', b' name', b'?'])]
async count_tokens(*, model, contents, config=None)

Counts the number of tokens in the given content.

Multimodal input is supported for Gemini models.

Return type:

CountTokensResponse

Parameters:
  • model (str) – The model to use for counting tokens.

  • contents (list[types.Content]) – The content to count tokens for.

  • config (CountTokensConfig) – The configuration for counting tokens.

Usage:

response = await client.aio.models.count_tokens(
    model='gemini-2.0-flash',
    contents='What is your name?',
)
print(response)
# total_tokens=5 cached_content_token_count=None
async delete(*, model, config=None)
Return type:

DeleteModelResponse

async edit_image(*, model, prompt, reference_images, config=None)

Edits an image based on a text description and configuration.

Return type:

EditImageResponse

Parameters:
  • model (str) – The model to use.

  • prompt (str) – A text description of the edit to apply to the image. reference_images (list[Union[RawReferenceImage, MaskReferenceImage, ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage]): The reference images for editing.

  • config (EditImageConfig) – Configuration for editing.

Usage:

from google.genai.types import RawReferenceImage, MaskReferenceImage

raw_ref_image = RawReferenceImage(
  reference_id=1,
  reference_image=types.Image.from_file(IMAGE_FILE_PATH),
)

mask_ref_image = MaskReferenceImage(
  reference_id=2,
  config=types.MaskReferenceConfig(
      mask_mode='MASK_MODE_FOREGROUND',
      mask_dilation=0.06,
  ),
)
response = await client.aio.models.edit_image(
  model='imagen-3.0-capability-001',
  prompt='man with dog',
  reference_images=[raw_ref_image, mask_ref_image],
  config=types.EditImageConfig(
      edit_mode= "EDIT_MODE_INPAINT_INSERTION",
      number_of_images= 1,
      include_rai_reason= True,
  )
)
response.generated_images[0].image.show()
# Shows a man with a dog instead of a cat.
async embed_content(*, model, contents, config=None)

Calculates embeddings for the given contents. Only text is supported.

Return type:

EmbedContentResponse

Parameters:
  • model (str) – The model to use.

  • contents (list[Content]) – The contents to embed.

  • config (EmbedContentConfig) – Optional configuration for embeddings.

Usage:

embeddings = await client.aio.models.embed_content(
    model= 'text-embedding-004',
    contents=[
        'What is your name?',
        'What is your favorite color?',
    ],
    config={
        'output_dimensionality': 64
    },
)
async generate_content(*, model, contents, config=None)

Makes an API request to generate content using a model.

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

from google.genai import types
from google import genai

client = genai.Client(
    vertexai=True, project='my-project-id', location='us-central1'
)

response = await client.aio.models.generate_content(
    model='gemini-2.0-flash',
    contents='User input: I like bagels. Answer:',
    config=types.GenerateContentConfig(
        system_instruction=
          [
            'You are a helpful language translator.',
            'Your mission is to translate text in English to French.'
          ]
    ),
)
print(response.text)
# J'aime les bagels.
Return type:

GenerateContentResponse

async generate_content_stream(*, model, contents, config=None)

Makes an API request to generate content using a model and yields the model’s response in chunks.

For the model parameter, supported formats for Vertex AI API include: :rtype: AsyncIterator[GenerateContentResponse]

  • The Gemini model ID, for example: ‘gemini-2.0-flash’

  • The full resource name starts with ‘projects/’, for example: ‘projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash’

  • The partial resource name with ‘publishers/’, for example: ‘publishers/google/models/gemini-2.0-flash’ or ‘publishers/meta/models/llama-3.1-405b-instruct-maas’

  • / separated publisher and model name, for example: ‘google/gemini-2.0-flash’ or ‘meta/llama-3.1-405b-instruct-maas’

For the model parameter, supported formats for Gemini API include: - The Gemini model ID, for example: ‘gemini-2.0-flash’ - The model name starts with ‘models/’, for example:

‘models/gemini-2.0-flash’

  • For tuned models, the model name starts with ‘tunedModels/’, for example: ‘tunedModels/1234567890123456789’

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

from google.genai import types
from google import genai

client = genai.Client(
    vertexai=True, project='my-project-id', location='us-central1'
)

async for chunk in await client.aio.models.generate_content_stream(
  model='gemini-2.0-flash',
  contents='''What is a good name for a flower shop that specializes in
    selling bouquets of dried flowers?'''
):
  print(chunk.text)
# **Elegant & Classic:**
# * The Dried Bloom
# * Everlasting Florals
# * Timeless Petals

async for chunk in awiat client.aio.models.generate_content_stream(
  model='gemini-2.0-flash',
  contents=[
    types.Part.from_text('What is shown in this image?'),
    types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg',
    'image/jpeg')
  ]
):
  print(chunk.text)
# The image shows a flat lay arrangement of freshly baked blueberry
# scones.
async generate_images(*, model, prompt, config=None)

Generates images based on a text description and configuration.

Return type:

GenerateImagesResponse

Parameters:
  • model (str) – The model to use.

  • prompt (str) – A text description of the images to generate.

  • config (GenerateImagesConfig) – Configuration for generation.

Usage:

response = await client.aio.models.generate_images(
  model='imagen-3.0-generate-002',
  prompt='Man with a dog',
  config=types.GenerateImagesConfig(
      number_of_images= 1,
      include_rai_reason= True,
  )
)
response.generated_images[0].image.show()
# Shows a man with a dog.
async generate_videos(*, model, prompt=None, image=None, config=None)

Generates videos based on a text description and configuration.

Return type:

GenerateVideosOperation

Parameters:
  • model – The model to use.

  • instances – A list of prompts, images and videos to generate videos from.

  • config – Configuration for generation.

Usage:

``` operation = client.models.generate_videos(

model=”veo-2.0-generate-001”, prompt=”A neon hologram of a cat driving at top speed”,

) while not operation.done:

time.sleep(10) operation = client.operations.get(operation)

operation.result.generated_videos[0].video.uri ```

async get(*, model, config=None)
Return type:

Model

async list(*, config=None)

Makes an API request to list the available models.

If query_base is set to True in the config or not set (default), the API will return all available base models. If set to False, it will return all tuned models.

Return type:

AsyncPager[Model]

Parameters:

config (ListModelsConfigOrDict) – Configuration for retrieving models.

Usage:

response = await client.aio.models.list(config={'page_size': 5})
print(response.page)
# [Model(name='projects/./locations/./models/123', display_name='my_model'

response = await client.aio.models.list(
    config={'page_size': 5, 'query_base': True}
  )
print(response.page)
# [Model(name='publishers/google/models/gemini-2.0-flash-exp' ...
async update(*, model, config=None)
Return type:

Model

async upscale_image(*, model, image, upscale_factor, config=None)

Makes an API request to upscale a provided image.

Return type:

UpscaleImageResponse

Parameters:
  • model (str) – The model to use.

  • image (Image) – The input image for upscaling.

  • upscale_factor (str) – The factor to upscale the image (x2 or x4).

  • config (UpscaleImageConfig) – Configuration for upscaling.

Usage:

from google.genai.types import Image

IMAGE_FILE_PATH="my-image.png"
response = await client.aio.models.upscale_image(
    model='imagen-3.0-generate-001',
    image=types.Image.from_file(IMAGE_FILE_PATH),
    upscale_factor='x2',
)
response.generated_images[0].image.show()
# Opens my-image.png which is upscaled by a factor of 2.
class genai.models.Models(api_client_)

Bases: BaseModule

compute_tokens(*, model, contents, config=None)

Given a list of contents, returns a corresponding TokensInfo containing the

list of tokens and list of token ids.

This method is not supported by the Gemini Developer API.

Return type:

ComputeTokensResponse

Parameters:
  • model (str) – The model to use.

  • contents (list[shared.Content]) – The content to compute tokens for.

Usage:

response = client.models.compute_tokens(
    model='gemini-2.0-flash',
    contents='What is your name?',
)
print(response)
# tokens_info=[TokensInfo(role='user', token_ids=['1841', ...],
# tokens=[b'What', b' is', b' your', b' name', b'?'])]
count_tokens(*, model, contents, config=None)

Counts the number of tokens in the given content.

Multimodal input is supported for Gemini models.

Return type:

CountTokensResponse

Parameters:
  • model (str) – The model to use for counting tokens.

  • contents (list[types.Content]) – The content to count tokens for.

  • config (CountTokensConfig) – The configuration for counting tokens.

Usage:

response = client.models.count_tokens(
    model='gemini-2.0-flash',
    contents='What is your name?',
)
print(response)
# total_tokens=5 cached_content_token_count=None
delete(*, model, config=None)
Return type:

DeleteModelResponse

edit_image(*, model, prompt, reference_images, config=None)

Edits an image based on a text description and configuration.

Return type:

EditImageResponse

Parameters:
  • model (str) – The model to use.

  • prompt (str) – A text description of the edit to apply to the image. reference_images (list[Union[RawReferenceImage, MaskReferenceImage, ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage]): The reference images for editing.

  • config (EditImageConfig) – Configuration for editing.

Usage:

from google.genai.types import RawReferenceImage, MaskReferenceImage

raw_ref_image = RawReferenceImage(
  reference_id=1,
  reference_image=types.Image.from_file(IMAGE_FILE_PATH),
)

mask_ref_image = MaskReferenceImage(
  reference_id=2,
  config=types.MaskReferenceConfig(
      mask_mode='MASK_MODE_FOREGROUND',
      mask_dilation=0.06,
  ),
)
response = client.models.edit_image(
  model='imagen-3.0-capability-001',
  prompt='man with dog',
  reference_images=[raw_ref_image, mask_ref_image],
  config=types.EditImageConfig(
      edit_mode= "EDIT_MODE_INPAINT_INSERTION",
      number_of_images= 1,
      include_rai_reason= True,
  )
)
response.generated_images[0].image.show()
# Shows a man with a dog instead of a cat.
embed_content(*, model, contents, config=None)

Calculates embeddings for the given contents. Only text is supported.

Return type:

EmbedContentResponse

Parameters:
  • model (str) – The model to use.

  • contents (list[Content]) – The contents to embed.

  • config (EmbedContentConfig) – Optional configuration for embeddings.

Usage:

embeddings = client.models.embed_content(
    model= 'text-embedding-004',
    contents=[
        'What is your name?',
        'What is your favorite color?',
    ],
    config={
        'output_dimensionality': 64
    },
)
generate_content(*, model, contents, config=None)

Makes an API request to generate content using a model.

For the model parameter, supported formats for Vertex AI API include: :rtype: GenerateContentResponse

  • The Gemini model ID, for example: ‘gemini-2.0-flash’

  • The full resource name starts with ‘projects/’, for example: ‘projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash’

  • The partial resource name with ‘publishers/’, for example: ‘publishers/google/models/gemini-2.0-flash’ or ‘publishers/meta/models/llama-3.1-405b-instruct-maas’

  • / separated publisher and model name, for example: ‘google/gemini-2.0-flash’ or ‘meta/llama-3.1-405b-instruct-maas’

For the model parameter, supported formats for Gemini API include: - The Gemini model ID, for example: ‘gemini-2.0-flash’ - The model name starts with ‘models/’, for example:

‘models/gemini-2.0-flash’

  • For tuned models, the model name starts with ‘tunedModels/’, for example: ‘tunedModels/1234567890123456789’

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

from google.genai import types
from google import genai

client = genai.Client(
    vertexai=True, project='my-project-id', location='us-central1'
)

response = client.models.generate_content(
  model='gemini-2.0-flash',
  contents='''What is a good name for a flower shop that specializes in
    selling bouquets of dried flowers?'''
)
print(response.text)
# **Elegant & Classic:**
# * The Dried Bloom
# * Everlasting Florals
# * Timeless Petals

response = client.models.generate_content(
  model='gemini-2.0-flash',
  contents=[
    types.Part.from_text('What is shown in this image?'),
    types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg',
    'image/jpeg')
  ]
)
print(response.text)
# The image shows a flat lay arrangement of freshly baked blueberry
# scones.
generate_content_stream(*, model, contents, config=None)

Makes an API request to generate content using a model and yields the model’s response in chunks.

For the model parameter, supported formats for Vertex AI API include: :rtype: Iterator[GenerateContentResponse]

  • The Gemini model ID, for example: ‘gemini-2.0-flash’

  • The full resource name starts with ‘projects/’, for example: ‘projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash’

  • The partial resource name with ‘publishers/’, for example: ‘publishers/google/models/gemini-2.0-flash’ or ‘publishers/meta/models/llama-3.1-405b-instruct-maas’

  • / separated publisher and model name, for example: ‘google/gemini-2.0-flash’ or ‘meta/llama-3.1-405b-instruct-maas’

For the model parameter, supported formats for Gemini API include: - The Gemini model ID, for example: ‘gemini-2.0-flash’ - The model name starts with ‘models/’, for example:

‘models/gemini-2.0-flash’

  • For tuned models, the model name starts with ‘tunedModels/’, for example: ‘tunedModels/1234567890123456789’

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

from google.genai import types
from google import genai

client = genai.Client(
    vertexai=True, project='my-project-id', location='us-central1'
)

for chunk in client.models.generate_content_stream(
  model='gemini-2.0-flash',
  contents='''What is a good name for a flower shop that specializes in
    selling bouquets of dried flowers?'''
):
  print(chunk.text)
# **Elegant & Classic:**
# * The Dried Bloom
# * Everlasting Florals
# * Timeless Petals

for chunk in client.models.generate_content_stream(
  model='gemini-2.0-flash',
  contents=[
    types.Part.from_text('What is shown in this image?'),
    types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg',
    'image/jpeg')
  ]
):
  print(chunk.text)
# The image shows a flat lay arrangement of freshly baked blueberry
# scones.
generate_images(*, model, prompt, config=None)

Generates images based on a text description and configuration.

Return type:

GenerateImagesResponse

Parameters:
  • model (str) – The model to use.

  • prompt (str) – A text description of the images to generate.

  • config (GenerateImagesConfig) – Configuration for generation.

Usage:

response = client.models.generate_images(
  model='imagen-3.0-generate-002',
  prompt='Man with a dog',
  config=types.GenerateImagesConfig(
      number_of_images= 1,
      include_rai_reason= True,
  )
)
response.generated_images[0].image.show()
# Shows a man with a dog.
generate_videos(*, model, prompt=None, image=None, config=None)

Generates videos based on a text description and configuration.

Return type:

GenerateVideosOperation

Parameters:
  • model – The model to use.

  • instances – A list of prompts, images and videos to generate videos from.

  • config – Configuration for generation.

Usage:

``` operation = client.models.generate_videos(

model=”veo-2.0-generate-001”, prompt=”A neon hologram of a cat driving at top speed”,

) while not operation.done:

time.sleep(10) operation = client.operations.get(operation)

operation.result.generated_videos[0].video.uri ```

get(*, model, config=None)
Return type:

Model

list(*, config=None)

Makes an API request to list the available models.

If query_base is set to True in the config or not set (default), the API will return all available base models. If set to False, it will return all tuned models.

Return type:

Pager[Model]

Parameters:

config (ListModelsConfigOrDict) – Configuration for retrieving models.

Usage:

response=client.models.list(config={'page_size': 5})
print(response.page)
# [Model(name='projects/./locations/./models/123', display_name='my_model'

response=client.models.list(config={'page_size': 5, 'query_base': True})
print(response.page)
# [Model(name='publishers/google/models/gemini-2.0-flash-exp' ...
update(*, model, config=None)
Return type:

Model

upscale_image(*, model, image, upscale_factor, config=None)

Makes an API request to upscale a provided image.

Return type:

UpscaleImageResponse

Parameters:
  • model (str) – The model to use.

  • image (Image) – The input image for upscaling.

  • upscale_factor (str) – The factor to upscale the image (x2 or x4).

  • config (UpscaleImageConfig) – Configuration for upscaling.

Usage:

from google.genai.types import Image

IMAGE_FILE_PATH="my-image.png"
response=client.models.upscale_image(
    model='imagen-3.0-generate-001',
    image=types.Image.from_file(IMAGE_FILE_PATH),
    upscale_factor='x2',
)
response.generated_images[0].image.show()
# Opens my-image.png which is upscaled by a factor of 2.

genai.tunings module

class genai.tunings.AsyncTunings(api_client_)

Bases: BaseModule

async get(*, name, config=None)
Return type:

TuningJob

async list(*, config=None)
Return type:

AsyncPager[TuningJob]

tune(*, base_model, training_dataset, config=None)
Return type:

TuningJob

class genai.tunings.Tunings(api_client_)

Bases: BaseModule

get(*, name, config=None)
Return type:

TuningJob

list(*, config=None)
Return type:

Pager[TuningJob]

tune(*, base_model, training_dataset, config=None)
Return type:

TuningJob

genai.types module

pydantic model genai.types.ActivityEnd

Bases: BaseModel

Marks the end of user activity.

This can only be sent if automatic (i.e. server-side) activity detection is disabled.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ActivityEnd",
   "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.ActivityEndDict

Bases: TypedDict

Marks the end of user activity.

This can only be sent if automatic (i.e. server-side) activity detection is disabled.

class genai.types.ActivityHandling(*values)

Bases: CaseInSensitiveEnum

The different ways of handling user activity.

ACTIVITY_HANDLING_UNSPECIFIED = 'ACTIVITY_HANDLING_UNSPECIFIED'

If unspecified, the default behavior is START_OF_ACTIVITY_INTERRUPTS.

NO_INTERRUPTION = 'NO_INTERRUPTION'

The model’s response will not be interrupted.

START_OF_ACTIVITY_INTERRUPTS = 'START_OF_ACTIVITY_INTERRUPTS'

If true, start of activity will interrupt the model’s response (also called “barge in”). The model’s current response will be cut-off in the moment of the interruption. This is the default behavior.

pydantic model genai.types.ActivityStart

Bases: BaseModel

Marks the start of user activity.

This can only be sent if automatic (i.e. server-side) activity detection is disabled.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ActivityStart",
   "description": "Marks the start of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.ActivityStartDict

Bases: TypedDict

Marks the start of user activity.

This can only be sent if automatic (i.e. server-side) activity detection is disabled.

class genai.types.AdapterSize(*values)

Bases: CaseInSensitiveEnum

Optional. Adapter size for tuning.

ADAPTER_SIZE_EIGHT = 'ADAPTER_SIZE_EIGHT'

Adapter size 8.

ADAPTER_SIZE_FOUR = 'ADAPTER_SIZE_FOUR'

Adapter size 4.

ADAPTER_SIZE_ONE = 'ADAPTER_SIZE_ONE'

Adapter size 1.

ADAPTER_SIZE_SIXTEEN = 'ADAPTER_SIZE_SIXTEEN'

Adapter size 16.

ADAPTER_SIZE_THIRTY_TWO = 'ADAPTER_SIZE_THIRTY_TWO'

Adapter size 32.

ADAPTER_SIZE_TWO = 'ADAPTER_SIZE_TWO'

Adapter size 2.

ADAPTER_SIZE_UNSPECIFIED = 'ADAPTER_SIZE_UNSPECIFIED'

Adapter size is unspecified.

pydantic model genai.types.ApiKeyConfig

Bases: BaseModel

Config for authentication with API key.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ApiKeyConfig",
   "description": "Config for authentication with API key.",
   "type": "object",
   "properties": {
      "apiKeyString": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The API key to be used in the request directly.",
         "title": "Apikeystring"
      }
   },
   "additionalProperties": false
}

Fields:
field api_key_string: Optional[str] = None (alias 'apiKeyString')

The API key to be used in the request directly.

class genai.types.ApiKeyConfigDict

Bases: TypedDict

Config for authentication with API key.

api_key_string: Optional[str]

The API key to be used in the request directly.

pydantic model genai.types.AudioChunk

Bases: BaseModel

Representation of an audio chunk.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AudioChunk",
   "description": "Representation of an audio chunk.",
   "type": "object",
   "properties": {
      "data": {
         "anyOf": [
            {
               "format": "base64url",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Raw byets of audio data.",
         "title": "Data"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "MIME type of the audio chunk.",
         "title": "Mimetype"
      },
      "sourceMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicSourceMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Prompts and config used for generating this audio chunk."
      }
   },
   "$defs": {
      "LiveMusicClientContent": {
         "additionalProperties": false,
         "description": "User input to start or steer the music.",
         "properties": {
            "weightedPrompts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/WeightedPrompt"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts as the model input.",
               "title": "Weightedprompts"
            }
         },
         "title": "LiveMusicClientContent",
         "type": "object"
      },
      "LiveMusicGenerationConfig": {
         "additionalProperties": false,
         "description": "Configuration for music generation.",
         "properties": {
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the variance in audio generation. Higher values produce\n      higher variance. Range is [0.0, 3.0].",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how the model selects tokens for output. Samples the topK\n      tokens with the highest probabilities. Range is [1, 1000].",
               "title": "Topk"
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Seeds audio generation. If not set, the request uses a randomly\n      generated seed.",
               "title": "Seed"
            },
            "guidance": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how closely the model follows prompts.\n      Higher guidance follows more closely, but will make transitions more\n      abrupt. Range is [0.0, 6.0].",
               "title": "Guidance"
            },
            "bpm": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Beats per minute. Range is [60, 200].",
               "title": "Bpm"
            },
            "density": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Density of sounds. Range is [0.0, 1.0].",
               "title": "Density"
            },
            "brightness": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Brightness of the music. Range is [0.0, 1.0].",
               "title": "Brightness"
            },
            "scale": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Scale"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scale of the generated music."
            },
            "muteBass": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain bass.",
               "title": "Mutebass"
            },
            "muteDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain drums.",
               "title": "Mutedrums"
            },
            "onlyBassAndDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain only bass and drums.",
               "title": "Onlybassanddrums"
            },
            "musicGenerationMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MusicGenerationMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of music generation. Default mode is QUALITY."
            }
         },
         "title": "LiveMusicGenerationConfig",
         "type": "object"
      },
      "LiveMusicSourceMetadata": {
         "additionalProperties": false,
         "description": "Prompts and config used for generating this audio chunk.",
         "properties": {
            "clientContent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicClientContent"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts for generating this audio chunk."
            },
            "musicGenerationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicGenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Music generation config for generating this audio chunk."
            }
         },
         "title": "LiveMusicSourceMetadata",
         "type": "object"
      },
      "MusicGenerationMode": {
         "description": "The mode of music generation.",
         "enum": [
            "MUSIC_GENERATION_MODE_UNSPECIFIED",
            "QUALITY",
            "DIVERSITY"
         ],
         "title": "MusicGenerationMode",
         "type": "string"
      },
      "Scale": {
         "description": "Scale of the generated music.",
         "enum": [
            "SCALE_UNSPECIFIED",
            "C_MAJOR_A_MINOR",
            "D_FLAT_MAJOR_B_FLAT_MINOR",
            "D_MAJOR_B_MINOR",
            "E_FLAT_MAJOR_C_MINOR",
            "E_MAJOR_D_FLAT_MINOR",
            "F_MAJOR_D_MINOR",
            "G_FLAT_MAJOR_E_FLAT_MINOR",
            "G_MAJOR_E_MINOR",
            "A_FLAT_MAJOR_F_MINOR",
            "A_MAJOR_G_FLAT_MINOR",
            "B_FLAT_MAJOR_G_MINOR",
            "B_MAJOR_A_FLAT_MINOR"
         ],
         "title": "Scale",
         "type": "string"
      },
      "WeightedPrompt": {
         "additionalProperties": false,
         "description": "Maps a prompt to a relative weight to steer music generation.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text prompt.",
               "title": "Text"
            },
            "weight": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
               "title": "Weight"
            }
         },
         "title": "WeightedPrompt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field data: Optional[bytes] = None

Raw byets of audio data.

field mime_type: Optional[str] = None (alias 'mimeType')

MIME type of the audio chunk.

field source_metadata: Optional[LiveMusicSourceMetadata] = None (alias 'sourceMetadata')

Prompts and config used for generating this audio chunk.

class genai.types.AudioChunkDict

Bases: TypedDict

Representation of an audio chunk.

data: Optional[bytes]

Raw byets of audio data.

mime_type: Optional[str]

MIME type of the audio chunk.

source_metadata: Optional[LiveMusicSourceMetadataDict]

Prompts and config used for generating this audio chunk.

pydantic model genai.types.AudioTranscriptionConfig

Bases: BaseModel

The audio transcription configuration in Setup.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AudioTranscriptionConfig",
   "description": "The audio transcription configuration in Setup.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.AudioTranscriptionConfigDict

Bases: TypedDict

The audio transcription configuration in Setup.

pydantic model genai.types.AuthConfig

Bases: BaseModel

Auth configuration to run the extension.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AuthConfig",
   "description": "Auth configuration to run the extension.",
   "type": "object",
   "properties": {
      "apiKeyConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/ApiKeyConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Config for API key auth."
      },
      "authType": {
         "anyOf": [
            {
               "$ref": "#/$defs/AuthType"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Type of auth scheme."
      },
      "googleServiceAccountConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Config for Google Service Account auth."
      },
      "httpBasicAuthConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Config for HTTP Basic auth."
      },
      "oauthConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/AuthConfigOauthConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Config for user oauth."
      },
      "oidcConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/AuthConfigOidcConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Config for user OIDC auth."
      }
   },
   "$defs": {
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field api_key_config: Optional[ApiKeyConfig] = None (alias 'apiKeyConfig')

Config for API key auth.

field auth_type: Optional[AuthType] = None (alias 'authType')

Type of auth scheme.

field google_service_account_config: Optional[AuthConfigGoogleServiceAccountConfig] = None (alias 'googleServiceAccountConfig')

Config for Google Service Account auth.

field http_basic_auth_config: Optional[AuthConfigHttpBasicAuthConfig] = None (alias 'httpBasicAuthConfig')

Config for HTTP Basic auth.

field oauth_config: Optional[AuthConfigOauthConfig] = None (alias 'oauthConfig')

Config for user oauth.

field oidc_config: Optional[AuthConfigOidcConfig] = None (alias 'oidcConfig')

Config for user OIDC auth.

class genai.types.AuthConfigDict

Bases: TypedDict

Auth configuration to run the extension.

api_key_config: Optional[ApiKeyConfigDict]

Config for API key auth.

auth_type: Optional[AuthType]

Type of auth scheme.

google_service_account_config: Optional[AuthConfigGoogleServiceAccountConfigDict]

Config for Google Service Account auth.

http_basic_auth_config: Optional[AuthConfigHttpBasicAuthConfigDict]

Config for HTTP Basic auth.

oauth_config: Optional[AuthConfigOauthConfigDict]

Config for user oauth.

oidc_config: Optional[AuthConfigOidcConfigDict]

Config for user OIDC auth.

pydantic model genai.types.AuthConfigGoogleServiceAccountConfig

Bases: BaseModel

Config for Google Service Account Authentication.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AuthConfigGoogleServiceAccountConfig",
   "description": "Config for Google Service Account Authentication.",
   "type": "object",
   "properties": {
      "serviceAccount": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
         "title": "Serviceaccount"
      }
   },
   "additionalProperties": false
}

Fields:
field service_account: Optional[str] = None (alias 'serviceAccount')

Optional. The service account that the extension execution service runs as. - If the service account is specified, the iam.serviceAccounts.getAccessToken permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.

class genai.types.AuthConfigGoogleServiceAccountConfigDict

Bases: TypedDict

Config for Google Service Account Authentication.

service_account: Optional[str]

//cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.

Type:

Optional. The service account that the extension execution service runs as. - If the service account is specified, the iam.serviceAccounts.getAccessToken permission should be granted to Vertex AI Extension Service Agent (https

pydantic model genai.types.AuthConfigHttpBasicAuthConfig

Bases: BaseModel

Config for HTTP Basic Authentication.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AuthConfigHttpBasicAuthConfig",
   "description": "Config for HTTP Basic Authentication.",
   "type": "object",
   "properties": {
      "credentialSecret": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
         "title": "Credentialsecret"
      }
   },
   "additionalProperties": false
}

Fields:
field credential_secret: Optional[str] = None (alias 'credentialSecret')

Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: projects/{project}/secrets/{secrete}/versions/{version} - If specified, the secretmanager.versions.access permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.

class genai.types.AuthConfigHttpBasicAuthConfigDict

Bases: TypedDict

Config for HTTP Basic Authentication.

credential_secret: Optional[str]

//cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.

Type:

Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format

Type:

projects/{project}/secrets/{secrete}/versions/{version} - If specified, the secretmanager.versions.access permission should be granted to Vertex AI Extension Service Agent (https

pydantic model genai.types.AuthConfigOauthConfig

Bases: BaseModel

Config for user oauth.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AuthConfigOauthConfig",
   "description": "Config for user oauth.",
   "type": "object",
   "properties": {
      "accessToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
         "title": "Accesstoken"
      },
      "serviceAccount": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
         "title": "Serviceaccount"
      }
   },
   "additionalProperties": false
}

Fields:
field access_token: Optional[str] = None (alias 'accessToken')

Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.

field service_account: Optional[str] = None (alias 'serviceAccount')

The service account used to generate access tokens for executing the Extension. - If the service account is specified, the iam.serviceAccounts.getAccessToken permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.

class genai.types.AuthConfigOauthConfigDict

Bases: TypedDict

Config for user oauth.

access_token: Optional[str]

Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.

service_account: Optional[str]

//cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.

Type:

The service account used to generate access tokens for executing the Extension. - If the service account is specified, the iam.serviceAccounts.getAccessToken permission should be granted to Vertex AI Extension Service Agent (https

pydantic model genai.types.AuthConfigOidcConfig

Bases: BaseModel

Config for user OIDC auth.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AuthConfigOidcConfig",
   "description": "Config for user OIDC auth.",
   "type": "object",
   "properties": {
      "idToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
         "title": "Idtoken"
      },
      "serviceAccount": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
         "title": "Serviceaccount"
      }
   },
   "additionalProperties": false
}

Fields:
field id_token: Optional[str] = None (alias 'idToken')

OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.

field service_account: Optional[str] = None (alias 'serviceAccount')

The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant iam.serviceAccounts.getOpenIdToken permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).

class genai.types.AuthConfigOidcConfigDict

Bases: TypedDict

Config for user OIDC auth.

id_token: Optional[str]

OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.

service_account: Optional[str]

//cloud.google.com/vertex-ai/docs/general/access-control#service-agents).

Type:

The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https

Type:

//cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant iam.serviceAccounts.getOpenIdToken permission to Vertex AI Extension Service Agent (https

pydantic model genai.types.AuthToken

Bases: BaseModel

Config for auth_tokens.create parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AuthToken",
   "description": "Config for auth_tokens.create parameters.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the auth token.",
         "title": "Name"
      }
   },
   "additionalProperties": false
}

Fields:
field name: Optional[str] = None

The name of the auth token.

class genai.types.AuthTokenDict

Bases: TypedDict

Config for auth_tokens.create parameters.

name: Optional[str]

The name of the auth token.

class genai.types.AuthType(*values)

Bases: CaseInSensitiveEnum

Type of auth scheme.

API_KEY_AUTH = 'API_KEY_AUTH'

API Key Auth.

AUTH_TYPE_UNSPECIFIED = 'AUTH_TYPE_UNSPECIFIED'
GOOGLE_SERVICE_ACCOUNT_AUTH = 'GOOGLE_SERVICE_ACCOUNT_AUTH'

Google Service Account Auth.

HTTP_BASIC_AUTH = 'HTTP_BASIC_AUTH'

HTTP Basic Auth.

NO_AUTH = 'NO_AUTH'

No Auth.

OAUTH = 'OAUTH'

OAuth auth.

OIDC_AUTH = 'OIDC_AUTH'

OpenID Connect (OIDC) Auth.

pydantic model genai.types.AutomaticActivityDetection

Bases: BaseModel

Configures automatic detection of activity.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AutomaticActivityDetection",
   "description": "Configures automatic detection of activity.",
   "type": "object",
   "properties": {
      "disabled": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.",
         "title": "Disabled"
      },
      "startOfSpeechSensitivity": {
         "anyOf": [
            {
               "$ref": "#/$defs/StartSensitivity"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Determines how likely speech is to be detected."
      },
      "endOfSpeechSensitivity": {
         "anyOf": [
            {
               "$ref": "#/$defs/EndSensitivity"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Determines how likely detected speech is ended."
      },
      "prefixPaddingMs": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.",
         "title": "Prefixpaddingms"
      },
      "silenceDurationMs": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.",
         "title": "Silencedurationms"
      }
   },
   "$defs": {
      "EndSensitivity": {
         "description": "End of speech sensitivity.",
         "enum": [
            "END_SENSITIVITY_UNSPECIFIED",
            "END_SENSITIVITY_HIGH",
            "END_SENSITIVITY_LOW"
         ],
         "title": "EndSensitivity",
         "type": "string"
      },
      "StartSensitivity": {
         "description": "Start of speech sensitivity.",
         "enum": [
            "START_SENSITIVITY_UNSPECIFIED",
            "START_SENSITIVITY_HIGH",
            "START_SENSITIVITY_LOW"
         ],
         "title": "StartSensitivity",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field disabled: Optional[bool] = None

If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.

field end_of_speech_sensitivity: Optional[EndSensitivity] = None (alias 'endOfSpeechSensitivity')

Determines how likely detected speech is ended.

field prefix_padding_ms: Optional[int] = None (alias 'prefixPaddingMs')

The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.

field silence_duration_ms: Optional[int] = None (alias 'silenceDurationMs')

The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user’s activity but this will increase the model’s latency.

field start_of_speech_sensitivity: Optional[StartSensitivity] = None (alias 'startOfSpeechSensitivity')

Determines how likely speech is to be detected.

class genai.types.AutomaticActivityDetectionDict

Bases: TypedDict

Configures automatic detection of activity.

disabled: Optional[bool]

If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.

end_of_speech_sensitivity: Optional[EndSensitivity]

Determines how likely detected speech is ended.

prefix_padding_ms: Optional[int]

The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.

silence_duration_ms: Optional[int]

The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user’s activity but this will increase the model’s latency.

start_of_speech_sensitivity: Optional[StartSensitivity]

Determines how likely speech is to be detected.

pydantic model genai.types.AutomaticFunctionCallingConfig

Bases: BaseModel

The configuration for automatic function calling.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "AutomaticFunctionCallingConfig",
   "description": "The configuration for automatic function calling.",
   "type": "object",
   "properties": {
      "disable": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to disable automatic function calling.\n      If not set or set to False, will enable automatic function calling.\n      If set to True, will disable automatic function calling.\n      ",
         "title": "Disable"
      },
      "maximumRemoteCalls": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": 10,
         "description": "If automatic function calling is enabled,\n      maximum number of remote calls for automatic function calling.\n      This number should be a positive integer.\n      If not set, SDK will set maximum number of remote calls to 10.\n      ",
         "title": "Maximumremotecalls"
      },
      "ignoreCallHistory": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If automatic function calling is enabled,\n      whether to ignore call history to the response.\n      If not set, SDK will set ignore_call_history to false,\n      and will append the call history to\n      GenerateContentResponse.automatic_function_calling_history.\n      ",
         "title": "Ignorecallhistory"
      }
   },
   "additionalProperties": false
}

Fields:
field disable: Optional[bool] = None

Whether to disable automatic function calling. If not set or set to False, will enable automatic function calling. If set to True, will disable automatic function calling.

field ignore_call_history: Optional[bool] = None (alias 'ignoreCallHistory')

If automatic function calling is enabled, whether to ignore call history to the response. If not set, SDK will set ignore_call_history to false, and will append the call history to GenerateContentResponse.automatic_function_calling_history.

field maximum_remote_calls: Optional[int] = 10 (alias 'maximumRemoteCalls')

If automatic function calling is enabled, maximum number of remote calls for automatic function calling. This number should be a positive integer. If not set, SDK will set maximum number of remote calls to 10.

class genai.types.AutomaticFunctionCallingConfigDict

Bases: TypedDict

The configuration for automatic function calling.

disable: Optional[bool]

Whether to disable automatic function calling. If not set or set to False, will enable automatic function calling. If set to True, will disable automatic function calling.

ignore_call_history: Optional[bool]

If automatic function calling is enabled, whether to ignore call history to the response. If not set, SDK will set ignore_call_history to false, and will append the call history to GenerateContentResponse.automatic_function_calling_history.

maximum_remote_calls: Optional[int]

If automatic function calling is enabled, maximum number of remote calls for automatic function calling. This number should be a positive integer. If not set, SDK will set maximum number of remote calls to 10.

pydantic model genai.types.BatchJob

Bases: BaseModel

Config for batches.create return value.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "BatchJob",
   "description": "Config for batches.create return value.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Resource name of the Job.",
         "title": "Name"
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The user-defined name of this Job.",
         "title": "Displayname"
      },
      "state": {
         "anyOf": [
            {
               "$ref": "#/$defs/JobState"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The detailed state of the job."
      },
      "error": {
         "anyOf": [
            {
               "$ref": "#/$defs/JobError"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Only populated when the job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED."
      },
      "createTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the Job was created.",
         "title": "Createtime"
      },
      "startTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state.",
         "title": "Starttime"
      },
      "endTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the Job entered any of the following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`.",
         "title": "Endtime"
      },
      "updateTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the Job was most recently updated.",
         "title": "Updatetime"
      },
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the model that produces the predictions via the BatchJob.\n      ",
         "title": "Model"
      },
      "src": {
         "anyOf": [
            {
               "$ref": "#/$defs/BatchJobSource"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for the input data.\n      "
      },
      "dest": {
         "anyOf": [
            {
               "$ref": "#/$defs/BatchJobDestination"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for the output data.\n      "
      }
   },
   "$defs": {
      "BatchJobDestination": {
         "additionalProperties": false,
         "description": "Config for `des` parameter.",
         "properties": {
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Storage format of the output files. Must be one of:\n      'jsonl', 'bigquery'.\n      ",
               "title": "Format"
            },
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Google Cloud Storage URI to the output file.\n      ",
               "title": "Gcsuri"
            },
            "bigqueryUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The BigQuery URI to the output table.\n      ",
               "title": "Bigqueryuri"
            }
         },
         "title": "BatchJobDestination",
         "type": "object"
      },
      "BatchJobSource": {
         "additionalProperties": false,
         "description": "Config for `src` parameter.",
         "properties": {
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Storage format of the input files. Must be one of:\n      'jsonl', 'bigquery'.\n      ",
               "title": "Format"
            },
            "gcsUri": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Google Cloud Storage URIs to input files.\n      ",
               "title": "Gcsuri"
            },
            "bigqueryUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The BigQuery URI to input table.\n      ",
               "title": "Bigqueryuri"
            }
         },
         "title": "BatchJobSource",
         "type": "object"
      },
      "JobError": {
         "additionalProperties": false,
         "description": "Job error.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code.",
               "title": "Code"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field.",
               "title": "Message"
            }
         },
         "title": "JobError",
         "type": "object"
      },
      "JobState": {
         "description": "Job state.",
         "enum": [
            "JOB_STATE_UNSPECIFIED",
            "JOB_STATE_QUEUED",
            "JOB_STATE_PENDING",
            "JOB_STATE_RUNNING",
            "JOB_STATE_SUCCEEDED",
            "JOB_STATE_FAILED",
            "JOB_STATE_CANCELLING",
            "JOB_STATE_CANCELLED",
            "JOB_STATE_PAUSED",
            "JOB_STATE_EXPIRED",
            "JOB_STATE_UPDATING",
            "JOB_STATE_PARTIALLY_SUCCEEDED"
         ],
         "title": "JobState",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field create_time: Optional[datetime] = None (alias 'createTime')

Output only. Time when the Job was created.

field dest: Optional[BatchJobDestination] = None

Configuration for the output data.

field display_name: Optional[str] = None (alias 'displayName')

The user-defined name of this Job.

field end_time: Optional[datetime] = None (alias 'endTime')

Output only. Time when the Job entered any of the following states: JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED.

field error: Optional[JobError] = None

Output only. Only populated when the job’s state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.

field model: Optional[str] = None

The name of the model that produces the predictions via the BatchJob.

field name: Optional[str] = None

Output only. Resource name of the Job.

field src: Optional[BatchJobSource] = None

Configuration for the input data.

field start_time: Optional[datetime] = None (alias 'startTime')

Output only. Time when the Job for the first time entered the JOB_STATE_RUNNING state.

field state: Optional[JobState] = None

Output only. The detailed state of the job.

field update_time: Optional[datetime] = None (alias 'updateTime')

Output only. Time when the Job was most recently updated.

pydantic model genai.types.BatchJobDestination

Bases: BaseModel

Config for des parameter.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "BatchJobDestination",
   "description": "Config for `des` parameter.",
   "type": "object",
   "properties": {
      "format": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Storage format of the output files. Must be one of:\n      'jsonl', 'bigquery'.\n      ",
         "title": "Format"
      },
      "gcsUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The Google Cloud Storage URI to the output file.\n      ",
         "title": "Gcsuri"
      },
      "bigqueryUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The BigQuery URI to the output table.\n      ",
         "title": "Bigqueryuri"
      }
   },
   "additionalProperties": false
}

Fields:
field bigquery_uri: Optional[str] = None (alias 'bigqueryUri')

The BigQuery URI to the output table.

field format: Optional[str] = None

Storage format of the output files. Must be one of: ‘jsonl’, ‘bigquery’.

field gcs_uri: Optional[str] = None (alias 'gcsUri')

The Google Cloud Storage URI to the output file.

class genai.types.BatchJobDestinationDict

Bases: TypedDict

Config for des parameter.

bigquery_uri: Optional[str]

The BigQuery URI to the output table.

format: Optional[str]

Storage format of the output files. Must be one of: ‘jsonl’, ‘bigquery’.

gcs_uri: Optional[str]

The Google Cloud Storage URI to the output file.

class genai.types.BatchJobDict

Bases: TypedDict

Config for batches.create return value.

create_time: Optional[datetime]

Output only. Time when the Job was created.

dest: Optional[BatchJobDestinationDict]

Configuration for the output data.

display_name: Optional[str]

The user-defined name of this Job.

end_time: Optional[datetime]

JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED.

Type:

Output only. Time when the Job entered any of the following states

error: Optional[JobErrorDict]

Output only. Only populated when the job’s state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.

model: Optional[str]

The name of the model that produces the predictions via the BatchJob.

name: Optional[str]

Output only. Resource name of the Job.

src: Optional[BatchJobSourceDict]

Configuration for the input data.

start_time: Optional[datetime]

Output only. Time when the Job for the first time entered the JOB_STATE_RUNNING state.

state: Optional[JobState]

Output only. The detailed state of the job.

update_time: Optional[datetime]

Output only. Time when the Job was most recently updated.

pydantic model genai.types.BatchJobSource

Bases: BaseModel

Config for src parameter.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "BatchJobSource",
   "description": "Config for `src` parameter.",
   "type": "object",
   "properties": {
      "format": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Storage format of the input files. Must be one of:\n      'jsonl', 'bigquery'.\n      ",
         "title": "Format"
      },
      "gcsUri": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The Google Cloud Storage URIs to input files.\n      ",
         "title": "Gcsuri"
      },
      "bigqueryUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The BigQuery URI to input table.\n      ",
         "title": "Bigqueryuri"
      }
   },
   "additionalProperties": false
}

Fields:
field bigquery_uri: Optional[str] = None (alias 'bigqueryUri')

The BigQuery URI to input table.

field format: Optional[str] = None

Storage format of the input files. Must be one of: ‘jsonl’, ‘bigquery’.

field gcs_uri: Optional[list[str]] = None (alias 'gcsUri')

The Google Cloud Storage URIs to input files.

class genai.types.BatchJobSourceDict

Bases: TypedDict

Config for src parameter.

bigquery_uri: Optional[str]

The BigQuery URI to input table.

format: Optional[str]

Storage format of the input files. Must be one of: ‘jsonl’, ‘bigquery’.

gcs_uri: Optional[list[str]]

The Google Cloud Storage URIs to input files.

class genai.types.Behavior(*values)

Bases: CaseInSensitiveEnum

Defines the function behavior. Defaults to BLOCKING.

BLOCKING = 'BLOCKING'

If set, the system will wait to receive the function response before continuing the conversation.

NON_BLOCKING = 'NON_BLOCKING'

If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.

UNSPECIFIED = 'UNSPECIFIED'

This value is unused.

pydantic model genai.types.Blob

Bases: BaseModel

Content blob.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Blob",
   "description": "Content blob.",
   "type": "object",
   "properties": {
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
         "title": "Displayname"
      },
      "data": {
         "anyOf": [
            {
               "format": "base64url",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. Raw bytes.",
         "title": "Data"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The IANA standard MIME type of the source data.",
         "title": "Mimetype"
      }
   },
   "additionalProperties": false
}

Fields:
field data: Optional[bytes] = None

Required. Raw bytes.

field display_name: Optional[str] = None (alias 'displayName')

Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.

field mime_type: Optional[str] = None (alias 'mimeType')

Required. The IANA standard MIME type of the source data.

class genai.types.BlobDict

Bases: TypedDict

Content blob.

data: Optional[bytes]

Required. Raw bytes.

display_name: Optional[str]

Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.

mime_type: Optional[str]

Required. The IANA standard MIME type of the source data.

class genai.types.BlockedReason(*values)

Bases: CaseInSensitiveEnum

Output only. Blocked reason.

BLOCKED_REASON_UNSPECIFIED = 'BLOCKED_REASON_UNSPECIFIED'

Unspecified blocked reason.

BLOCKLIST = 'BLOCKLIST'

Candidates blocked due to the terms which are included from the terminology blocklist.

OTHER = 'OTHER'

Candidates blocked due to other reason.

PROHIBITED_CONTENT = 'PROHIBITED_CONTENT'

Candidates blocked due to prohibited content.

SAFETY = 'SAFETY'

Candidates blocked due to safety.

pydantic model genai.types.CachedContent

Bases: BaseModel

A resource used in LLM queries for users to explicitly specify what to cache.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CachedContent",
   "description": "A resource used in LLM queries for users to explicitly specify what to cache.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The server-generated resource name of the cached content.",
         "title": "Name"
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The user-generated meaningful display name of the cached content.",
         "title": "Displayname"
      },
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the publisher model to use for cached content.",
         "title": "Model"
      },
      "createTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Creation time of the cache entry.",
         "title": "Createtime"
      },
      "updateTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "When the cache entry was last updated in UTC time.",
         "title": "Updatetime"
      },
      "expireTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Expiration time of the cached content.",
         "title": "Expiretime"
      },
      "usageMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/CachedContentUsageMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Metadata on the usage of the cached content."
      }
   },
   "$defs": {
      "CachedContentUsageMetadata": {
         "additionalProperties": false,
         "description": "Metadata on the usage of the cached content.",
         "properties": {
            "audioDurationSeconds": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Duration of audio in seconds.",
               "title": "Audiodurationseconds"
            },
            "imageCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of images.",
               "title": "Imagecount"
            },
            "textCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of text characters.",
               "title": "Textcount"
            },
            "totalTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total number of tokens that the cached content consumes.",
               "title": "Totaltokencount"
            },
            "videoDurationSeconds": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Duration of video in seconds.",
               "title": "Videodurationseconds"
            }
         },
         "title": "CachedContentUsageMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field create_time: Optional[datetime] = None (alias 'createTime')

Creation time of the cache entry.

field display_name: Optional[str] = None (alias 'displayName')

The user-generated meaningful display name of the cached content.

field expire_time: Optional[datetime] = None (alias 'expireTime')

Expiration time of the cached content.

field model: Optional[str] = None

The name of the publisher model to use for cached content.

field name: Optional[str] = None

The server-generated resource name of the cached content.

field update_time: Optional[datetime] = None (alias 'updateTime')

When the cache entry was last updated in UTC time.

field usage_metadata: Optional[CachedContentUsageMetadata] = None (alias 'usageMetadata')

Metadata on the usage of the cached content.

class genai.types.CachedContentDict

Bases: TypedDict

A resource used in LLM queries for users to explicitly specify what to cache.

create_time: Optional[datetime]

Creation time of the cache entry.

display_name: Optional[str]

The user-generated meaningful display name of the cached content.

expire_time: Optional[datetime]

Expiration time of the cached content.

model: Optional[str]

The name of the publisher model to use for cached content.

name: Optional[str]

The server-generated resource name of the cached content.

update_time: Optional[datetime]

When the cache entry was last updated in UTC time.

usage_metadata: Optional[CachedContentUsageMetadataDict]

Metadata on the usage of the cached content.

pydantic model genai.types.CachedContentUsageMetadata

Bases: BaseModel

Metadata on the usage of the cached content.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CachedContentUsageMetadata",
   "description": "Metadata on the usage of the cached content.",
   "type": "object",
   "properties": {
      "audioDurationSeconds": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Duration of audio in seconds.",
         "title": "Audiodurationseconds"
      },
      "imageCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of images.",
         "title": "Imagecount"
      },
      "textCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of text characters.",
         "title": "Textcount"
      },
      "totalTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total number of tokens that the cached content consumes.",
         "title": "Totaltokencount"
      },
      "videoDurationSeconds": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Duration of video in seconds.",
         "title": "Videodurationseconds"
      }
   },
   "additionalProperties": false
}

Fields:
field audio_duration_seconds: Optional[int] = None (alias 'audioDurationSeconds')

Duration of audio in seconds.

field image_count: Optional[int] = None (alias 'imageCount')

Number of images.

field text_count: Optional[int] = None (alias 'textCount')

Number of text characters.

field total_token_count: Optional[int] = None (alias 'totalTokenCount')

Total number of tokens that the cached content consumes.

field video_duration_seconds: Optional[int] = None (alias 'videoDurationSeconds')

Duration of video in seconds.

class genai.types.CachedContentUsageMetadataDict

Bases: TypedDict

Metadata on the usage of the cached content.

audio_duration_seconds: Optional[int]

Duration of audio in seconds.

image_count: Optional[int]

Number of images.

text_count: Optional[int]

Number of text characters.

total_token_count: Optional[int]

Total number of tokens that the cached content consumes.

video_duration_seconds: Optional[int]

Duration of video in seconds.

pydantic model genai.types.CancelBatchJobConfig

Bases: BaseModel

Optional parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CancelBatchJobConfig",
   "description": "Optional parameters.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.CancelBatchJobConfigDict

Bases: TypedDict

Optional parameters.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.Candidate

Bases: BaseModel

A response candidate generated from the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Candidate",
   "description": "A response candidate generated from the model.",
   "type": "object",
   "properties": {
      "content": {
         "anyOf": [
            {
               "$ref": "#/$defs/Content"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Contains the multi-part content of the response.\n      "
      },
      "citationMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/CitationMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Source attribution of the generated content.\n      "
      },
      "finishMessage": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Describes the reason the model stopped generating tokens.\n      ",
         "title": "Finishmessage"
      },
      "tokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens for this candidate.\n      ",
         "title": "Tokencount"
      },
      "finishReason": {
         "anyOf": [
            {
               "$ref": "#/$defs/FinishReason"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reason why the model stopped generating tokens.\n      If empty, the model has not stopped generating the tokens.\n      "
      },
      "urlContextMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/UrlContextMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Metadata related to url context retrieval tool."
      },
      "avgLogprobs": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Average log probability score of the candidate.",
         "title": "Avglogprobs"
      },
      "groundingMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/GroundingMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Metadata specifies sources used to ground generated content."
      },
      "index": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Index of the candidate.",
         "title": "Index"
      },
      "logprobsResult": {
         "anyOf": [
            {
               "$ref": "#/$defs/LogprobsResult"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Log-likelihood scores for the response tokens and top tokens"
      },
      "safetyRatings": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/SafetyRating"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.",
         "title": "Safetyratings"
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "Citation": {
         "additionalProperties": false,
         "description": "Source attributions for content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index into the content.",
               "title": "Endindex"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. License of the attribution.",
               "title": "License"
            },
            "publicationDate": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleTypeDate"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Publication date of the attribution."
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index into the content.",
               "title": "Startindex"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Url reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "Citation",
         "type": "object"
      },
      "CitationMetadata": {
         "additionalProperties": false,
         "description": "Citation information when the model quotes another source.",
         "properties": {
            "citations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Citation"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Contains citation information when the model directly quotes, at\n      length, from another source. Can include traditional websites and code\n      repositories.\n      ",
               "title": "Citations"
            }
         },
         "title": "CitationMetadata",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FinishReason": {
         "description": "Output only. The reason why the model stopped generating tokens.\n\nIf empty, the model has not stopped generating the tokens.",
         "enum": [
            "FINISH_REASON_UNSPECIFIED",
            "STOP",
            "MAX_TOKENS",
            "SAFETY",
            "RECITATION",
            "LANGUAGE",
            "OTHER",
            "BLOCKLIST",
            "PROHIBITED_CONTENT",
            "SPII",
            "MALFORMED_FUNCTION_CALL",
            "IMAGE_SAFETY"
         ],
         "title": "FinishReason",
         "type": "string"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GoogleTypeDate": {
         "additionalProperties": false,
         "description": "Represents a whole or partial calendar date, such as a birthday.\n\nThe time of day and time zone are either specified elsewhere or are\ninsignificant. The date is relative to the Gregorian Calendar. This can\nrepresent one of the following: * A full date, with non-zero year, month, and\nday values. * A month and day, with a zero year (for example, an anniversary).\n* A year on its own, with a zero month and a zero day. * A year and month,\nwith a zero day (for example, a credit card expiration date). Related types: *\ngoogle.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp",
         "properties": {
            "day": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.",
               "title": "Day"
            },
            "month": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.",
               "title": "Month"
            },
            "year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.",
               "title": "Year"
            }
         },
         "title": "GoogleTypeDate",
         "type": "object"
      },
      "GroundingChunk": {
         "additionalProperties": false,
         "description": "Grounding chunk.",
         "properties": {
            "retrievedContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkRetrievedContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from context retrieved by the retrieval tools."
            },
            "web": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkWeb"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from the web."
            }
         },
         "title": "GroundingChunk",
         "type": "object"
      },
      "GroundingChunkRetrievedContext": {
         "additionalProperties": false,
         "description": "Chunk from context retrieved by the retrieval tools.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text of the attribution.",
               "title": "Text"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkRetrievedContext",
         "type": "object"
      },
      "GroundingChunkWeb": {
         "additionalProperties": false,
         "description": "Chunk from the web.",
         "properties": {
            "domain": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Domain of the (original) URI.",
               "title": "Domain"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the chunk.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the chunk.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkWeb",
         "type": "object"
      },
      "GroundingMetadata": {
         "additionalProperties": false,
         "description": "Metadata returned to client when grounding is enabled.",
         "properties": {
            "groundingChunks": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingChunk"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of supporting references retrieved from specified grounding source.",
               "title": "Groundingchunks"
            },
            "groundingSupports": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingSupport"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. List of grounding support.",
               "title": "Groundingsupports"
            },
            "retrievalMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetrievalMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output only. Retrieval metadata."
            },
            "retrievalQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Queries executed by the retrieval tools.",
               "title": "Retrievalqueries"
            },
            "searchEntryPoint": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SearchEntryPoint"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google search entry for the following-up web searches."
            },
            "webSearchQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web search queries for the following-up web search.",
               "title": "Websearchqueries"
            }
         },
         "title": "GroundingMetadata",
         "type": "object"
      },
      "GroundingSupport": {
         "additionalProperties": false,
         "description": "Grounding support.",
         "properties": {
            "confidenceScores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
               "title": "Confidencescores"
            },
            "groundingChunkIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.",
               "title": "Groundingchunkindices"
            },
            "segment": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Segment"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Segment of the content this support belongs to."
            }
         },
         "title": "GroundingSupport",
         "type": "object"
      },
      "HarmCategory": {
         "description": "Required. Harm category.",
         "enum": [
            "HARM_CATEGORY_UNSPECIFIED",
            "HARM_CATEGORY_HATE_SPEECH",
            "HARM_CATEGORY_DANGEROUS_CONTENT",
            "HARM_CATEGORY_HARASSMENT",
            "HARM_CATEGORY_SEXUALLY_EXPLICIT",
            "HARM_CATEGORY_CIVIC_INTEGRITY"
         ],
         "title": "HarmCategory",
         "type": "string"
      },
      "HarmProbability": {
         "description": "Output only. Harm probability levels in the content.",
         "enum": [
            "HARM_PROBABILITY_UNSPECIFIED",
            "NEGLIGIBLE",
            "LOW",
            "MEDIUM",
            "HIGH"
         ],
         "title": "HarmProbability",
         "type": "string"
      },
      "HarmSeverity": {
         "description": "Output only. Harm severity levels in the content.",
         "enum": [
            "HARM_SEVERITY_UNSPECIFIED",
            "HARM_SEVERITY_NEGLIGIBLE",
            "HARM_SEVERITY_LOW",
            "HARM_SEVERITY_MEDIUM",
            "HARM_SEVERITY_HIGH"
         ],
         "title": "HarmSeverity",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LogprobsResult": {
         "additionalProperties": false,
         "description": "Logprobs Result",
         "properties": {
            "chosenCandidates": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/LogprobsResultCandidate"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.",
               "title": "Chosencandidates"
            },
            "topCandidates": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/LogprobsResultTopCandidates"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Length = total number of decoding steps.",
               "title": "Topcandidates"
            }
         },
         "title": "LogprobsResult",
         "type": "object"
      },
      "LogprobsResultCandidate": {
         "additionalProperties": false,
         "description": "Candidate for the logprobs token and score.",
         "properties": {
            "logProbability": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's log probability.",
               "title": "Logprobability"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token string value.",
               "title": "Token"
            },
            "tokenId": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token id value.",
               "title": "Tokenid"
            }
         },
         "title": "LogprobsResultCandidate",
         "type": "object"
      },
      "LogprobsResultTopCandidates": {
         "additionalProperties": false,
         "description": "Candidates with top log probabilities at each decoding step.",
         "properties": {
            "candidates": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/LogprobsResultCandidate"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sorted by log probability in descending order.",
               "title": "Candidates"
            }
         },
         "title": "LogprobsResultTopCandidates",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "RetrievalMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to retrieval in the grounding flow.",
         "properties": {
            "googleSearchDynamicRetrievalScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.",
               "title": "Googlesearchdynamicretrievalscore"
            }
         },
         "title": "RetrievalMetadata",
         "type": "object"
      },
      "SafetyRating": {
         "additionalProperties": false,
         "description": "Safety rating corresponding to the generated content.",
         "properties": {
            "blocked": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Indicates whether the content was filtered out because of this rating.",
               "title": "Blocked"
            },
            "category": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmCategory"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm category."
            },
            "probability": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmProbability"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm probability levels in the content."
            },
            "probabilityScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm probability score.",
               "title": "Probabilityscore"
            },
            "severity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmSeverity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm severity levels in the content."
            },
            "severityScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm severity score.",
               "title": "Severityscore"
            }
         },
         "title": "SafetyRating",
         "type": "object"
      },
      "SearchEntryPoint": {
         "additionalProperties": false,
         "description": "Google search entry point.",
         "properties": {
            "renderedContent": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
               "title": "Renderedcontent"
            },
            "sdkBlob": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Base64 encoded JSON representing array of tuple.",
               "title": "Sdkblob"
            }
         },
         "title": "SearchEntryPoint",
         "type": "object"
      },
      "Segment": {
         "additionalProperties": false,
         "description": "Segment of the content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
               "title": "Endindex"
            },
            "partIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The index of a Part object within its parent Content object.",
               "title": "Partindex"
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.",
               "title": "Startindex"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The text corresponding to the segment from the response.",
               "title": "Text"
            }
         },
         "title": "Segment",
         "type": "object"
      },
      "UrlContextMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to url context retrieval tool.",
         "properties": {
            "urlMetadata": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/UrlMetadata"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of url context.",
               "title": "Urlmetadata"
            }
         },
         "title": "UrlContextMetadata",
         "type": "object"
      },
      "UrlMetadata": {
         "additionalProperties": false,
         "description": "Context for a single url retrieval.",
         "properties": {
            "retrievedUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URL retrieved by the tool.",
               "title": "Retrievedurl"
            },
            "urlRetrievalStatus": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlRetrievalStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Status of the url retrieval."
            }
         },
         "title": "UrlMetadata",
         "type": "object"
      },
      "UrlRetrievalStatus": {
         "description": "Status of the url retrieval.",
         "enum": [
            "URL_RETRIEVAL_STATUS_UNSPECIFIED",
            "URL_RETRIEVAL_STATUS_SUCCESS",
            "URL_RETRIEVAL_STATUS_ERROR"
         ],
         "title": "UrlRetrievalStatus",
         "type": "string"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field avg_logprobs: Optional[float] = None (alias 'avgLogprobs')

Output only. Average log probability score of the candidate.

field citation_metadata: Optional[CitationMetadata] = None (alias 'citationMetadata')

Source attribution of the generated content.

field content: Optional[Content] = None

Contains the multi-part content of the response.

field finish_message: Optional[str] = None (alias 'finishMessage')

Describes the reason the model stopped generating tokens.

field finish_reason: Optional[FinishReason] = None (alias 'finishReason')

The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

field grounding_metadata: Optional[GroundingMetadata] = None (alias 'groundingMetadata')

Output only. Metadata specifies sources used to ground generated content.

field index: Optional[int] = None

Output only. Index of the candidate.

field logprobs_result: Optional[LogprobsResult] = None (alias 'logprobsResult')

Output only. Log-likelihood scores for the response tokens and top tokens

field safety_ratings: Optional[list[SafetyRating]] = None (alias 'safetyRatings')

Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.

field token_count: Optional[int] = None (alias 'tokenCount')

Number of tokens for this candidate.

field url_context_metadata: Optional[UrlContextMetadata] = None (alias 'urlContextMetadata')

Metadata related to url context retrieval tool.

class genai.types.CandidateDict

Bases: TypedDict

A response candidate generated from the model.

avg_logprobs: Optional[float]

Output only. Average log probability score of the candidate.

citation_metadata: Optional[CitationMetadataDict]

Source attribution of the generated content.

content: Optional[ContentDict]

Contains the multi-part content of the response.

finish_message: Optional[str]

Describes the reason the model stopped generating tokens.

finish_reason: Optional[FinishReason]

The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

grounding_metadata: Optional[GroundingMetadataDict]

Output only. Metadata specifies sources used to ground generated content.

index: Optional[int]

Output only. Index of the candidate.

logprobs_result: Optional[LogprobsResultDict]

Output only. Log-likelihood scores for the response tokens and top tokens

safety_ratings: Optional[list[SafetyRatingDict]]

Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.

token_count: Optional[int]

Number of tokens for this candidate.

url_context_metadata: Optional[UrlContextMetadataDict]

Metadata related to url context retrieval tool.

pydantic model genai.types.Checkpoint

Bases: BaseModel

Describes the machine learning model version checkpoint.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Checkpoint",
   "description": "Describes the machine learning model version checkpoint.",
   "type": "object",
   "properties": {
      "checkpointId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The ID of the checkpoint.\n      ",
         "title": "Checkpointid"
      },
      "epoch": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The epoch of the checkpoint.\n      ",
         "title": "Epoch"
      },
      "step": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The step of the checkpoint.\n      ",
         "title": "Step"
      }
   },
   "additionalProperties": false
}

Fields:
field checkpoint_id: Optional[str] = None (alias 'checkpointId')

The ID of the checkpoint.

field epoch: Optional[int] = None

The epoch of the checkpoint.

field step: Optional[int] = None

The step of the checkpoint.

class genai.types.CheckpointDict

Bases: TypedDict

Describes the machine learning model version checkpoint.

checkpoint_id: Optional[str]

The ID of the checkpoint.

epoch: Optional[int]

The epoch of the checkpoint.

step: Optional[int]

The step of the checkpoint.

pydantic model genai.types.Citation

Bases: BaseModel

Source attributions for content.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Citation",
   "description": "Source attributions for content.",
   "type": "object",
   "properties": {
      "endIndex": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. End index into the content.",
         "title": "Endindex"
      },
      "license": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. License of the attribution.",
         "title": "License"
      },
      "publicationDate": {
         "anyOf": [
            {
               "$ref": "#/$defs/GoogleTypeDate"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Publication date of the attribution."
      },
      "startIndex": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Start index into the content.",
         "title": "Startindex"
      },
      "title": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Title of the attribution.",
         "title": "Title"
      },
      "uri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Url reference of the attribution.",
         "title": "Uri"
      }
   },
   "$defs": {
      "GoogleTypeDate": {
         "additionalProperties": false,
         "description": "Represents a whole or partial calendar date, such as a birthday.\n\nThe time of day and time zone are either specified elsewhere or are\ninsignificant. The date is relative to the Gregorian Calendar. This can\nrepresent one of the following: * A full date, with non-zero year, month, and\nday values. * A month and day, with a zero year (for example, an anniversary).\n* A year on its own, with a zero month and a zero day. * A year and month,\nwith a zero day (for example, a credit card expiration date). Related types: *\ngoogle.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp",
         "properties": {
            "day": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.",
               "title": "Day"
            },
            "month": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.",
               "title": "Month"
            },
            "year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.",
               "title": "Year"
            }
         },
         "title": "GoogleTypeDate",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field end_index: Optional[int] = None (alias 'endIndex')

Output only. End index into the content.

field license: Optional[str] = None

Output only. License of the attribution.

field publication_date: Optional[GoogleTypeDate] = None (alias 'publicationDate')

Output only. Publication date of the attribution.

field start_index: Optional[int] = None (alias 'startIndex')

Output only. Start index into the content.

field title: Optional[str] = None

Output only. Title of the attribution.

field uri: Optional[str] = None

Output only. Url reference of the attribution.

class genai.types.CitationDict

Bases: TypedDict

Source attributions for content.

end_index: Optional[int]

Output only. End index into the content.

license: Optional[str]

Output only. License of the attribution.

publication_date: Optional[GoogleTypeDateDict]

Output only. Publication date of the attribution.

start_index: Optional[int]

Output only. Start index into the content.

title: Optional[str]

Output only. Title of the attribution.

uri: Optional[str]

Output only. Url reference of the attribution.

pydantic model genai.types.CitationMetadata

Bases: BaseModel

Citation information when the model quotes another source.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CitationMetadata",
   "description": "Citation information when the model quotes another source.",
   "type": "object",
   "properties": {
      "citations": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Citation"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Contains citation information when the model directly quotes, at\n      length, from another source. Can include traditional websites and code\n      repositories.\n      ",
         "title": "Citations"
      }
   },
   "$defs": {
      "Citation": {
         "additionalProperties": false,
         "description": "Source attributions for content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index into the content.",
               "title": "Endindex"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. License of the attribution.",
               "title": "License"
            },
            "publicationDate": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleTypeDate"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Publication date of the attribution."
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index into the content.",
               "title": "Startindex"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Url reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "Citation",
         "type": "object"
      },
      "GoogleTypeDate": {
         "additionalProperties": false,
         "description": "Represents a whole or partial calendar date, such as a birthday.\n\nThe time of day and time zone are either specified elsewhere or are\ninsignificant. The date is relative to the Gregorian Calendar. This can\nrepresent one of the following: * A full date, with non-zero year, month, and\nday values. * A month and day, with a zero year (for example, an anniversary).\n* A year on its own, with a zero month and a zero day. * A year and month,\nwith a zero day (for example, a credit card expiration date). Related types: *\ngoogle.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp",
         "properties": {
            "day": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.",
               "title": "Day"
            },
            "month": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.",
               "title": "Month"
            },
            "year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.",
               "title": "Year"
            }
         },
         "title": "GoogleTypeDate",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field citations: Optional[list[Citation]] = None

Contains citation information when the model directly quotes, at length, from another source. Can include traditional websites and code repositories.

class genai.types.CitationMetadataDict

Bases: TypedDict

Citation information when the model quotes another source.

citations: Optional[list[CitationDict]]

Contains citation information when the model directly quotes, at length, from another source. Can include traditional websites and code repositories.

pydantic model genai.types.CodeExecutionResult

Bases: BaseModel

Result of executing the [ExecutableCode].

Always follows a part containing the [ExecutableCode].

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CodeExecutionResult",
   "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
   "type": "object",
   "properties": {
      "outcome": {
         "anyOf": [
            {
               "$ref": "#/$defs/Outcome"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. Outcome of the code execution."
      },
      "output": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
         "title": "Output"
      }
   },
   "$defs": {
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field outcome: Optional[Outcome] = None

Required. Outcome of the code execution.

field output: Optional[str] = None

Optional. Contains stdout when code execution is successful, stderr or other description otherwise.

class genai.types.CodeExecutionResultDict

Bases: TypedDict

Result of executing the [ExecutableCode].

Always follows a part containing the [ExecutableCode].

outcome: Optional[Outcome]

Required. Outcome of the code execution.

output: Optional[str]

Optional. Contains stdout when code execution is successful, stderr or other description otherwise.

pydantic model genai.types.ComputeTokensConfig

Bases: BaseModel

Optional parameters for computing tokens.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ComputeTokensConfig",
   "description": "Optional parameters for computing tokens.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.ComputeTokensConfigDict

Bases: TypedDict

Optional parameters for computing tokens.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.ComputeTokensResponse

Bases: BaseModel

Response for computing tokens.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ComputeTokensResponse",
   "description": "Response for computing tokens.",
   "type": "object",
   "properties": {
      "tokensInfo": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/TokensInfo"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances.",
         "title": "Tokensinfo"
      }
   },
   "$defs": {
      "TokensInfo": {
         "additionalProperties": false,
         "description": "Tokens info with a list of tokens and the corresponding list of token ids.",
         "properties": {
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Optional fields for the role from the corresponding Content.",
               "title": "Role"
            },
            "tokenIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of token ids from the input.",
               "title": "Tokenids"
            },
            "tokens": {
               "anyOf": [
                  {
                     "items": {
                        "format": "base64url",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of tokens from the input.",
               "title": "Tokens"
            }
         },
         "title": "TokensInfo",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field tokens_info: Optional[list[TokensInfo]] = None (alias 'tokensInfo')

Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances.

class genai.types.ComputeTokensResponseDict

Bases: TypedDict

Response for computing tokens.

tokens_info: Optional[list[TokensInfoDict]]

Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances.

pydantic model genai.types.Content

Bases: BaseModel

Contains the multi-part content of a message.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Content",
   "description": "Contains the multi-part content of a message.",
   "type": "object",
   "properties": {
      "parts": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Part"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
         "title": "Parts"
      },
      "role": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
         "title": "Role"
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field parts: Optional[list[Part]] = None

List of parts that constitute a single message. Each part may have a different IANA MIME type.

field role: Optional[str] = None

Optional. The producer of the content. Must be either ‘user’ or ‘model’. Useful to set for multi-turn conversations, otherwise can be empty. If role is not specified, SDK will determine the role.

class genai.types.ContentDict

Bases: TypedDict

Contains the multi-part content of a message.

parts: Optional[list[PartDict]]

List of parts that constitute a single message. Each part may have a different IANA MIME type.

role: Optional[str]

Optional. The producer of the content. Must be either ‘user’ or ‘model’. Useful to set for multi-turn conversations, otherwise can be empty. If role is not specified, SDK will determine the role.

pydantic model genai.types.ContentEmbedding

Bases: BaseModel

The embedding generated from an input content.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ContentEmbedding",
   "description": "The embedding generated from an input content.",
   "type": "object",
   "properties": {
      "values": {
         "anyOf": [
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of floats representing an embedding.\n      ",
         "title": "Values"
      },
      "statistics": {
         "anyOf": [
            {
               "$ref": "#/$defs/ContentEmbeddingStatistics"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Vertex API only. Statistics of the input text associated with this\n      embedding.\n      "
      }
   },
   "$defs": {
      "ContentEmbeddingStatistics": {
         "additionalProperties": false,
         "description": "Statistics of the input text associated with the result of content embedding.",
         "properties": {
            "truncated": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Vertex API only. If the input text was truncated due to having\n      a length longer than the allowed maximum input.\n      ",
               "title": "Truncated"
            },
            "tokenCount": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Vertex API only. Number of tokens of the input text.\n      ",
               "title": "Tokencount"
            }
         },
         "title": "ContentEmbeddingStatistics",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field statistics: Optional[ContentEmbeddingStatistics] = None

Vertex API only. Statistics of the input text associated with this embedding.

field values: Optional[list[float]] = None

A list of floats representing an embedding.

class genai.types.ContentEmbeddingDict

Bases: TypedDict

The embedding generated from an input content.

statistics: Optional[ContentEmbeddingStatisticsDict]

Vertex API only. Statistics of the input text associated with this embedding.

pydantic model genai.types.ContentEmbeddingStatistics

Bases: BaseModel

Statistics of the input text associated with the result of content embedding.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ContentEmbeddingStatistics",
   "description": "Statistics of the input text associated with the result of content embedding.",
   "type": "object",
   "properties": {
      "truncated": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Vertex API only. If the input text was truncated due to having\n      a length longer than the allowed maximum input.\n      ",
         "title": "Truncated"
      },
      "tokenCount": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Vertex API only. Number of tokens of the input text.\n      ",
         "title": "Tokencount"
      }
   },
   "additionalProperties": false
}

Fields:
field token_count: Optional[float] = None (alias 'tokenCount')

Vertex API only. Number of tokens of the input text.

field truncated: Optional[bool] = None

Vertex API only. If the input text was truncated due to having a length longer than the allowed maximum input.

class genai.types.ContentEmbeddingStatisticsDict

Bases: TypedDict

Statistics of the input text associated with the result of content embedding.

token_count: Optional[float]

Vertex API only. Number of tokens of the input text.

truncated: Optional[bool]

Vertex API only. If the input text was truncated due to having a length longer than the allowed maximum input.

pydantic model genai.types.ContextWindowCompressionConfig

Bases: BaseModel

Enables context window compression – mechanism managing model context window so it does not exceed given length.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ContextWindowCompressionConfig",
   "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
   "type": "object",
   "properties": {
      "triggerTokens": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
         "title": "Triggertokens"
      },
      "slidingWindow": {
         "anyOf": [
            {
               "$ref": "#/$defs/SlidingWindow"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Sliding window compression mechanism."
      }
   },
   "$defs": {
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field sliding_window: Optional[SlidingWindow] = None (alias 'slidingWindow')

Sliding window compression mechanism.

field trigger_tokens: Optional[int] = None (alias 'triggerTokens')

Number of tokens (before running turn) that triggers context window compression mechanism.

class genai.types.ContextWindowCompressionConfigDict

Bases: TypedDict

Enables context window compression – mechanism managing model context window so it does not exceed given length.

sliding_window: Optional[SlidingWindowDict]

Sliding window compression mechanism.

trigger_tokens: Optional[int]

Number of tokens (before running turn) that triggers context window compression mechanism.

pydantic model genai.types.ControlReferenceConfig

Bases: BaseModel

Configuration for a Control reference image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ControlReferenceConfig",
   "description": "Configuration for a Control reference image.",
   "type": "object",
   "properties": {
      "controlType": {
         "anyOf": [
            {
               "$ref": "#/$defs/ControlReferenceType"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of control reference image to use."
      },
      "enableControlImageComputation": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Defaults to False. When set to True, the control image will be\n      computed by the model based on the control type. When set to False,\n      the control image must be provided by the user.",
         "title": "Enablecontrolimagecomputation"
      }
   },
   "$defs": {
      "ControlReferenceType": {
         "description": "Enum representing the control type of a control reference image.",
         "enum": [
            "CONTROL_TYPE_DEFAULT",
            "CONTROL_TYPE_CANNY",
            "CONTROL_TYPE_SCRIBBLE",
            "CONTROL_TYPE_FACE_MESH"
         ],
         "title": "ControlReferenceType",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field control_type: Optional[ControlReferenceType] = None (alias 'controlType')

The type of control reference image to use.

field enable_control_image_computation: Optional[bool] = None (alias 'enableControlImageComputation')

Defaults to False. When set to True, the control image will be computed by the model based on the control type. When set to False, the control image must be provided by the user.

class genai.types.ControlReferenceConfigDict

Bases: TypedDict

Configuration for a Control reference image.

control_type: Optional[ControlReferenceType]

The type of control reference image to use.

enable_control_image_computation: Optional[bool]

Defaults to False. When set to True, the control image will be computed by the model based on the control type. When set to False, the control image must be provided by the user.

pydantic model genai.types.ControlReferenceImage

Bases: BaseModel

A control reference image.

The image of the control reference image is either a control image provided by the user, or a regular image which the backend will use to generate a control image of. In the case of the latter, the enable_control_image_computation field in the config should be set to True.

A control image is an image that represents a sketch image of areas for the model to fill in based on the prompt.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ControlReferenceImage",
   "description": "A control reference image.\n\nThe image of the control reference image is either a control image provided\nby the user, or a regular image which the backend will use to generate a\ncontrol image of. In the case of the latter, the\nenable_control_image_computation field in the config should be set to True.\n\nA control image is an image that represents a sketch image of areas for the\nmodel to fill in based on the prompt.",
   "type": "object",
   "properties": {
      "referenceImage": {
         "anyOf": [
            {
               "$ref": "#/$defs/Image"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reference image for the editing operation."
      },
      "referenceId": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The id of the reference image.",
         "title": "Referenceid"
      },
      "referenceType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of the reference image. Only set by the SDK.",
         "title": "Referencetype"
      },
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/ControlReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for the control reference image."
      },
      "controlImageConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/ControlReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": ""
      }
   },
   "$defs": {
      "ControlReferenceConfig": {
         "additionalProperties": false,
         "description": "Configuration for a Control reference image.",
         "properties": {
            "controlType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ControlReferenceType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of control reference image to use."
            },
            "enableControlImageComputation": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defaults to False. When set to True, the control image will be\n      computed by the model based on the control type. When set to False,\n      the control image must be provided by the user.",
               "title": "Enablecontrolimagecomputation"
            }
         },
         "title": "ControlReferenceConfig",
         "type": "object"
      },
      "ControlReferenceType": {
         "description": "Enum representing the control type of a control reference image.",
         "enum": [
            "CONTROL_TYPE_DEFAULT",
            "CONTROL_TYPE_CANNY",
            "CONTROL_TYPE_SCRIBBLE",
            "CONTROL_TYPE_FACE_MESH"
         ],
         "title": "ControlReferenceType",
         "type": "string"
      },
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • _validate_mask_image_config » all fields

field config: Optional[ControlReferenceConfig] = None

Re-map config to control_reference_config to send to API.

Configuration for the control reference image.

Validated by:
  • _validate_mask_image_config

field control_image_config: Optional[ControlReferenceConfig] = None (alias 'controlImageConfig')
Validated by:
  • _validate_mask_image_config

field reference_id: Optional[int] = None (alias 'referenceId')

The id of the reference image.

Validated by:
  • _validate_mask_image_config

field reference_image: Optional[Image] = None (alias 'referenceImage')

The reference image for the editing operation.

Validated by:
  • _validate_mask_image_config

field reference_type: Optional[str] = None (alias 'referenceType')

The type of the reference image. Only set by the SDK.

Validated by:
  • _validate_mask_image_config

class genai.types.ControlReferenceImageDict

Bases: TypedDict

A control reference image.

The image of the control reference image is either a control image provided by the user, or a regular image which the backend will use to generate a control image of. In the case of the latter, the enable_control_image_computation field in the config should be set to True.

A control image is an image that represents a sketch image of areas for the model to fill in based on the prompt.

config: Optional[ControlReferenceConfigDict]

Configuration for the control reference image.

reference_id: Optional[int]

The id of the reference image.

reference_image: Optional[ImageDict]

The reference image for the editing operation.

reference_type: Optional[str]

The type of the reference image. Only set by the SDK.

class genai.types.ControlReferenceType(*values)

Bases: CaseInSensitiveEnum

Enum representing the control type of a control reference image.

CONTROL_TYPE_CANNY = 'CONTROL_TYPE_CANNY'
CONTROL_TYPE_DEFAULT = 'CONTROL_TYPE_DEFAULT'
CONTROL_TYPE_FACE_MESH = 'CONTROL_TYPE_FACE_MESH'
CONTROL_TYPE_SCRIBBLE = 'CONTROL_TYPE_SCRIBBLE'
pydantic model genai.types.CountTokensConfig

Bases: BaseModel

Config for the count_tokens method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CountTokensConfig",
   "description": "Config for the count_tokens method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "systemInstruction": {
         "anyOf": [
            {
               "$ref": "#/$defs/Content"
            },
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/File"
                     },
                     {
                        "$ref": "#/$defs/Part"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "$ref": "#/$defs/File"
            },
            {
               "$ref": "#/$defs/Part"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Instructions for the model to steer it toward better performance.\n      ",
         "title": "Systeminstruction"
      },
      "tools": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Tool"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Code that enables the system to interact with external systems to\n      perform an action outside of the knowledge and scope of the model.\n      ",
         "title": "Tools"
      },
      "generationConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerationConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration that the model uses to generate the response. Not\n      supported by the Gemini Developer API.\n      "
      }
   },
   "$defs": {
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field generation_config: Optional[GenerationConfig] = None (alias 'generationConfig')

Configuration that the model uses to generate the response. Not supported by the Gemini Developer API.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, None] = None (alias 'systemInstruction')

Instructions for the model to steer it toward better performance.

field tools: Optional[list[Tool]] = None

Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model.

class genai.types.CountTokensConfigDict

Bases: TypedDict

Config for the count_tokens method.

generation_config: Optional[GenerationConfigDict]

Configuration that the model uses to generate the response. Not supported by the Gemini Developer API.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, ContentDict, None]

Instructions for the model to steer it toward better performance.

tools: Optional[list[ToolDict]]

Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model.

pydantic model genai.types.CountTokensResponse

Bases: BaseModel

Response for counting tokens.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CountTokensResponse",
   "description": "Response for counting tokens.",
   "type": "object",
   "properties": {
      "totalTokens": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total number of tokens.",
         "title": "Totaltokens"
      },
      "cachedContentTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens in the cached part of the prompt (the cached content).",
         "title": "Cachedcontenttokencount"
      }
   },
   "additionalProperties": false
}

Fields:
field cached_content_token_count: Optional[int] = None (alias 'cachedContentTokenCount')

Number of tokens in the cached part of the prompt (the cached content).

field total_tokens: Optional[int] = None (alias 'totalTokens')

Total number of tokens.

class genai.types.CountTokensResponseDict

Bases: TypedDict

Response for counting tokens.

cached_content_token_count: Optional[int]

Number of tokens in the cached part of the prompt (the cached content).

total_tokens: Optional[int]

Total number of tokens.

pydantic model genai.types.CreateAuthTokenConfig

Bases: BaseModel

Optional parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CreateAuthTokenConfig",
   "description": "Optional parameters.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "expireTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "An optional time after which, when using the resulting token,\n      messages in Live API sessions will be rejected. (Gemini may\n      preemptively close the session after this time.)\n\n      If not set then this defaults to 30 minutes in the future. If set, this\n      value must be less than 20 hours in the future.",
         "title": "Expiretime"
      },
      "newSessionExpireTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time after which new Live API sessions using the token\n      resulting from this request will be rejected.\n\n      If not set this defaults to 60 seconds in the future. If set, this value\n      must be less than 20 hours in the future.",
         "title": "Newsessionexpiretime"
      },
      "uses": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The number of times the token can be used. If this value is zero\n      then no limit is applied. Default is 1. Resuming a Live API session does\n      not count as a use.",
         "title": "Uses"
      },
      "liveEphemeralParameters": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveEphemeralParameters"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration specific to Live API connections created using this token."
      },
      "lockAdditionalFields": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Additional fields to lock in the effective LiveConnectParameters.",
         "title": "Lockadditionalfields"
      }
   },
   "$defs": {
      "ActivityHandling": {
         "description": "The different ways of handling user activity.",
         "enum": [
            "ACTIVITY_HANDLING_UNSPECIFIED",
            "START_OF_ACTIVITY_INTERRUPTS",
            "NO_INTERRUPTION"
         ],
         "title": "ActivityHandling",
         "type": "string"
      },
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AudioTranscriptionConfig": {
         "additionalProperties": false,
         "description": "The audio transcription configuration in Setup.",
         "properties": {},
         "title": "AudioTranscriptionConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "AutomaticActivityDetection": {
         "additionalProperties": false,
         "description": "Configures automatic detection of activity.",
         "properties": {
            "disabled": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.",
               "title": "Disabled"
            },
            "startOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/StartSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely speech is to be detected."
            },
            "endOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EndSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely detected speech is ended."
            },
            "prefixPaddingMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.",
               "title": "Prefixpaddingms"
            },
            "silenceDurationMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.",
               "title": "Silencedurationms"
            }
         },
         "title": "AutomaticActivityDetection",
         "type": "object"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ContextWindowCompressionConfig": {
         "additionalProperties": false,
         "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
         "properties": {
            "triggerTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
               "title": "Triggertokens"
            },
            "slidingWindow": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SlidingWindow"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sliding window compression mechanism."
            }
         },
         "title": "ContextWindowCompressionConfig",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EndSensitivity": {
         "description": "End of speech sensitivity.",
         "enum": [
            "END_SENSITIVITY_UNSPECIFIED",
            "END_SENSITIVITY_HIGH",
            "END_SENSITIVITY_LOW"
         ],
         "title": "EndSensitivity",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LiveConnectConfig": {
         "additionalProperties": false,
         "description": "Session config for the API connection.",
         "properties": {
            "httpOptions": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HttpOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Used to override HTTP request options."
            },
            "generationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The generation configuration for the session."
            },
            "responseModalities": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Modality"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The requested modalities of the response. Represents the set of\n      modalities that the model can return. Defaults to AUDIO if not specified.\n      ",
               "title": "Responsemodalities"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value that controls the degree of randomness in token selection.\n      Lower temperatures are good for prompts that require a less open-ended or\n      creative response, while higher temperatures can lead to more diverse or\n      creative results.\n      ",
               "title": "Temperature"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Tokens are selected from the most to least probable until the sum\n      of their probabilities equals this value. Use a lower value for less\n      random responses and a higher value for more random responses.\n      ",
               "title": "Topp"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "For each token selection step, the ``top_k`` tokens with the\n      highest probabilities are sampled. Then tokens are further filtered based\n      on ``top_p`` with the final token selected using temperature sampling. Use\n      a lower number for less random responses and a higher number for more\n      random responses.\n      ",
               "title": "Topk"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of tokens that can be generated in the response.\n      ",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If specified, the media resolution specified will be used.\n      "
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "When ``seed`` is fixed to a specific number, the model makes a best\n      effort to provide the same response for repeated requests. By default, a\n      random number is used.\n      ",
               "title": "Seed"
            },
            "speechConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SpeechConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The speech generation configuration.\n      "
            },
            "enableAffectiveDialog": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model will detect emotions and adapt its responses accordingly.",
               "title": "Enableaffectivedialog"
            },
            "systemInstruction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "#/$defs/File"
                           },
                           {
                              "$ref": "#/$defs/Part"
                           },
                           {
                              "type": "string"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "$ref": "#/$defs/File"
                  },
                  {
                     "$ref": "#/$defs/Part"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The user provided system instructions for the model.\n      Note: only text should be used in parts and content in each part will be\n      in a separate paragraph.",
               "title": "Systeminstruction"
            },
            "tools": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tool"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Tools` the model may use to generate the next response.\n\n      A `Tool` is a piece of code that enables the system to interact with\n      external systems to perform an action, or set of actions, outside of\n      knowledge and scope of the model.",
               "title": "Tools"
            },
            "sessionResumption": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SessionResumptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures session resumption mechanism.\n\nIf included the server will send SessionResumptionUpdate messages."
            },
            "inputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the input aligns with the input audio language.\n      "
            },
            "outputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the output aligns with the language code\n      specified for the output audio.\n      "
            },
            "realtimeInputConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RealtimeInputConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the realtime input behavior in BidiGenerateContent."
            },
            "contextWindowCompression": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContextWindowCompressionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures context window compression mechanism.\n\n      If included, server will compress context window to fit into given length."
            },
            "proactivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ProactivityConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the proactivity of the model. This allows the model to respond proactively to\n    the input and to ignore irrelevant input."
            }
         },
         "title": "LiveConnectConfig",
         "type": "object"
      },
      "LiveEphemeralParameters": {
         "additionalProperties": false,
         "description": "Config for LiveEphemeralParameters for Auth Token creation.",
         "properties": {
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "ID of the model to configure in the ephemeral token for Live API.\n      For a list of models, see `Gemini models\n      <https://ai.google.dev/gemini-api/docs/models>`.",
               "title": "Model"
            },
            "config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveConnectConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configuration specific to Live API connections created using this token."
            }
         },
         "title": "LiveEphemeralParameters",
         "type": "object"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Modality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "AUDIO"
         ],
         "title": "Modality",
         "type": "string"
      },
      "MultiSpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the multi-speaker setup.",
         "properties": {
            "speakerVoiceConfigs": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SpeakerVoiceConfig"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.",
               "title": "Speakervoiceconfigs"
            }
         },
         "title": "MultiSpeakerVoiceConfig",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "ProactivityConfig": {
         "additionalProperties": false,
         "description": "Config for proactivity features.",
         "properties": {
            "proactiveAudio": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
               "title": "Proactiveaudio"
            }
         },
         "title": "ProactivityConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "RealtimeInputConfig": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {
            "automaticActivityDetection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AutomaticActivityDetection"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals."
            },
            "activityHandling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityHandling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines what effect activity has."
            },
            "turnCoverage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TurnCoverage"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines which input is included in the user's turn."
            }
         },
         "title": "RealtimeInputConfig",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SessionResumptionConfig": {
         "additionalProperties": false,
         "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
         "properties": {
            "handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
               "title": "Handle"
            },
            "transparent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
               "title": "Transparent"
            }
         },
         "title": "SessionResumptionConfig",
         "type": "object"
      },
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "SpeechConfig": {
         "additionalProperties": false,
         "description": "The speech generation configuration.",
         "properties": {
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            },
            "multiSpeakerVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the multi-speaker setup.\n          It is mutually exclusive with the voice_config field.\n          "
            },
            "languageCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Language code (ISO 639. e.g. en-US) for the speech synthesization.\n      Only available for Live API.\n      ",
               "title": "Languagecode"
            }
         },
         "title": "SpeechConfig",
         "type": "object"
      },
      "StartSensitivity": {
         "description": "Start of speech sensitivity.",
         "enum": [
            "START_SENSITIVITY_UNSPECIFIED",
            "START_SENSITIVITY_HIGH",
            "START_SENSITIVITY_LOW"
         ],
         "title": "StartSensitivity",
         "type": "string"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "TurnCoverage": {
         "description": "Options about which input is included in the user's turn.",
         "enum": [
            "TURN_COVERAGE_UNSPECIFIED",
            "TURN_INCLUDES_ONLY_ACTIVITY",
            "TURN_INCLUDES_ALL_INPUT"
         ],
         "title": "TurnCoverage",
         "type": "string"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field expire_time: Optional[datetime] = None (alias 'expireTime')

An optional time after which, when using the resulting token, messages in Live API sessions will be rejected. (Gemini may preemptively close the session after this time.)

If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field live_ephemeral_parameters: Optional[LiveEphemeralParameters] = None (alias 'liveEphemeralParameters')

Configuration specific to Live API connections created using this token.

field lock_additional_fields: Optional[list[str]] = None (alias 'lockAdditionalFields')

Additional fields to lock in the effective LiveConnectParameters.

field new_session_expire_time: Optional[datetime] = None (alias 'newSessionExpireTime')

The time after which new Live API sessions using the token resulting from this request will be rejected.

If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future.

field uses: Optional[int] = None

The number of times the token can be used. If this value is zero then no limit is applied. Default is 1. Resuming a Live API session does not count as a use.

class genai.types.CreateAuthTokenConfigDict

Bases: TypedDict

Optional parameters.

expire_time: Optional[datetime]

An optional time after which, when using the resulting token, messages in Live API sessions will be rejected. (Gemini may preemptively close the session after this time.)

If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

live_ephemeral_parameters: Optional[LiveEphemeralParametersDict]

Configuration specific to Live API connections created using this token.

lock_additional_fields: Optional[list[str]]

Additional fields to lock in the effective LiveConnectParameters.

new_session_expire_time: Optional[datetime]

The time after which new Live API sessions using the token resulting from this request will be rejected.

If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future.

uses: Optional[int]

The number of times the token can be used. If this value is zero then no limit is applied. Default is 1. Resuming a Live API session does not count as a use.

pydantic model genai.types.CreateAuthTokenParameters

Bases: BaseModel

Config for auth_tokens.create parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CreateAuthTokenParameters",
   "description": "Config for auth_tokens.create parameters.",
   "type": "object",
   "properties": {
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/CreateAuthTokenConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional parameters for the request."
      }
   },
   "$defs": {
      "ActivityHandling": {
         "description": "The different ways of handling user activity.",
         "enum": [
            "ACTIVITY_HANDLING_UNSPECIFIED",
            "START_OF_ACTIVITY_INTERRUPTS",
            "NO_INTERRUPTION"
         ],
         "title": "ActivityHandling",
         "type": "string"
      },
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AudioTranscriptionConfig": {
         "additionalProperties": false,
         "description": "The audio transcription configuration in Setup.",
         "properties": {},
         "title": "AudioTranscriptionConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "AutomaticActivityDetection": {
         "additionalProperties": false,
         "description": "Configures automatic detection of activity.",
         "properties": {
            "disabled": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.",
               "title": "Disabled"
            },
            "startOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/StartSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely speech is to be detected."
            },
            "endOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EndSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely detected speech is ended."
            },
            "prefixPaddingMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.",
               "title": "Prefixpaddingms"
            },
            "silenceDurationMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.",
               "title": "Silencedurationms"
            }
         },
         "title": "AutomaticActivityDetection",
         "type": "object"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ContextWindowCompressionConfig": {
         "additionalProperties": false,
         "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
         "properties": {
            "triggerTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
               "title": "Triggertokens"
            },
            "slidingWindow": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SlidingWindow"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sliding window compression mechanism."
            }
         },
         "title": "ContextWindowCompressionConfig",
         "type": "object"
      },
      "CreateAuthTokenConfig": {
         "additionalProperties": false,
         "description": "Optional parameters.",
         "properties": {
            "httpOptions": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HttpOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Used to override HTTP request options."
            },
            "expireTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An optional time after which, when using the resulting token,\n      messages in Live API sessions will be rejected. (Gemini may\n      preemptively close the session after this time.)\n\n      If not set then this defaults to 30 minutes in the future. If set, this\n      value must be less than 20 hours in the future.",
               "title": "Expiretime"
            },
            "newSessionExpireTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time after which new Live API sessions using the token\n      resulting from this request will be rejected.\n\n      If not set this defaults to 60 seconds in the future. If set, this value\n      must be less than 20 hours in the future.",
               "title": "Newsessionexpiretime"
            },
            "uses": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The number of times the token can be used. If this value is zero\n      then no limit is applied. Default is 1. Resuming a Live API session does\n      not count as a use.",
               "title": "Uses"
            },
            "liveEphemeralParameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveEphemeralParameters"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configuration specific to Live API connections created using this token."
            },
            "lockAdditionalFields": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional fields to lock in the effective LiveConnectParameters.",
               "title": "Lockadditionalfields"
            }
         },
         "title": "CreateAuthTokenConfig",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EndSensitivity": {
         "description": "End of speech sensitivity.",
         "enum": [
            "END_SENSITIVITY_UNSPECIFIED",
            "END_SENSITIVITY_HIGH",
            "END_SENSITIVITY_LOW"
         ],
         "title": "EndSensitivity",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LiveConnectConfig": {
         "additionalProperties": false,
         "description": "Session config for the API connection.",
         "properties": {
            "httpOptions": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HttpOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Used to override HTTP request options."
            },
            "generationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The generation configuration for the session."
            },
            "responseModalities": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Modality"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The requested modalities of the response. Represents the set of\n      modalities that the model can return. Defaults to AUDIO if not specified.\n      ",
               "title": "Responsemodalities"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value that controls the degree of randomness in token selection.\n      Lower temperatures are good for prompts that require a less open-ended or\n      creative response, while higher temperatures can lead to more diverse or\n      creative results.\n      ",
               "title": "Temperature"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Tokens are selected from the most to least probable until the sum\n      of their probabilities equals this value. Use a lower value for less\n      random responses and a higher value for more random responses.\n      ",
               "title": "Topp"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "For each token selection step, the ``top_k`` tokens with the\n      highest probabilities are sampled. Then tokens are further filtered based\n      on ``top_p`` with the final token selected using temperature sampling. Use\n      a lower number for less random responses and a higher number for more\n      random responses.\n      ",
               "title": "Topk"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of tokens that can be generated in the response.\n      ",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If specified, the media resolution specified will be used.\n      "
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "When ``seed`` is fixed to a specific number, the model makes a best\n      effort to provide the same response for repeated requests. By default, a\n      random number is used.\n      ",
               "title": "Seed"
            },
            "speechConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SpeechConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The speech generation configuration.\n      "
            },
            "enableAffectiveDialog": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model will detect emotions and adapt its responses accordingly.",
               "title": "Enableaffectivedialog"
            },
            "systemInstruction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "#/$defs/File"
                           },
                           {
                              "$ref": "#/$defs/Part"
                           },
                           {
                              "type": "string"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "$ref": "#/$defs/File"
                  },
                  {
                     "$ref": "#/$defs/Part"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The user provided system instructions for the model.\n      Note: only text should be used in parts and content in each part will be\n      in a separate paragraph.",
               "title": "Systeminstruction"
            },
            "tools": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tool"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Tools` the model may use to generate the next response.\n\n      A `Tool` is a piece of code that enables the system to interact with\n      external systems to perform an action, or set of actions, outside of\n      knowledge and scope of the model.",
               "title": "Tools"
            },
            "sessionResumption": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SessionResumptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures session resumption mechanism.\n\nIf included the server will send SessionResumptionUpdate messages."
            },
            "inputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the input aligns with the input audio language.\n      "
            },
            "outputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the output aligns with the language code\n      specified for the output audio.\n      "
            },
            "realtimeInputConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RealtimeInputConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the realtime input behavior in BidiGenerateContent."
            },
            "contextWindowCompression": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContextWindowCompressionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures context window compression mechanism.\n\n      If included, server will compress context window to fit into given length."
            },
            "proactivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ProactivityConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the proactivity of the model. This allows the model to respond proactively to\n    the input and to ignore irrelevant input."
            }
         },
         "title": "LiveConnectConfig",
         "type": "object"
      },
      "LiveEphemeralParameters": {
         "additionalProperties": false,
         "description": "Config for LiveEphemeralParameters for Auth Token creation.",
         "properties": {
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "ID of the model to configure in the ephemeral token for Live API.\n      For a list of models, see `Gemini models\n      <https://ai.google.dev/gemini-api/docs/models>`.",
               "title": "Model"
            },
            "config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveConnectConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configuration specific to Live API connections created using this token."
            }
         },
         "title": "LiveEphemeralParameters",
         "type": "object"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Modality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "AUDIO"
         ],
         "title": "Modality",
         "type": "string"
      },
      "MultiSpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the multi-speaker setup.",
         "properties": {
            "speakerVoiceConfigs": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SpeakerVoiceConfig"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.",
               "title": "Speakervoiceconfigs"
            }
         },
         "title": "MultiSpeakerVoiceConfig",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "ProactivityConfig": {
         "additionalProperties": false,
         "description": "Config for proactivity features.",
         "properties": {
            "proactiveAudio": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
               "title": "Proactiveaudio"
            }
         },
         "title": "ProactivityConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "RealtimeInputConfig": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {
            "automaticActivityDetection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AutomaticActivityDetection"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals."
            },
            "activityHandling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityHandling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines what effect activity has."
            },
            "turnCoverage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TurnCoverage"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines which input is included in the user's turn."
            }
         },
         "title": "RealtimeInputConfig",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SessionResumptionConfig": {
         "additionalProperties": false,
         "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
         "properties": {
            "handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
               "title": "Handle"
            },
            "transparent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
               "title": "Transparent"
            }
         },
         "title": "SessionResumptionConfig",
         "type": "object"
      },
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "SpeechConfig": {
         "additionalProperties": false,
         "description": "The speech generation configuration.",
         "properties": {
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            },
            "multiSpeakerVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the multi-speaker setup.\n          It is mutually exclusive with the voice_config field.\n          "
            },
            "languageCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Language code (ISO 639. e.g. en-US) for the speech synthesization.\n      Only available for Live API.\n      ",
               "title": "Languagecode"
            }
         },
         "title": "SpeechConfig",
         "type": "object"
      },
      "StartSensitivity": {
         "description": "Start of speech sensitivity.",
         "enum": [
            "START_SENSITIVITY_UNSPECIFIED",
            "START_SENSITIVITY_HIGH",
            "START_SENSITIVITY_LOW"
         ],
         "title": "StartSensitivity",
         "type": "string"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "TurnCoverage": {
         "description": "Options about which input is included in the user's turn.",
         "enum": [
            "TURN_COVERAGE_UNSPECIFIED",
            "TURN_INCLUDES_ONLY_ACTIVITY",
            "TURN_INCLUDES_ALL_INPUT"
         ],
         "title": "TurnCoverage",
         "type": "string"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field config: Optional[CreateAuthTokenConfig] = None

Optional parameters for the request.

class genai.types.CreateAuthTokenParametersDict

Bases: TypedDict

Config for auth_tokens.create parameters.

config: Optional[CreateAuthTokenConfigDict]

Optional parameters for the request.

pydantic model genai.types.CreateBatchJobConfig

Bases: BaseModel

Config for optional parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CreateBatchJobConfig",
   "description": "Config for optional parameters.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The user-defined name of this BatchJob.\n      ",
         "title": "Displayname"
      },
      "dest": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "GCS or BigQuery URI prefix for the output predictions. Example:\n      \"gs://path/to/output/data\" or \"bq://projectId.bqDatasetId.bqTableId\".\n      ",
         "title": "Dest"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field dest: Optional[str] = None

GCS or BigQuery URI prefix for the output predictions. Example: “gs://path/to/output/data” or “bq://projectId.bqDatasetId.bqTableId”.

field display_name: Optional[str] = None (alias 'displayName')

The user-defined name of this BatchJob.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.CreateBatchJobConfigDict

Bases: TypedDict

Config for optional parameters.

dest: Optional[str]

GCS or BigQuery URI prefix for the output predictions. Example: “gs://path/to/output/data” or “bq://projectId.bqDatasetId.bqTableId”.

display_name: Optional[str]

The user-defined name of this BatchJob.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.CreateCachedContentConfig

Bases: BaseModel

Optional configuration for cached content creation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CreateCachedContentConfig",
   "description": "Optional configuration for cached content creation.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "ttl": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: \"3.5s\".",
         "title": "Ttl"
      },
      "expireTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.",
         "title": "Expiretime"
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The user-generated meaningful display name of the cached content.\n      ",
         "title": "Displayname"
      },
      "contents": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/Content"
                     },
                     {
                        "items": {
                           "anyOf": [
                              {
                                 "$ref": "#/$defs/File"
                              },
                              {
                                 "$ref": "#/$defs/Part"
                              },
                              {
                                 "type": "string"
                              }
                           ]
                        },
                        "type": "array"
                     },
                     {
                        "$ref": "#/$defs/File"
                     },
                     {
                        "$ref": "#/$defs/Part"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "$ref": "#/$defs/Content"
            },
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/File"
                     },
                     {
                        "$ref": "#/$defs/Part"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "$ref": "#/$defs/File"
            },
            {
               "$ref": "#/$defs/Part"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The content to cache.\n      ",
         "title": "Contents"
      },
      "systemInstruction": {
         "anyOf": [
            {
               "$ref": "#/$defs/Content"
            },
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/File"
                     },
                     {
                        "$ref": "#/$defs/Part"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "$ref": "#/$defs/File"
            },
            {
               "$ref": "#/$defs/Part"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Developer set system instruction.\n      ",
         "title": "Systeminstruction"
      },
      "tools": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Tool"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of `Tools` the model may use to generate the next response.\n      ",
         "title": "Tools"
      },
      "toolConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/ToolConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for the tools to use. This config is shared for all tools.\n      "
      },
      "kmsKeyName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The Cloud KMS resource identifier of the customer managed\n      encryption key used to protect a resource.\n      The key needs to be in the same region as where the compute resource is\n      created. See\n      https://cloud.google.com/vertex-ai/docs/general/cmek for more\n      details. If this is set, then all created CachedContent objects\n      will be encrypted with the provided encryption key.\n      Allowed formats: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\n      ",
         "title": "Kmskeyname"
      }
   },
   "$defs": {
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionCallingConfig": {
         "additionalProperties": false,
         "description": "Function calling config.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCallingConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function calling mode."
            },
            "allowedFunctionNames": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.",
               "title": "Allowedfunctionnames"
            }
         },
         "title": "FunctionCallingConfig",
         "type": "object"
      },
      "FunctionCallingConfigMode": {
         "description": "Config for the function calling config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "AUTO",
            "ANY",
            "NONE"
         ],
         "title": "FunctionCallingConfigMode",
         "type": "string"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LatLng": {
         "additionalProperties": false,
         "description": "An object that represents a latitude/longitude pair.\n\nThis is expressed as a pair of doubles to represent degrees latitude and\ndegrees longitude. Unless specified otherwise, this object must conform to the\n<a href=\"https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version\">\nWGS84 standard</a>. Values must be within normalized ranges.",
         "properties": {
            "latitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].",
               "title": "Latitude"
            },
            "longitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]",
               "title": "Longitude"
            }
         },
         "title": "LatLng",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "RetrievalConfig": {
         "additionalProperties": false,
         "description": "Retrieval config.",
         "properties": {
            "latLng": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LatLng"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The location of the user."
            }
         },
         "title": "RetrievalConfig",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "ToolConfig": {
         "additionalProperties": false,
         "description": "Tool config.\n\nThis config is shared for all tools provided in the request.",
         "properties": {
            "functionCallingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCallingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function calling config."
            },
            "retrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval config."
            }
         },
         "title": "ToolConfig",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field contents: Union[list[Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str]], Content, list[Union[File, Part, Image, str]], File, Part, Image, str, None] = None

The content to cache.

field display_name: Optional[str] = None (alias 'displayName')

The user-generated meaningful display name of the cached content.

field expire_time: Optional[datetime] = None (alias 'expireTime')

Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field kms_key_name: Optional[str] = None (alias 'kmsKeyName')

The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. The key needs to be in the same region as where the compute resource is created. See https://cloud.google.com/vertex-ai/docs/general/cmek for more details. If this is set, then all created CachedContent objects will be encrypted with the provided encryption key. Allowed formats: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}

field system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, None] = None (alias 'systemInstruction')

Developer set system instruction.

field tool_config: Optional[ToolConfig] = None (alias 'toolConfig')

Configuration for the tools to use. This config is shared for all tools.

field tools: Optional[list[Tool]] = None

A list of Tools the model may use to generate the next response.

field ttl: Optional[str] = None

The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by ‘s’. Example: “3.5s”.

class genai.types.CreateCachedContentConfigDict

Bases: TypedDict

Optional configuration for cached content creation.

contents: Union[list[Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, ContentDict]], Content, list[Union[File, Part, Image, str]], File, Part, Image, str, ContentDict, None]

The content to cache.

display_name: Optional[str]

The user-generated meaningful display name of the cached content.

expire_time: Optional[datetime]

01:23Z.

Type:

Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example

Type:

2014-10-02T15

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

kms_key_name: Optional[str]

The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. The key needs to be in the same region as where the compute resource is created. See https://cloud.google.com/vertex-ai/docs/general/cmek for more details. If this is set, then all created CachedContent objects will be encrypted with the provided encryption key. Allowed formats: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}

system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, ContentDict, None]

Developer set system instruction.

tool_config: Optional[ToolConfigDict]

Configuration for the tools to use. This config is shared for all tools.

tools: Optional[list[ToolDict]]

A list of Tools the model may use to generate the next response.

ttl: Optional[str]

“3.5s”.

Type:

The TTL for this resource. The expiration time is computed

Type:

now + TTL. It is a duration string, with up to nine fractional digits, terminated by ‘s’. Example

pydantic model genai.types.CreateFileConfig

Bases: BaseModel

Used to override the default configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CreateFileConfig",
   "description": "Used to override the default configuration.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.CreateFileConfigDict

Bases: TypedDict

Used to override the default configuration.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.CreateFileResponse

Bases: BaseModel

Response for the create file method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CreateFileResponse",
   "description": "Response for the create file method.",
   "type": "object",
   "properties": {
      "httpHeaders": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to retain the HTTP headers in the request",
         "title": "Httpheaders"
      }
   },
   "additionalProperties": false
}

Fields:
field http_headers: Optional[dict[str, str]] = None (alias 'httpHeaders')

Used to retain the HTTP headers in the request

class genai.types.CreateFileResponseDict

Bases: TypedDict

Response for the create file method.

http_headers: Optional[dict[str, str]]

Used to retain the HTTP headers in the request

pydantic model genai.types.CreateTuningJobConfig

Bases: BaseModel

Supervised fine-tuning job creation request - optional fields.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "CreateTuningJobConfig",
   "description": "Supervised fine-tuning job creation request - optional fields.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "validationDataset": {
         "anyOf": [
            {
               "$ref": "#/$defs/TuningValidationDataset"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."
      },
      "tunedModelDisplayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters.",
         "title": "Tunedmodeldisplayname"
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The description of the TuningJob",
         "title": "Description"
      },
      "epochCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of complete passes the model makes over the entire training dataset during training.",
         "title": "Epochcount"
      },
      "learningRateMultiplier": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Multiplier for adjusting the default learning rate.",
         "title": "Learningratemultiplier"
      },
      "exportLastCheckpointOnly": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT.",
         "title": "Exportlastcheckpointonly"
      },
      "adapterSize": {
         "anyOf": [
            {
               "$ref": "#/$defs/AdapterSize"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Adapter size for tuning."
      },
      "batchSize": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.",
         "title": "Batchsize"
      },
      "learningRate": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.",
         "title": "Learningrate"
      }
   },
   "$defs": {
      "AdapterSize": {
         "description": "Optional. Adapter size for tuning.",
         "enum": [
            "ADAPTER_SIZE_UNSPECIFIED",
            "ADAPTER_SIZE_ONE",
            "ADAPTER_SIZE_TWO",
            "ADAPTER_SIZE_FOUR",
            "ADAPTER_SIZE_EIGHT",
            "ADAPTER_SIZE_SIXTEEN",
            "ADAPTER_SIZE_THIRTY_TWO"
         ],
         "title": "AdapterSize",
         "type": "string"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "TuningValidationDataset": {
         "additionalProperties": false,
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "GCS URI of the file containing validation dataset in JSONL format.",
               "title": "Gcsuri"
            }
         },
         "title": "TuningValidationDataset",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field adapter_size: Optional[AdapterSize] = None (alias 'adapterSize')

Adapter size for tuning.

field batch_size: Optional[int] = None (alias 'batchSize')

The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.

field description: Optional[str] = None

The description of the TuningJob

field epoch_count: Optional[int] = None (alias 'epochCount')

Number of complete passes the model makes over the entire training dataset during training.

field export_last_checkpoint_only: Optional[bool] = None (alias 'exportLastCheckpointOnly')

If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field learning_rate: Optional[float] = None (alias 'learningRate')

The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.

field learning_rate_multiplier: Optional[float] = None (alias 'learningRateMultiplier')

Multiplier for adjusting the default learning rate.

field tuned_model_display_name: Optional[str] = None (alias 'tunedModelDisplayName')

The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters.

field validation_dataset: Optional[TuningValidationDataset] = None (alias 'validationDataset')

Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

class genai.types.CreateTuningJobConfigDict

Bases: TypedDict

Supervised fine-tuning job creation request - optional fields.

adapter_size: Optional[AdapterSize]

Adapter size for tuning.

batch_size: Optional[int]

The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.

description: Optional[str]

The description of the TuningJob

epoch_count: Optional[int]

Number of complete passes the model makes over the entire training dataset during training.

export_last_checkpoint_only: Optional[bool]

If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

learning_rate: Optional[float]

The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.

learning_rate_multiplier: Optional[float]

Multiplier for adjusting the default learning rate.

tuned_model_display_name: Optional[str]

The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters.

validation_dataset: Optional[TuningValidationDatasetDict]

Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

pydantic model genai.types.DatasetDistribution

Bases: BaseModel

Distribution computed over a tuning dataset.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DatasetDistribution",
   "description": "Distribution computed over a tuning dataset.",
   "type": "object",
   "properties": {
      "buckets": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/DatasetDistributionDistributionBucket"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Defines the histogram bucket.",
         "title": "Buckets"
      },
      "max": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The maximum of the population values.",
         "title": "Max"
      },
      "mean": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The arithmetic mean of the values in the population.",
         "title": "Mean"
      },
      "median": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The median of the values in the population.",
         "title": "Median"
      },
      "min": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The minimum of the population values.",
         "title": "Min"
      },
      "p5": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The 5th percentile of the values in the population.",
         "title": "P5"
      },
      "p95": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The 95th percentile of the values in the population.",
         "title": "P95"
      },
      "sum": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Sum of a given population of values.",
         "title": "Sum"
      }
   },
   "$defs": {
      "DatasetDistributionDistributionBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "DatasetDistributionDistributionBucket",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field buckets: Optional[list[DatasetDistributionDistributionBucket]] = None

Output only. Defines the histogram bucket.

field max: Optional[float] = None

Output only. The maximum of the population values.

field mean: Optional[float] = None

Output only. The arithmetic mean of the values in the population.

field median: Optional[float] = None

Output only. The median of the values in the population.

field min: Optional[float] = None

Output only. The minimum of the population values.

field p5: Optional[float] = None

Output only. The 5th percentile of the values in the population.

field p95: Optional[float] = None

Output only. The 95th percentile of the values in the population.

field sum: Optional[float] = None

Output only. Sum of a given population of values.

class genai.types.DatasetDistributionDict

Bases: TypedDict

Distribution computed over a tuning dataset.

buckets: Optional[list[DatasetDistributionDistributionBucketDict]]

Output only. Defines the histogram bucket.

max: Optional[float]

Output only. The maximum of the population values.

mean: Optional[float]

Output only. The arithmetic mean of the values in the population.

median: Optional[float]

Output only. The median of the values in the population.

min: Optional[float]

Output only. The minimum of the population values.

p5: Optional[float]

Output only. The 5th percentile of the values in the population.

p95: Optional[float]

Output only. The 95th percentile of the values in the population.

sum: Optional[float]

Output only. Sum of a given population of values.

pydantic model genai.types.DatasetDistributionDistributionBucket

Bases: BaseModel

Dataset bucket used to create a histogram for the distribution given a population of values.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DatasetDistributionDistributionBucket",
   "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
   "type": "object",
   "properties": {
      "count": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of values in the bucket.",
         "title": "Count"
      },
      "left": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Left bound of the bucket.",
         "title": "Left"
      },
      "right": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Right bound of the bucket.",
         "title": "Right"
      }
   },
   "additionalProperties": false
}

Fields:
field count: Optional[int] = None

Output only. Number of values in the bucket.

field left: Optional[float] = None

Output only. Left bound of the bucket.

field right: Optional[float] = None

Output only. Right bound of the bucket.

class genai.types.DatasetDistributionDistributionBucketDict

Bases: TypedDict

Dataset bucket used to create a histogram for the distribution given a population of values.

count: Optional[int]

Output only. Number of values in the bucket.

left: Optional[float]

Output only. Left bound of the bucket.

right: Optional[float]

Output only. Right bound of the bucket.

pydantic model genai.types.DatasetStats

Bases: BaseModel

Statistics computed over a tuning dataset.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DatasetStats",
   "description": "Statistics computed over a tuning dataset.",
   "type": "object",
   "properties": {
      "totalBillableCharacterCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of billable characters in the tuning dataset.",
         "title": "Totalbillablecharactercount"
      },
      "totalTuningCharacterCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of tuning characters in the tuning dataset.",
         "title": "Totaltuningcharactercount"
      },
      "tuningDatasetExampleCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of examples in the tuning dataset.",
         "title": "Tuningdatasetexamplecount"
      },
      "tuningStepCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of tuning steps for this Tuning Job.",
         "title": "Tuningstepcount"
      },
      "userDatasetExamples": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Content"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Sample user messages in the training dataset uri.",
         "title": "Userdatasetexamples"
      },
      "userInputTokenDistribution": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetDistribution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Dataset distributions for the user input tokens."
      },
      "userMessagePerExampleDistribution": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetDistribution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Dataset distributions for the messages per example."
      },
      "userOutputTokenDistribution": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetDistribution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Dataset distributions for the user output tokens."
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DatasetDistribution": {
         "additionalProperties": false,
         "description": "Distribution computed over a tuning dataset.",
         "properties": {
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/DatasetDistributionDistributionBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "DatasetDistribution",
         "type": "object"
      },
      "DatasetDistributionDistributionBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "DatasetDistributionDistributionBucket",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field total_billable_character_count: Optional[int] = None (alias 'totalBillableCharacterCount')

Output only. Number of billable characters in the tuning dataset.

field total_tuning_character_count: Optional[int] = None (alias 'totalTuningCharacterCount')

Output only. Number of tuning characters in the tuning dataset.

field tuning_dataset_example_count: Optional[int] = None (alias 'tuningDatasetExampleCount')

Output only. Number of examples in the tuning dataset.

field tuning_step_count: Optional[int] = None (alias 'tuningStepCount')

Output only. Number of tuning steps for this Tuning Job.

field user_dataset_examples: Optional[list[Content]] = None (alias 'userDatasetExamples')

Output only. Sample user messages in the training dataset uri.

field user_input_token_distribution: Optional[DatasetDistribution] = None (alias 'userInputTokenDistribution')

Output only. Dataset distributions for the user input tokens.

field user_message_per_example_distribution: Optional[DatasetDistribution] = None (alias 'userMessagePerExampleDistribution')

Output only. Dataset distributions for the messages per example.

field user_output_token_distribution: Optional[DatasetDistribution] = None (alias 'userOutputTokenDistribution')

Output only. Dataset distributions for the user output tokens.

class genai.types.DatasetStatsDict

Bases: TypedDict

Statistics computed over a tuning dataset.

total_billable_character_count: Optional[int]

Output only. Number of billable characters in the tuning dataset.

total_tuning_character_count: Optional[int]

Output only. Number of tuning characters in the tuning dataset.

tuning_dataset_example_count: Optional[int]

Output only. Number of examples in the tuning dataset.

tuning_step_count: Optional[int]

Output only. Number of tuning steps for this Tuning Job.

user_dataset_examples: Optional[list[ContentDict]]

Output only. Sample user messages in the training dataset uri.

user_input_token_distribution: Optional[DatasetDistributionDict]

Output only. Dataset distributions for the user input tokens.

user_message_per_example_distribution: Optional[DatasetDistributionDict]

Output only. Dataset distributions for the messages per example.

user_output_token_distribution: Optional[DatasetDistributionDict]

Output only. Dataset distributions for the user output tokens.

pydantic model genai.types.DeleteBatchJobConfig

Bases: BaseModel

Optional parameters for models.get method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteBatchJobConfig",
   "description": "Optional parameters for models.get method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.DeleteBatchJobConfigDict

Bases: TypedDict

Optional parameters for models.get method.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.DeleteCachedContentConfig

Bases: BaseModel

Optional parameters for caches.delete method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteCachedContentConfig",
   "description": "Optional parameters for caches.delete method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.DeleteCachedContentConfigDict

Bases: TypedDict

Optional parameters for caches.delete method.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.DeleteCachedContentResponse

Bases: BaseModel

Empty response for caches.delete method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteCachedContentResponse",
   "description": "Empty response for caches.delete method.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.DeleteCachedContentResponseDict

Bases: TypedDict

Empty response for caches.delete method.

pydantic model genai.types.DeleteFileConfig

Bases: BaseModel

Used to override the default configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteFileConfig",
   "description": "Used to override the default configuration.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.DeleteFileConfigDict

Bases: TypedDict

Used to override the default configuration.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.DeleteFileResponse

Bases: BaseModel

Response for the delete file method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteFileResponse",
   "description": "Response for the delete file method.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.DeleteFileResponseDict

Bases: TypedDict

Response for the delete file method.

pydantic model genai.types.DeleteModelConfig

Bases: BaseModel

Configuration for deleting a tuned model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteModelConfig",
   "description": "Configuration for deleting a tuned model.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.DeleteModelConfigDict

Bases: TypedDict

Configuration for deleting a tuned model.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.DeleteModelResponse

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteModelResponse",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.DeleteModelResponseDict

Bases: TypedDict

pydantic model genai.types.DeleteResourceJob

Bases: BaseModel

The return value of delete operation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DeleteResourceJob",
   "description": "The return value of delete operation.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Name"
      },
      "done": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Done"
      },
      "error": {
         "anyOf": [
            {
               "$ref": "#/$defs/JobError"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": ""
      }
   },
   "$defs": {
      "JobError": {
         "additionalProperties": false,
         "description": "Job error.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code.",
               "title": "Code"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field.",
               "title": "Message"
            }
         },
         "title": "JobError",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field done: Optional[bool] = None
field error: Optional[JobError] = None
field name: Optional[str] = None
class genai.types.DeleteResourceJobDict

Bases: TypedDict

The return value of delete operation.

done: Optional[bool]
error: Optional[JobErrorDict]
name: Optional[str]
pydantic model genai.types.DistillationDataStats

Bases: BaseModel

Statistics computed for datasets used for distillation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DistillationDataStats",
   "description": "Statistics computed for datasets used for distillation.",
   "type": "object",
   "properties": {
      "trainingDatasetStats": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetStats"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Statistics computed for the training dataset."
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DatasetDistribution": {
         "additionalProperties": false,
         "description": "Distribution computed over a tuning dataset.",
         "properties": {
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/DatasetDistributionDistributionBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "DatasetDistribution",
         "type": "object"
      },
      "DatasetDistributionDistributionBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "DatasetDistributionDistributionBucket",
         "type": "object"
      },
      "DatasetStats": {
         "additionalProperties": false,
         "description": "Statistics computed over a tuning dataset.",
         "properties": {
            "totalBillableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable characters in the tuning dataset.",
               "title": "Totalbillablecharactercount"
            },
            "totalTuningCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning characters in the tuning dataset.",
               "title": "Totaltuningcharactercount"
            },
            "tuningDatasetExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of examples in the tuning dataset.",
               "title": "Tuningdatasetexamplecount"
            },
            "tuningStepCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning steps for this Tuning Job.",
               "title": "Tuningstepcount"
            },
            "userDatasetExamples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sample user messages in the training dataset uri.",
               "title": "Userdatasetexamples"
            },
            "userInputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user input tokens."
            },
            "userMessagePerExampleDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the messages per example."
            },
            "userOutputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user output tokens."
            }
         },
         "title": "DatasetStats",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field training_dataset_stats: Optional[DatasetStats] = None (alias 'trainingDatasetStats')

Output only. Statistics computed for the training dataset.

class genai.types.DistillationDataStatsDict

Bases: TypedDict

Statistics computed for datasets used for distillation.

training_dataset_stats: Optional[DatasetStatsDict]

Output only. Statistics computed for the training dataset.

pydantic model genai.types.DistillationHyperParameters

Bases: BaseModel

Hyperparameters for Distillation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DistillationHyperParameters",
   "description": "Hyperparameters for Distillation.",
   "type": "object",
   "properties": {
      "adapterSize": {
         "anyOf": [
            {
               "$ref": "#/$defs/AdapterSize"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Adapter size for distillation."
      },
      "epochCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
         "title": "Epochcount"
      },
      "learningRateMultiplier": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Multiplier for adjusting the default learning rate.",
         "title": "Learningratemultiplier"
      }
   },
   "$defs": {
      "AdapterSize": {
         "description": "Optional. Adapter size for tuning.",
         "enum": [
            "ADAPTER_SIZE_UNSPECIFIED",
            "ADAPTER_SIZE_ONE",
            "ADAPTER_SIZE_TWO",
            "ADAPTER_SIZE_FOUR",
            "ADAPTER_SIZE_EIGHT",
            "ADAPTER_SIZE_SIXTEEN",
            "ADAPTER_SIZE_THIRTY_TWO"
         ],
         "title": "AdapterSize",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field adapter_size: Optional[AdapterSize] = None (alias 'adapterSize')

Optional. Adapter size for distillation.

field epoch_count: Optional[int] = None (alias 'epochCount')

Optional. Number of complete passes the model makes over the entire training dataset during training.

field learning_rate_multiplier: Optional[float] = None (alias 'learningRateMultiplier')

Optional. Multiplier for adjusting the default learning rate.

class genai.types.DistillationHyperParametersDict

Bases: TypedDict

Hyperparameters for Distillation.

adapter_size: Optional[AdapterSize]

Optional. Adapter size for distillation.

epoch_count: Optional[int]

Optional. Number of complete passes the model makes over the entire training dataset during training.

learning_rate_multiplier: Optional[float]

Optional. Multiplier for adjusting the default learning rate.

pydantic model genai.types.DistillationSpec

Bases: BaseModel

Tuning Spec for Distillation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DistillationSpec",
   "description": "Tuning Spec for Distillation.",
   "type": "object",
   "properties": {
      "baseTeacherModel": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The base teacher model that is being distilled, e.g., \"gemini-1.0-pro-002\".",
         "title": "Baseteachermodel"
      },
      "hyperParameters": {
         "anyOf": [
            {
               "$ref": "#/$defs/DistillationHyperParameters"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Hyperparameters for Distillation."
      },
      "pipelineRootDirectory": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts.",
         "title": "Pipelinerootdirectory"
      },
      "studentModel": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The student model that is being tuned, e.g., \"google/gemma-2b-1.1-it\".",
         "title": "Studentmodel"
      },
      "trainingDatasetUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
         "title": "Trainingdataseturi"
      },
      "tunedTeacherModelSource": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`.",
         "title": "Tunedteachermodelsource"
      },
      "validationDatasetUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
         "title": "Validationdataseturi"
      }
   },
   "$defs": {
      "AdapterSize": {
         "description": "Optional. Adapter size for tuning.",
         "enum": [
            "ADAPTER_SIZE_UNSPECIFIED",
            "ADAPTER_SIZE_ONE",
            "ADAPTER_SIZE_TWO",
            "ADAPTER_SIZE_FOUR",
            "ADAPTER_SIZE_EIGHT",
            "ADAPTER_SIZE_SIXTEEN",
            "ADAPTER_SIZE_THIRTY_TWO"
         ],
         "title": "AdapterSize",
         "type": "string"
      },
      "DistillationHyperParameters": {
         "additionalProperties": false,
         "description": "Hyperparameters for Distillation.",
         "properties": {
            "adapterSize": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AdapterSize"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Adapter size for distillation."
            },
            "epochCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
               "title": "Epochcount"
            },
            "learningRateMultiplier": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Multiplier for adjusting the default learning rate.",
               "title": "Learningratemultiplier"
            }
         },
         "title": "DistillationHyperParameters",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field base_teacher_model: Optional[str] = None (alias 'baseTeacherModel')

The base teacher model that is being distilled, e.g., “gemini-1.0-pro-002”.

field hyper_parameters: Optional[DistillationHyperParameters] = None (alias 'hyperParameters')

Optional. Hyperparameters for Distillation.

field pipeline_root_directory: Optional[str] = None (alias 'pipelineRootDirectory')

Required. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts.

field student_model: Optional[str] = None (alias 'studentModel')

The student model that is being tuned, e.g., “google/gemma-2b-1.1-it”.

field training_dataset_uri: Optional[str] = None (alias 'trainingDatasetUri')

Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

field tuned_teacher_model_source: Optional[str] = None (alias 'tunedTeacherModelSource')

The resource name of the Tuned teacher model. Format: projects/{project}/locations/{location}/models/{model}.

field validation_dataset_uri: Optional[str] = None (alias 'validationDatasetUri')

Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.

class genai.types.DistillationSpecDict

Bases: TypedDict

Tuning Spec for Distillation.

base_teacher_model: Optional[str]

The base teacher model that is being distilled, e.g., “gemini-1.0-pro-002”.

hyper_parameters: Optional[DistillationHyperParametersDict]

Optional. Hyperparameters for Distillation.

pipeline_root_directory: Optional[str]

Required. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts.

student_model: Optional[str]

The student model that is being tuned, e.g., “google/gemma-2b-1.1-it”.

training_dataset_uri: Optional[str]

Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

tuned_teacher_model_source: Optional[str]

projects/{project}/locations/{location}/models/{model}.

Type:

The resource name of the Tuned teacher model. Format

validation_dataset_uri: Optional[str]

Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.

pydantic model genai.types.DownloadFileConfig

Bases: BaseModel

Used to override the default configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DownloadFileConfig",
   "description": "Used to override the default configuration.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.DownloadFileConfigDict

Bases: TypedDict

Used to override the default configuration.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.DynamicRetrievalConfig

Bases: BaseModel

Describes the options to customize dynamic retrieval.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "DynamicRetrievalConfig",
   "description": "Describes the options to customize dynamic retrieval.",
   "type": "object",
   "properties": {
      "mode": {
         "anyOf": [
            {
               "$ref": "#/$defs/DynamicRetrievalConfigMode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The mode of the predictor to be used in dynamic retrieval."
      },
      "dynamicThreshold": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
         "title": "Dynamicthreshold"
      }
   },
   "$defs": {
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field dynamic_threshold: Optional[float] = None (alias 'dynamicThreshold')

Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.

field mode: Optional[DynamicRetrievalConfigMode] = None

The mode of the predictor to be used in dynamic retrieval.

class genai.types.DynamicRetrievalConfigDict

Bases: TypedDict

Describes the options to customize dynamic retrieval.

dynamic_threshold: Optional[float]

Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.

mode: Optional[DynamicRetrievalConfigMode]

The mode of the predictor to be used in dynamic retrieval.

class genai.types.DynamicRetrievalConfigMode(*values)

Bases: CaseInSensitiveEnum

Config for the dynamic retrieval config mode.

MODE_DYNAMIC = 'MODE_DYNAMIC'

Run retrieval only when system decides it is necessary.

MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'

Always trigger retrieval.

pydantic model genai.types.EditImageConfig

Bases: BaseModel

Configuration for editing an image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EditImageConfig",
   "description": "Configuration for editing an image.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "outputGcsUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cloud Storage URI used to store the generated images.\n      ",
         "title": "Outputgcsuri"
      },
      "negativePrompt": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of what to discourage in the generated images.\n      ",
         "title": "Negativeprompt"
      },
      "numberOfImages": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of images to generate.\n      ",
         "title": "Numberofimages"
      },
      "aspectRatio": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Aspect ratio of the generated images.\n      ",
         "title": "Aspectratio"
      },
      "guidanceScale": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls how much the model adheres to the text prompt. Large\n      values increase output and prompt alignment, but may compromise image\n      quality.\n      ",
         "title": "Guidancescale"
      },
      "seed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Random seed for image generation. This is not available when\n      ``add_watermark`` is set to true.\n      ",
         "title": "Seed"
      },
      "safetyFilterLevel": {
         "anyOf": [
            {
               "$ref": "#/$defs/SafetyFilterLevel"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Filter level for safety filtering.\n      "
      },
      "personGeneration": {
         "anyOf": [
            {
               "$ref": "#/$defs/PersonGeneration"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Allows generation of people by the model.\n      "
      },
      "includeSafetyAttributes": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to report the safety scores of each generated image and\n      the positive prompt in the response.\n      ",
         "title": "Includesafetyattributes"
      },
      "includeRaiReason": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to include the Responsible AI filter reason if the image\n      is filtered out of the response.\n      ",
         "title": "Includeraireason"
      },
      "language": {
         "anyOf": [
            {
               "$ref": "#/$defs/ImagePromptLanguage"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Language of the text in the prompt.\n      "
      },
      "outputMimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "MIME type of the generated image.\n      ",
         "title": "Outputmimetype"
      },
      "outputCompressionQuality": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Compression quality of the generated image (for ``image/jpeg``\n      only).\n      ",
         "title": "Outputcompressionquality"
      },
      "editMode": {
         "anyOf": [
            {
               "$ref": "#/$defs/EditMode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Describes the editing mode for the request."
      },
      "baseSteps": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The number of sampling steps. A higher value has better image\n      quality, while a lower value has better latency.",
         "title": "Basesteps"
      }
   },
   "$defs": {
      "EditMode": {
         "description": "Enum representing the Imagen 3 Edit mode.",
         "enum": [
            "EDIT_MODE_DEFAULT",
            "EDIT_MODE_INPAINT_REMOVAL",
            "EDIT_MODE_INPAINT_INSERTION",
            "EDIT_MODE_OUTPAINT",
            "EDIT_MODE_CONTROLLED_EDITING",
            "EDIT_MODE_STYLE",
            "EDIT_MODE_BGSWAP",
            "EDIT_MODE_PRODUCT_IMAGE"
         ],
         "title": "EditMode",
         "type": "string"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "ImagePromptLanguage": {
         "description": "Enum that specifies the language of the text in the prompt.",
         "enum": [
            "auto",
            "en",
            "ja",
            "ko",
            "hi"
         ],
         "title": "ImagePromptLanguage",
         "type": "string"
      },
      "PersonGeneration": {
         "description": "Enum that controls the generation of people.",
         "enum": [
            "DONT_ALLOW",
            "ALLOW_ADULT",
            "ALLOW_ALL"
         ],
         "title": "PersonGeneration",
         "type": "string"
      },
      "SafetyFilterLevel": {
         "description": "Enum that controls the safety filter level for objectionable content.",
         "enum": [
            "BLOCK_LOW_AND_ABOVE",
            "BLOCK_MEDIUM_AND_ABOVE",
            "BLOCK_ONLY_HIGH",
            "BLOCK_NONE"
         ],
         "title": "SafetyFilterLevel",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field aspect_ratio: Optional[str] = None (alias 'aspectRatio')

Aspect ratio of the generated images.

field base_steps: Optional[int] = None (alias 'baseSteps')

The number of sampling steps. A higher value has better image quality, while a lower value has better latency.

field edit_mode: Optional[EditMode] = None (alias 'editMode')

Describes the editing mode for the request.

field guidance_scale: Optional[float] = None (alias 'guidanceScale')

Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field include_rai_reason: Optional[bool] = None (alias 'includeRaiReason')

Whether to include the Responsible AI filter reason if the image is filtered out of the response.

field include_safety_attributes: Optional[bool] = None (alias 'includeSafetyAttributes')

Whether to report the safety scores of each generated image and the positive prompt in the response.

field language: Optional[ImagePromptLanguage] = None

Language of the text in the prompt.

field negative_prompt: Optional[str] = None (alias 'negativePrompt')

Description of what to discourage in the generated images.

field number_of_images: Optional[int] = None (alias 'numberOfImages')

Number of images to generate.

field output_compression_quality: Optional[int] = None (alias 'outputCompressionQuality')

Compression quality of the generated image (for image/jpeg only).

field output_gcs_uri: Optional[str] = None (alias 'outputGcsUri')

Cloud Storage URI used to store the generated images.

field output_mime_type: Optional[str] = None (alias 'outputMimeType')

MIME type of the generated image.

field person_generation: Optional[PersonGeneration] = None (alias 'personGeneration')

Allows generation of people by the model.

field safety_filter_level: Optional[SafetyFilterLevel] = None (alias 'safetyFilterLevel')

Filter level for safety filtering.

field seed: Optional[int] = None

Random seed for image generation. This is not available when add_watermark is set to true.

class genai.types.EditImageConfigDict

Bases: TypedDict

Configuration for editing an image.

aspect_ratio: Optional[str]

Aspect ratio of the generated images.

base_steps: Optional[int]

The number of sampling steps. A higher value has better image quality, while a lower value has better latency.

edit_mode: Optional[EditMode]

Describes the editing mode for the request.

guidance_scale: Optional[float]

Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

include_rai_reason: Optional[bool]

Whether to include the Responsible AI filter reason if the image is filtered out of the response.

include_safety_attributes: Optional[bool]

Whether to report the safety scores of each generated image and the positive prompt in the response.

language: Optional[ImagePromptLanguage]

Language of the text in the prompt.

negative_prompt: Optional[str]

Description of what to discourage in the generated images.

number_of_images: Optional[int]

Number of images to generate.

output_compression_quality: Optional[int]

Compression quality of the generated image (for image/jpeg only).

output_gcs_uri: Optional[str]

Cloud Storage URI used to store the generated images.

output_mime_type: Optional[str]

MIME type of the generated image.

person_generation: Optional[PersonGeneration]

Allows generation of people by the model.

safety_filter_level: Optional[SafetyFilterLevel]

Filter level for safety filtering.

seed: Optional[int]

Random seed for image generation. This is not available when add_watermark is set to true.

pydantic model genai.types.EditImageResponse

Bases: BaseModel

Response for the request to edit an image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EditImageResponse",
   "description": "Response for the request to edit an image.",
   "type": "object",
   "properties": {
      "generatedImages": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/GeneratedImage"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Generated images.",
         "title": "Generatedimages"
      }
   },
   "$defs": {
      "GeneratedImage": {
         "additionalProperties": false,
         "description": "An output image.",
         "properties": {
            "image": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Image"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The output image data.\n      "
            },
            "raiFilteredReason": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Responsible AI filter reason if the image is filtered out of the\n      response.\n      ",
               "title": "Raifilteredreason"
            },
            "safetyAttributes": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SafetyAttributes"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Safety attributes of the image. Lists of RAI categories and their\n      scores of each content.\n      "
            },
            "enhancedPrompt": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The rewritten prompt used for the image generation if the prompt\n      enhancer is enabled.\n      ",
               "title": "Enhancedprompt"
            }
         },
         "title": "GeneratedImage",
         "type": "object"
      },
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "SafetyAttributes": {
         "additionalProperties": false,
         "description": "Safety attributes of a GeneratedImage or the user-provided prompt.",
         "properties": {
            "categories": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of RAI categories.\n      ",
               "title": "Categories"
            },
            "scores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of scores of each categories.\n      ",
               "title": "Scores"
            },
            "contentType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Internal use only.\n      ",
               "title": "Contenttype"
            }
         },
         "title": "SafetyAttributes",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field generated_images: Optional[list[GeneratedImage]] = None (alias 'generatedImages')

Generated images.

class genai.types.EditImageResponseDict

Bases: TypedDict

Response for the request to edit an image.

generated_images: Optional[list[GeneratedImageDict]]

Generated images.

class genai.types.EditMode(*values)

Bases: CaseInSensitiveEnum

Enum representing the Imagen 3 Edit mode.

EDIT_MODE_BGSWAP = 'EDIT_MODE_BGSWAP'
EDIT_MODE_CONTROLLED_EDITING = 'EDIT_MODE_CONTROLLED_EDITING'
EDIT_MODE_DEFAULT = 'EDIT_MODE_DEFAULT'
EDIT_MODE_INPAINT_INSERTION = 'EDIT_MODE_INPAINT_INSERTION'
EDIT_MODE_INPAINT_REMOVAL = 'EDIT_MODE_INPAINT_REMOVAL'
EDIT_MODE_OUTPAINT = 'EDIT_MODE_OUTPAINT'
EDIT_MODE_PRODUCT_IMAGE = 'EDIT_MODE_PRODUCT_IMAGE'
EDIT_MODE_STYLE = 'EDIT_MODE_STYLE'
pydantic model genai.types.EmbedContentConfig

Bases: BaseModel

Optional parameters for the embed_content method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EmbedContentConfig",
   "description": "Optional parameters for the embed_content method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "taskType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Type of task for which the embedding will be used.\n      ",
         "title": "Tasktype"
      },
      "title": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Title for the text. Only applicable when TaskType is\n      `RETRIEVAL_DOCUMENT`.\n      ",
         "title": "Title"
      },
      "outputDimensionality": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Reduced dimension for the output embedding. If set,\n      excessive values in the output embedding are truncated from the end.\n      Supported by newer models since 2024 only. You cannot set this value if\n      using the earlier model (`models/embedding-001`).\n      ",
         "title": "Outputdimensionality"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Vertex API only. The MIME type of the input.\n      ",
         "title": "Mimetype"
      },
      "autoTruncate": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Vertex API only. Whether to silently truncate inputs longer than\n      the max sequence length. If this option is set to false, oversized inputs\n      will lead to an INVALID_ARGUMENT error, similar to other text APIs.\n      ",
         "title": "Autotruncate"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field auto_truncate: Optional[bool] = None (alias 'autoTruncate')

Vertex API only. Whether to silently truncate inputs longer than the max sequence length. If this option is set to false, oversized inputs will lead to an INVALID_ARGUMENT error, similar to other text APIs.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field mime_type: Optional[str] = None (alias 'mimeType')

Vertex API only. The MIME type of the input.

field output_dimensionality: Optional[int] = None (alias 'outputDimensionality')

Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (models/embedding-001).

field task_type: Optional[str] = None (alias 'taskType')

Type of task for which the embedding will be used.

field title: Optional[str] = None

Title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT.

class genai.types.EmbedContentConfigDict

Bases: TypedDict

Optional parameters for the embed_content method.

auto_truncate: Optional[bool]

Vertex API only. Whether to silently truncate inputs longer than the max sequence length. If this option is set to false, oversized inputs will lead to an INVALID_ARGUMENT error, similar to other text APIs.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

mime_type: Optional[str]

Vertex API only. The MIME type of the input.

output_dimensionality: Optional[int]

Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (models/embedding-001).

task_type: Optional[str]

Type of task for which the embedding will be used.

title: Optional[str]

Title for the text. Only applicable when TaskType is RETRIEVAL_DOCUMENT.

pydantic model genai.types.EmbedContentMetadata

Bases: BaseModel

Request-level metadata for the Vertex Embed Content API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EmbedContentMetadata",
   "description": "Request-level metadata for the Vertex Embed Content API.",
   "type": "object",
   "properties": {
      "billableCharacterCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Vertex API only. The total number of billable characters included\n      in the request.\n      ",
         "title": "Billablecharactercount"
      }
   },
   "additionalProperties": false
}

Fields:
field billable_character_count: Optional[int] = None (alias 'billableCharacterCount')

Vertex API only. The total number of billable characters included in the request.

class genai.types.EmbedContentMetadataDict

Bases: TypedDict

Request-level metadata for the Vertex Embed Content API.

billable_character_count: Optional[int]

Vertex API only. The total number of billable characters included in the request.

pydantic model genai.types.EmbedContentResponse

Bases: BaseModel

Response for the embed_content method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EmbedContentResponse",
   "description": "Response for the embed_content method.",
   "type": "object",
   "properties": {
      "embeddings": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ContentEmbedding"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The embeddings for each request, in the same order as provided in\n      the batch request.\n      ",
         "title": "Embeddings"
      },
      "metadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/EmbedContentMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Vertex API only. Metadata about the request.\n      "
      }
   },
   "$defs": {
      "ContentEmbedding": {
         "additionalProperties": false,
         "description": "The embedding generated from an input content.",
         "properties": {
            "values": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of floats representing an embedding.\n      ",
               "title": "Values"
            },
            "statistics": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContentEmbeddingStatistics"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Vertex API only. Statistics of the input text associated with this\n      embedding.\n      "
            }
         },
         "title": "ContentEmbedding",
         "type": "object"
      },
      "ContentEmbeddingStatistics": {
         "additionalProperties": false,
         "description": "Statistics of the input text associated with the result of content embedding.",
         "properties": {
            "truncated": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Vertex API only. If the input text was truncated due to having\n      a length longer than the allowed maximum input.\n      ",
               "title": "Truncated"
            },
            "tokenCount": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Vertex API only. Number of tokens of the input text.\n      ",
               "title": "Tokencount"
            }
         },
         "title": "ContentEmbeddingStatistics",
         "type": "object"
      },
      "EmbedContentMetadata": {
         "additionalProperties": false,
         "description": "Request-level metadata for the Vertex Embed Content API.",
         "properties": {
            "billableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Vertex API only. The total number of billable characters included\n      in the request.\n      ",
               "title": "Billablecharactercount"
            }
         },
         "title": "EmbedContentMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field embeddings: Optional[list[ContentEmbedding]] = None

The embeddings for each request, in the same order as provided in the batch request.

field metadata: Optional[EmbedContentMetadata] = None

Vertex API only. Metadata about the request.

class genai.types.EmbedContentResponseDict

Bases: TypedDict

Response for the embed_content method.

embeddings: Optional[list[ContentEmbeddingDict]]

The embeddings for each request, in the same order as provided in the batch request.

metadata: Optional[EmbedContentMetadataDict]

Vertex API only. Metadata about the request.

pydantic model genai.types.EncryptionSpec

Bases: BaseModel

Represents a customer-managed encryption key spec that can be applied to a top-level resource.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EncryptionSpec",
   "description": "Represents a customer-managed encryption key spec that can be applied to a top-level resource.",
   "type": "object",
   "properties": {
      "kmsKeyName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.",
         "title": "Kmskeyname"
      }
   },
   "additionalProperties": false
}

Fields:
field kms_key_name: Optional[str] = None (alias 'kmsKeyName')

Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key. The key needs to be in the same region as where the compute resource is created.

class genai.types.EncryptionSpecDict

Bases: TypedDict

Represents a customer-managed encryption key spec that can be applied to a top-level resource.

kms_key_name: Optional[str]

projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key. The key needs to be in the same region as where the compute resource is created.

Type:

Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form

class genai.types.EndSensitivity(*values)

Bases: CaseInSensitiveEnum

End of speech sensitivity.

END_SENSITIVITY_HIGH = 'END_SENSITIVITY_HIGH'

Automatic detection ends speech more often.

END_SENSITIVITY_LOW = 'END_SENSITIVITY_LOW'

Automatic detection ends speech less often.

END_SENSITIVITY_UNSPECIFIED = 'END_SENSITIVITY_UNSPECIFIED'

The default is END_SENSITIVITY_LOW.

pydantic model genai.types.Endpoint

Bases: BaseModel

An endpoint where you deploy models.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Endpoint",
   "description": "An endpoint where you deploy models.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Resource name of the endpoint.",
         "title": "Name"
      },
      "deployedModelId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "ID of the model that's deployed to the endpoint.",
         "title": "Deployedmodelid"
      }
   },
   "additionalProperties": false
}

Fields:
field deployed_model_id: Optional[str] = None (alias 'deployedModelId')

ID of the model that’s deployed to the endpoint.

field name: Optional[str] = None

Resource name of the endpoint.

class genai.types.EndpointDict

Bases: TypedDict

An endpoint where you deploy models.

deployed_model_id: Optional[str]

ID of the model that’s deployed to the endpoint.

name: Optional[str]

Resource name of the endpoint.

pydantic model genai.types.EnterpriseWebSearch

Bases: BaseModel

Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "EnterpriseWebSearch",
   "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.EnterpriseWebSearchDict

Bases: TypedDict

Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.

pydantic model genai.types.ExecutableCode

Bases: BaseModel

Code generated by the model that is meant to be executed, and the result returned to the model.

Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE].

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ExecutableCode",
   "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
   "type": "object",
   "properties": {
      "code": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The code to be executed.",
         "title": "Code"
      },
      "language": {
         "anyOf": [
            {
               "$ref": "#/$defs/Language"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. Programming language of the `code`."
      }
   },
   "$defs": {
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field code: Optional[str] = None

Required. The code to be executed.

field language: Optional[Language] = None

Required. Programming language of the code.

class genai.types.ExecutableCodeDict

Bases: TypedDict

Code generated by the model that is meant to be executed, and the result returned to the model.

Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE].

code: Optional[str]

Required. The code to be executed.

language: Optional[Language]

Required. Programming language of the code.

class genai.types.FeatureSelectionPreference(*values)

Bases: CaseInSensitiveEnum

Options for feature selection preference.

BALANCED = 'BALANCED'
FEATURE_SELECTION_PREFERENCE_UNSPECIFIED = 'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED'
PRIORITIZE_COST = 'PRIORITIZE_COST'
PRIORITIZE_QUALITY = 'PRIORITIZE_QUALITY'
pydantic model genai.types.FetchPredictOperationConfig

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FetchPredictOperationConfig",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.FetchPredictOperationConfigDict

Bases: TypedDict

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.File

Bases: BaseModel

A file uploaded to the API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "File",
   "description": "A file uploaded to the API.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
         "title": "Name"
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
         "title": "Displayname"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. MIME type of the file.",
         "title": "Mimetype"
      },
      "sizeBytes": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Size of the file in bytes.",
         "title": "Sizebytes"
      },
      "createTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The timestamp of when the `File` was created.",
         "title": "Createtime"
      },
      "expirationTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
         "title": "Expirationtime"
      },
      "updateTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The timestamp of when the `File` was last updated.",
         "title": "Updatetime"
      },
      "sha256Hash": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
         "title": "Sha256Hash"
      },
      "uri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The URI of the `File`.",
         "title": "Uri"
      },
      "downloadUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
         "title": "Downloaduri"
      },
      "state": {
         "anyOf": [
            {
               "$ref": "#/$defs/FileState"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Processing state of the File."
      },
      "source": {
         "anyOf": [
            {
               "$ref": "#/$defs/FileSource"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The source of the `File`."
      },
      "videoMetadata": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Metadata for a video.",
         "title": "Videometadata"
      },
      "error": {
         "anyOf": [
            {
               "$ref": "#/$defs/FileStatus"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Error status if File processing failed."
      }
   },
   "$defs": {
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field create_time: Optional[datetime] = None (alias 'createTime')

Output only. The timestamp of when the File was created.

field display_name: Optional[str] = None (alias 'displayName')

Optional. The human-readable display name for the File. The display name must be no more than 512 characters in length, including spaces. Example: ‘Welcome Image’

field download_uri: Optional[str] = None (alias 'downloadUri')

Output only. The URI of the File, only set for downloadable (generated) files.

field error: Optional[FileStatus] = None

Output only. Error status if File processing failed.

field expiration_time: Optional[datetime] = None (alias 'expirationTime')

Output only. The timestamp of when the File will be deleted. Only set if the File is scheduled to expire.

field mime_type: Optional[str] = None (alias 'mimeType')

Output only. MIME type of the file.

field name: Optional[str] = None

The File resource name. The ID (name excluding the “files/” prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: files/123-456

field sha256_hash: Optional[str] = None (alias 'sha256Hash')

Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.

field size_bytes: Optional[int] = None (alias 'sizeBytes')

Output only. Size of the file in bytes.

field source: Optional[FileSource] = None

Output only. The source of the File.

field state: Optional[FileState] = None

Output only. Processing state of the File.

field update_time: Optional[datetime] = None (alias 'updateTime')

Output only. The timestamp of when the File was last updated.

field uri: Optional[str] = None

Output only. The URI of the File.

field video_metadata: Optional[dict[str, Any]] = None (alias 'videoMetadata')

Output only. Metadata for a video.

pydantic model genai.types.FileData

Bases: BaseModel

URI based data.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FileData",
   "description": "URI based data.",
   "type": "object",
   "properties": {
      "fileUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. URI.",
         "title": "Fileuri"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The IANA standard MIME type of the source data.",
         "title": "Mimetype"
      }
   },
   "additionalProperties": false
}

Fields:
field file_uri: Optional[str] = None (alias 'fileUri')

Required. URI.

field mime_type: Optional[str] = None (alias 'mimeType')

Required. The IANA standard MIME type of the source data.

class genai.types.FileDataDict

Bases: TypedDict

URI based data.

file_uri: Optional[str]

Required. URI.

mime_type: Optional[str]

Required. The IANA standard MIME type of the source data.

class genai.types.FileDict

Bases: TypedDict

A file uploaded to the API.

create_time: Optional[datetime]

Output only. The timestamp of when the File was created.

display_name: Optional[str]

‘Welcome Image’

Type:

Optional. The human-readable display name for the File. The display name must be no more than 512 characters in length, including spaces. Example

download_uri: Optional[str]

Output only. The URI of the File, only set for downloadable (generated) files.

error: Optional[FileStatusDict]

Output only. Error status if File processing failed.

expiration_time: Optional[datetime]

Output only. The timestamp of when the File will be deleted. Only set if the File is scheduled to expire.

mime_type: Optional[str]

Output only. MIME type of the file.

name: Optional[str]

files/123-456

Type:

The File resource name. The ID (name excluding the “files/” prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example

sha256_hash: Optional[str]

Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.

size_bytes: Optional[int]

Output only. Size of the file in bytes.

source: Optional[FileSource]

Output only. The source of the File.

state: Optional[FileState]

Output only. Processing state of the File.

update_time: Optional[datetime]

Output only. The timestamp of when the File was last updated.

uri: Optional[str]

Output only. The URI of the File.

video_metadata: Optional[dict[str, Any]]

Output only. Metadata for a video.

class genai.types.FileSource(*values)

Bases: CaseInSensitiveEnum

Source of the File.

GENERATED = 'GENERATED'
SOURCE_UNSPECIFIED = 'SOURCE_UNSPECIFIED'
UPLOADED = 'UPLOADED'
class genai.types.FileState(*values)

Bases: CaseInSensitiveEnum

State for the lifecycle of a File.

ACTIVE = 'ACTIVE'
FAILED = 'FAILED'
PROCESSING = 'PROCESSING'
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
pydantic model genai.types.FileStatus

Bases: BaseModel

Status of a File that uses a common error model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FileStatus",
   "description": "Status of a File that uses a common error model.",
   "type": "object",
   "properties": {
      "details": {
         "anyOf": [
            {
               "items": {
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
         "title": "Details"
      },
      "message": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
         "title": "Message"
      },
      "code": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The status code. 0 for OK, 1 for CANCELLED",
         "title": "Code"
      }
   },
   "additionalProperties": false
}

Fields:
field code: Optional[int] = None

The status code. 0 for OK, 1 for CANCELLED

field details: Optional[list[dict[str, Any]]] = None

A list of messages that carry the error details. There is a common set of message types for APIs to use.

field message: Optional[str] = None

A list of messages that carry the error details. There is a common set of message types for APIs to use.

class genai.types.FileStatusDict

Bases: TypedDict

Status of a File that uses a common error model.

code: Optional[int]

The status code. 0 for OK, 1 for CANCELLED

details: Optional[list[dict[str, Any]]]

A list of messages that carry the error details. There is a common set of message types for APIs to use.

message: Optional[str]

A list of messages that carry the error details. There is a common set of message types for APIs to use.

class genai.types.FinishReason(*values)

Bases: CaseInSensitiveEnum

Output only. The reason why the model stopped generating tokens.

If empty, the model has not stopped generating the tokens.

BLOCKLIST = 'BLOCKLIST'

Token generation stopped because the content contains forbidden terms.

FINISH_REASON_UNSPECIFIED = 'FINISH_REASON_UNSPECIFIED'

The finish reason is unspecified.

IMAGE_SAFETY = 'IMAGE_SAFETY'

Token generation stopped because generated images have safety violations.

LANGUAGE = 'LANGUAGE'

The token generation stopped because of using an unsupported language.

MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL'

The function call generated by the model is invalid.

MAX_TOKENS = 'MAX_TOKENS'

Token generation reached the configured maximum output tokens.

OTHER = 'OTHER'

All other reasons that stopped the token generation.

PROHIBITED_CONTENT = 'PROHIBITED_CONTENT'

Token generation stopped for potentially containing prohibited content.

RECITATION = 'RECITATION'

The token generation stopped because of potential recitation.

SAFETY = 'SAFETY'

When streaming, [content][] is empty if content filters blocks the output.

Type:

Token generation stopped because the content potentially contains safety violations. NOTE

SPII = 'SPII'

Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).

STOP = 'STOP'

Token generation reached a natural stopping point or a configured stop sequence.

pydantic model genai.types.FunctionCall

Bases: BaseModel

A function call.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FunctionCall",
   "description": "A function call.",
   "type": "object",
   "properties": {
      "id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
         "title": "Id"
      },
      "args": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
         "title": "Args"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
         "title": "Name"
      }
   },
   "additionalProperties": false
}

Fields:
field args: Optional[dict[str, Any]] = None

Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.

field id: Optional[str] = None

The unique id of the function call. If populated, the client to execute the function_call and return the response with the matching id.

field name: Optional[str] = None

Required. The name of the function to call. Matches [FunctionDeclaration.name].

class genai.types.FunctionCallDict

Bases: TypedDict

A function call.

args: Optional[dict[str, Any]]

Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.

id: Optional[str]

The unique id of the function call. If populated, the client to execute the function_call and return the response with the matching id.

name: Optional[str]

Required. The name of the function to call. Matches [FunctionDeclaration.name].

pydantic model genai.types.FunctionCallingConfig

Bases: BaseModel

Function calling config.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FunctionCallingConfig",
   "description": "Function calling config.",
   "type": "object",
   "properties": {
      "mode": {
         "anyOf": [
            {
               "$ref": "#/$defs/FunctionCallingConfigMode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Function calling mode."
      },
      "allowedFunctionNames": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.",
         "title": "Allowedfunctionnames"
      }
   },
   "$defs": {
      "FunctionCallingConfigMode": {
         "description": "Config for the function calling config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "AUTO",
            "ANY",
            "NONE"
         ],
         "title": "FunctionCallingConfigMode",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field allowed_function_names: Optional[list[str]] = None (alias 'allowedFunctionNames')

Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.

field mode: Optional[FunctionCallingConfigMode] = None

Optional. Function calling mode.

class genai.types.FunctionCallingConfigDict

Bases: TypedDict

Function calling config.

allowed_function_names: Optional[list[str]]

Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.

mode: Optional[FunctionCallingConfigMode]

Optional. Function calling mode.

class genai.types.FunctionCallingConfigMode(*values)

Bases: CaseInSensitiveEnum

Config for the function calling config mode.

ANY = 'ANY'

Model is constrained to always predicting function calls only. If “allowed_function_names” are set, the predicted function calls will be limited to any one of “allowed_function_names”, else the predicted function calls will be any one of the provided “function_declarations”.

AUTO = 'AUTO'

Default model behavior, model decides to predict either function calls or natural language response.

MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'

The function calling config mode is unspecified. Should not be used.

NONE = 'NONE'

Model will not predict any function calls. Model behavior is same as when not passing any function declarations.

pydantic model genai.types.FunctionDeclaration

Bases: BaseModel

Defines a function that the model can generate JSON inputs for.

The inputs are based on OpenAPI 3.0 specifications.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FunctionDeclaration",
   "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
   "type": "object",
   "properties": {
      "behavior": {
         "anyOf": [
            {
               "$ref": "#/$defs/Behavior"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Defines the function behavior."
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
         "title": "Description"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
         "title": "Name"
      },
      "parameters": {
         "anyOf": [
            {
               "$ref": "#/$defs/Schema"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
      },
      "response": {
         "anyOf": [
            {
               "$ref": "#/$defs/Schema"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
      }
   },
   "$defs": {
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field behavior: Optional[Behavior] = None

Defines the function behavior.

field description: Optional[str] = None

Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.

field name: Optional[str] = None

Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.

field parameters: Optional[Schema] = None

Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1

field response: Optional[Schema] = None

Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.

classmethod from_callable(*, client, callable, behavior=None)

Converts a Callable to a FunctionDeclaration based on the client.

Return type:

FunctionDeclaration

classmethod from_callable_with_api_option(*, callable, api_option='GEMINI_API', behavior=None)

Converts a Callable to a FunctionDeclaration based on the API option.

Supported API option is ‘VERTEX_AI’ or ‘GEMINI_API’. If api_option is unset, it will default to ‘GEMINI_API’. If unsupported api_option is provided, it will raise ValueError.

Return type:

FunctionDeclaration

class genai.types.FunctionDeclarationDict

Bases: TypedDict

Defines a function that the model can generate JSON inputs for.

The inputs are based on OpenAPI 3.0 specifications.

behavior: Optional[Behavior]

Defines the function behavior.

description: Optional[str]

Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.

name: Optional[str]

Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.

parameters: Optional[SchemaDict]

the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1

Type:

Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key

Type:

the name of the parameter. Parameter names are case sensitive. Schema Value

response: Optional[SchemaDict]

Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.

pydantic model genai.types.FunctionResponse

Bases: BaseModel

A function response.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "FunctionResponse",
   "description": "A function response.",
   "type": "object",
   "properties": {
      "willContinue": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
         "title": "Willcontinue"
      },
      "scheduling": {
         "anyOf": [
            {
               "$ref": "#/$defs/FunctionResponseScheduling"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
      },
      "id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
         "title": "Id"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
         "title": "Name"
      },
      "response": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
         "title": "Response"
      }
   },
   "$defs": {
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field id: Optional[str] = None

Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call id.

field name: Optional[str] = None

Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].

field response: Optional[dict[str, Any]] = None

Required. The function response in JSON object format. Use “output” key to specify function output and “error” key to specify error details (if any). If “output” and “error” keys are not specified, then whole “response” is treated as function output.

field scheduling: Optional[FunctionResponseScheduling] = None

Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.

field will_continue: Optional[bool] = None (alias 'willContinue')

Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty response with will_continue=False to signal that the function call is finished.

class genai.types.FunctionResponseDict

Bases: TypedDict

A function response.

id: Optional[str]

Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call id.

name: Optional[str]

Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].

response: Optional[dict[str, Any]]

Required. The function response in JSON object format. Use “output” key to specify function output and “error” key to specify error details (if any). If “output” and “error” keys are not specified, then whole “response” is treated as function output.

scheduling: Optional[FunctionResponseScheduling]

Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.

will_continue: Optional[bool]

Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty response with will_continue=False to signal that the function call is finished.

class genai.types.FunctionResponseScheduling(*values)

Bases: CaseInSensitiveEnum

Specifies how the response should be scheduled in the conversation.

INTERRUPT = 'INTERRUPT'

Add the result to the conversation context, interrupt ongoing generation and prompt to generate output.

SCHEDULING_UNSPECIFIED = 'SCHEDULING_UNSPECIFIED'

This value is unused.

SILENT = 'SILENT'

Only add the result to the conversation context, do not interrupt or trigger generation.

WHEN_IDLE = 'WHEN_IDLE'

Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.

pydantic model genai.types.GenerateContentConfig

Bases: BaseModel

Optional model configuration parameters.

For more information, see Content generation parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateContentConfig",
   "description": "Optional model configuration parameters.\n\nFor more information, see `Content generation parameters\n<https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>`_.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "systemInstruction": {
         "anyOf": [
            {
               "$ref": "#/$defs/Content"
            },
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/File"
                     },
                     {
                        "$ref": "#/$defs/Part"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "$ref": "#/$defs/File"
            },
            {
               "$ref": "#/$defs/Part"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Instructions for the model to steer it toward better performance.\n      For example, \"Answer as concisely as possible\" or \"Don't use technical\n      terms in your response\".\n      ",
         "title": "Systeminstruction"
      },
      "temperature": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value that controls the degree of randomness in token selection.\n      Lower temperatures are good for prompts that require a less open-ended or\n      creative response, while higher temperatures can lead to more diverse or\n      creative results.\n      ",
         "title": "Temperature"
      },
      "topP": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Tokens are selected from the most to least probable until the sum\n      of their probabilities equals this value. Use a lower value for less\n      random responses and a higher value for more random responses.\n      ",
         "title": "Topp"
      },
      "topK": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "For each token selection step, the ``top_k`` tokens with the\n      highest probabilities are sampled. Then tokens are further filtered based\n      on ``top_p`` with the final token selected using temperature sampling. Use\n      a lower number for less random responses and a higher number for more\n      random responses.\n      ",
         "title": "Topk"
      },
      "candidateCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of response variations to return.\n      ",
         "title": "Candidatecount"
      },
      "maxOutputTokens": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum number of tokens that can be generated in the response.\n      ",
         "title": "Maxoutputtokens"
      },
      "stopSequences": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of strings that tells the model to stop generating text if one\n      of the strings is encountered in the response.\n      ",
         "title": "Stopsequences"
      },
      "responseLogprobs": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to return the log probabilities of the tokens that were\n      chosen by the model at each step.\n      ",
         "title": "Responselogprobs"
      },
      "logprobs": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of top candidate tokens to return the log probabilities for\n      at each generation step.\n      ",
         "title": "Logprobs"
      },
      "presencePenalty": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Positive values penalize tokens that already appear in the\n      generated text, increasing the probability of generating more diverse\n      content.\n      ",
         "title": "Presencepenalty"
      },
      "frequencyPenalty": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Positive values penalize tokens that repeatedly appear in the\n      generated text, increasing the probability of generating more diverse\n      content.\n      ",
         "title": "Frequencypenalty"
      },
      "seed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "When ``seed`` is fixed to a specific number, the model makes a best\n      effort to provide the same response for repeated requests. By default, a\n      random number is used.\n      ",
         "title": "Seed"
      },
      "responseMimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output response mimetype of the generated candidate text.\n      Supported mimetype:\n        - `text/plain`: (default) Text output.\n        - `application/json`: JSON response in the candidates.\n      The model needs to be prompted to output the appropriate response type,\n      otherwise the behavior is undefined.\n      This is a preview feature.\n      ",
         "title": "Responsemimetype"
      },
      "responseSchema": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "$ref": "#/$defs/Schema"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The `Schema` object allows the definition of input and output data types.\n      These types can be objects, but also primitives and arrays.\n      Represents a select subset of an [OpenAPI 3.0 schema\n      object](https://spec.openapis.org/oas/v3.0.3#schema).\n      If set, a compatible response_mime_type must also be set.\n      Compatible mimetypes: `application/json`: Schema for JSON response.\n      ",
         "title": "Responseschema"
      },
      "routingConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerationConfigRoutingConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for model router requests.\n      "
      },
      "modelSelectionConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/ModelSelectionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for model selection.\n      "
      },
      "safetySettings": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/SafetySetting"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Safety settings in the request to block unsafe content in the\n      response.\n      ",
         "title": "Safetysettings"
      },
      "tools": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Tool"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Code that enables the system to interact with external systems to\n      perform an action outside of the knowledge and scope of the model.\n      ",
         "title": "Tools"
      },
      "toolConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/ToolConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Associates model output to a specific function call.\n      "
      },
      "labels": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Labels with user-defined metadata to break down billed charges.",
         "title": "Labels"
      },
      "cachedContent": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Resource name of a context cache that can be used in subsequent\n      requests.\n      ",
         "title": "Cachedcontent"
      },
      "responseModalities": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The requested modalities of the response. Represents the set of\n      modalities that the model can return.\n      ",
         "title": "Responsemodalities"
      },
      "mediaResolution": {
         "anyOf": [
            {
               "$ref": "#/$defs/MediaResolution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If specified, the media resolution specified will be used.\n    "
      },
      "speechConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/SpeechConfig"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The speech generation configuration.\n      ",
         "title": "Speechconfig"
      },
      "audioTimestamp": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If enabled, audio timestamp will be included in the request to the\n       model.\n      ",
         "title": "Audiotimestamp"
      },
      "automaticFunctionCalling": {
         "anyOf": [
            {
               "$ref": "#/$defs/AutomaticFunctionCallingConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The configuration for automatic function calling.\n      "
      },
      "thinkingConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/ThinkingConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The thinking features configuration.\n      "
      }
   },
   "$defs": {
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "AutomaticFunctionCallingConfig": {
         "additionalProperties": false,
         "description": "The configuration for automatic function calling.",
         "properties": {
            "disable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether to disable automatic function calling.\n      If not set or set to False, will enable automatic function calling.\n      If set to True, will disable automatic function calling.\n      ",
               "title": "Disable"
            },
            "maximumRemoteCalls": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 10,
               "description": "If automatic function calling is enabled,\n      maximum number of remote calls for automatic function calling.\n      This number should be a positive integer.\n      If not set, SDK will set maximum number of remote calls to 10.\n      ",
               "title": "Maximumremotecalls"
            },
            "ignoreCallHistory": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If automatic function calling is enabled,\n      whether to ignore call history to the response.\n      If not set, SDK will set ignore_call_history to false,\n      and will append the call history to\n      GenerateContentResponse.automatic_function_calling_history.\n      ",
               "title": "Ignorecallhistory"
            }
         },
         "title": "AutomaticFunctionCallingConfig",
         "type": "object"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FeatureSelectionPreference": {
         "description": "Options for feature selection preference.",
         "enum": [
            "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",
            "PRIORITIZE_QUALITY",
            "BALANCED",
            "PRIORITIZE_COST"
         ],
         "title": "FeatureSelectionPreference",
         "type": "string"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionCallingConfig": {
         "additionalProperties": false,
         "description": "Function calling config.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCallingConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function calling mode."
            },
            "allowedFunctionNames": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.",
               "title": "Allowedfunctionnames"
            }
         },
         "title": "FunctionCallingConfig",
         "type": "object"
      },
      "FunctionCallingConfigMode": {
         "description": "Config for the function calling config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "AUTO",
            "ANY",
            "NONE"
         ],
         "title": "FunctionCallingConfigMode",
         "type": "string"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HarmBlockMethod": {
         "description": "Optional.\n\nSpecify if the threshold is used for probability or severity score. If not\nspecified, the threshold is used for probability score.",
         "enum": [
            "HARM_BLOCK_METHOD_UNSPECIFIED",
            "SEVERITY",
            "PROBABILITY"
         ],
         "title": "HarmBlockMethod",
         "type": "string"
      },
      "HarmBlockThreshold": {
         "description": "Required. The harm block threshold.",
         "enum": [
            "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
            "BLOCK_LOW_AND_ABOVE",
            "BLOCK_MEDIUM_AND_ABOVE",
            "BLOCK_ONLY_HIGH",
            "BLOCK_NONE",
            "OFF"
         ],
         "title": "HarmBlockThreshold",
         "type": "string"
      },
      "HarmCategory": {
         "description": "Required. Harm category.",
         "enum": [
            "HARM_CATEGORY_UNSPECIFIED",
            "HARM_CATEGORY_HATE_SPEECH",
            "HARM_CATEGORY_DANGEROUS_CONTENT",
            "HARM_CATEGORY_HARASSMENT",
            "HARM_CATEGORY_SEXUALLY_EXPLICIT",
            "HARM_CATEGORY_CIVIC_INTEGRITY"
         ],
         "title": "HarmCategory",
         "type": "string"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LatLng": {
         "additionalProperties": false,
         "description": "An object that represents a latitude/longitude pair.\n\nThis is expressed as a pair of doubles to represent degrees latitude and\ndegrees longitude. Unless specified otherwise, this object must conform to the\n<a href=\"https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version\">\nWGS84 standard</a>. Values must be within normalized ranges.",
         "properties": {
            "latitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].",
               "title": "Latitude"
            },
            "longitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]",
               "title": "Longitude"
            }
         },
         "title": "LatLng",
         "type": "object"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "ModelSelectionConfig": {
         "additionalProperties": false,
         "description": "Config for model selection.",
         "properties": {
            "featureSelectionPreference": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FeatureSelectionPreference"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Options for feature selection preference."
            }
         },
         "title": "ModelSelectionConfig",
         "type": "object"
      },
      "MultiSpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the multi-speaker setup.",
         "properties": {
            "speakerVoiceConfigs": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SpeakerVoiceConfig"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.",
               "title": "Speakervoiceconfigs"
            }
         },
         "title": "MultiSpeakerVoiceConfig",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "RetrievalConfig": {
         "additionalProperties": false,
         "description": "Retrieval config.",
         "properties": {
            "latLng": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LatLng"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The location of the user."
            }
         },
         "title": "RetrievalConfig",
         "type": "object"
      },
      "SafetySetting": {
         "additionalProperties": false,
         "description": "Safety settings.",
         "properties": {
            "method": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmBlockMethod"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines if the harm block method uses probability or probability\n      and severity scores."
            },
            "category": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmCategory"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Harm category."
            },
            "threshold": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmBlockThreshold"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The harm block threshold."
            }
         },
         "title": "SafetySetting",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "SpeechConfig": {
         "additionalProperties": false,
         "description": "The speech generation configuration.",
         "properties": {
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            },
            "multiSpeakerVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the multi-speaker setup.\n          It is mutually exclusive with the voice_config field.\n          "
            },
            "languageCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Language code (ISO 639. e.g. en-US) for the speech synthesization.\n      Only available for Live API.\n      ",
               "title": "Languagecode"
            }
         },
         "title": "SpeechConfig",
         "type": "object"
      },
      "ThinkingConfig": {
         "additionalProperties": false,
         "description": "The thinking features configuration.",
         "properties": {
            "includeThoughts": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.\n      ",
               "title": "Includethoughts"
            },
            "thinkingBudget": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the thinking budget in tokens.\n      ",
               "title": "Thinkingbudget"
            }
         },
         "title": "ThinkingConfig",
         "type": "object"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "ToolConfig": {
         "additionalProperties": false,
         "description": "Tool config.\n\nThis config is shared for all tools provided in the request.",
         "properties": {
            "functionCallingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCallingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function calling config."
            },
            "retrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval config."
            }
         },
         "title": "ToolConfig",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field audio_timestamp: Optional[bool] = None (alias 'audioTimestamp')

If enabled, audio timestamp will be included in the request to the model.

field automatic_function_calling: Optional[AutomaticFunctionCallingConfig] = None (alias 'automaticFunctionCalling')

The configuration for automatic function calling.

field cached_content: Optional[str] = None (alias 'cachedContent')

Resource name of a context cache that can be used in subsequent requests.

field candidate_count: Optional[int] = None (alias 'candidateCount')

Number of response variations to return.

field frequency_penalty: Optional[float] = None (alias 'frequencyPenalty')

Positive values penalize tokens that repeatedly appear in the generated text, increasing the probability of generating more diverse content.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field labels: Optional[dict[str, str]] = None

Labels with user-defined metadata to break down billed charges.

field logprobs: Optional[int] = None

Number of top candidate tokens to return the log probabilities for at each generation step.

field max_output_tokens: Optional[int] = None (alias 'maxOutputTokens')

Maximum number of tokens that can be generated in the response.

field media_resolution: Optional[MediaResolution] = None (alias 'mediaResolution')

If specified, the media resolution specified will be used.

field model_selection_config: Optional[ModelSelectionConfig] = None (alias 'modelSelectionConfig')

Configuration for model selection.

field presence_penalty: Optional[float] = None (alias 'presencePenalty')

Positive values penalize tokens that already appear in the generated text, increasing the probability of generating more diverse content.

field response_logprobs: Optional[bool] = None (alias 'responseLogprobs')

Whether to return the log probabilities of the tokens that were chosen by the model at each step.

field response_mime_type: Optional[str] = None (alias 'responseMimeType')

Output response mimetype of the generated candidate text. Supported mimetype:

  • text/plain: (default) Text output.

  • application/json: JSON response in the candidates.

The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.

field response_modalities: Optional[list[str]] = None (alias 'responseModalities')

The requested modalities of the response. Represents the set of modalities that the model can return.

field response_schema: Union[dict[Any, Any], type, Schema, GenericAlias, , _UnionGenericAlias, None] = None (alias 'responseSchema')

The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: application/json: Schema for JSON response.

Validated by:
  • _convert_literal_to_enum

field routing_config: Optional[GenerationConfigRoutingConfig] = None (alias 'routingConfig')

Configuration for model router requests.

field safety_settings: Optional[list[SafetySetting]] = None (alias 'safetySettings')

Safety settings in the request to block unsafe content in the response.

field seed: Optional[int] = None

When seed is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests. By default, a random number is used.

field speech_config: Union[SpeechConfig, str, None] = None (alias 'speechConfig')

The speech generation configuration.

field stop_sequences: Optional[list[str]] = None (alias 'stopSequences')

List of strings that tells the model to stop generating text if one of the strings is encountered in the response.

field system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, None] = None (alias 'systemInstruction')

Instructions for the model to steer it toward better performance. For example, “Answer as concisely as possible” or “Don’t use technical terms in your response”.

field temperature: Optional[float] = None

Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results.

field thinking_config: Optional[ThinkingConfig] = None (alias 'thinkingConfig')

The thinking features configuration.

field tool_config: Optional[ToolConfig] = None (alias 'toolConfig')

Associates model output to a specific function call.

field tools: Optional[list[Union[Tool, Callable[..., Any]]]] = None

Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model.

field top_k: Optional[float] = None (alias 'topK')

For each token selection step, the top_k tokens with the highest probabilities are sampled. Then tokens are further filtered based on top_p with the final token selected using temperature sampling. Use a lower number for less random responses and a higher number for more random responses.

field top_p: Optional[float] = None (alias 'topP')

Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses.

class genai.types.GenerateContentConfigDict

Bases: TypedDict

Optional model configuration parameters.

For more information, see Content generation parameters.

audio_timestamp: Optional[bool]

If enabled, audio timestamp will be included in the request to the model.

automatic_function_calling: Optional[AutomaticFunctionCallingConfigDict]

The configuration for automatic function calling.

cached_content: Optional[str]

Resource name of a context cache that can be used in subsequent requests.

candidate_count: Optional[int]

Number of response variations to return.

frequency_penalty: Optional[float]

Positive values penalize tokens that repeatedly appear in the generated text, increasing the probability of generating more diverse content.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

labels: Optional[dict[str, str]]

Labels with user-defined metadata to break down billed charges.

logprobs: Optional[int]

Number of top candidate tokens to return the log probabilities for at each generation step.

max_output_tokens: Optional[int]

Maximum number of tokens that can be generated in the response.

media_resolution: Optional[MediaResolution]

If specified, the media resolution specified will be used.

model_selection_config: Optional[ModelSelectionConfigDict]

Configuration for model selection.

presence_penalty: Optional[float]

Positive values penalize tokens that already appear in the generated text, increasing the probability of generating more diverse content.

response_logprobs: Optional[bool]

Whether to return the log probabilities of the tokens that were chosen by the model at each step.

response_mime_type: Optional[str]

Output response mimetype of the generated candidate text. Supported mimetype:

  • text/plain: (default) Text output.

  • application/json: JSON response in the candidates.

The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.

response_modalities: Optional[list[str]]

The requested modalities of the response. Represents the set of modalities that the model can return.

response_schema: Union[dict[Any, Any], type, Schema, GenericAlias, , _UnionGenericAlias, SchemaDict, None]

The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: application/json: Schema for JSON response.

routing_config: Optional[GenerationConfigRoutingConfigDict]

Configuration for model router requests.

safety_settings: Optional[list[SafetySettingDict]]

Safety settings in the request to block unsafe content in the response.

seed: Optional[int]

When seed is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests. By default, a random number is used.

speech_config: Union[SpeechConfig, str, SpeechConfigDict, None]

The speech generation configuration.

stop_sequences: Optional[list[str]]

List of strings that tells the model to stop generating text if one of the strings is encountered in the response.

system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, ContentDict, None]

Instructions for the model to steer it toward better performance. For example, “Answer as concisely as possible” or “Don’t use technical terms in your response”.

temperature: Optional[float]

Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results.

thinking_config: Optional[ThinkingConfigDict]

The thinking features configuration.

tool_config: Optional[ToolConfigDict]

Associates model output to a specific function call.

tools: Optional[list[Union[ToolDict, Callable[..., Any]]]]

Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model.

top_k: Optional[float]

For each token selection step, the top_k tokens with the highest probabilities are sampled. Then tokens are further filtered based on top_p with the final token selected using temperature sampling. Use a lower number for less random responses and a higher number for more random responses.

top_p: Optional[float]

Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses.

pydantic model genai.types.GenerateContentResponse

Bases: BaseModel

Response message for PredictionService.GenerateContent.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateContentResponse",
   "description": "Response message for PredictionService.GenerateContent.",
   "type": "object",
   "properties": {
      "candidates": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Candidate"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Response variations returned by the model.\n      ",
         "title": "Candidates"
      },
      "createTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Timestamp when the request is made to the server.\n      ",
         "title": "Createtime"
      },
      "responseId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Identifier for each response.\n      ",
         "title": "Responseid"
      },
      "modelVersion": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The model version used to generate the response.",
         "title": "Modelversion"
      },
      "promptFeedback": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerateContentResponsePromptFeedback"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations."
      },
      "usageMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerateContentResponseUsageMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Usage metadata about the response(s)."
      },
      "automaticFunctionCallingHistory": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Content"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Automaticfunctioncallinghistory"
      },
      "parsed": {
         "anyOf": [
            {
               "$ref": "#/$defs/BaseModel"
            },
            {
               "type": "object"
            },
            {
               "description": "Create a collection of name/value pairs.\n\nExample enumeration:\n\n>>> class Color(Enum):\n...     RED = 1\n...     BLUE = 2\n...     GREEN = 3\n\nAccess them by:\n\n- attribute access:\n\n  >>> Color.RED\n  <Color.RED: 1>\n\n- value lookup:\n\n  >>> Color(1)\n  <Color.RED: 1>\n\n- name lookup:\n\n  >>> Color['RED']\n  <Color.RED: 1>\n\nEnumerations can be iterated over, and know how many members they have:\n\n>>> len(Color)\n3\n\n>>> list(Color)\n[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]\n\nMethods can be added to enumerations, and members can have their own\nattributes -- see the documentation for details.",
               "enum": [],
               "title": "Enum"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "First candidate from the parsed response if response_schema is provided. Not available for streaming.",
         "title": "Parsed"
      }
   },
   "$defs": {
      "BaseModel": {
         "properties": {},
         "title": "BaseModel",
         "type": "object"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "BlockedReason": {
         "description": "Output only. Blocked reason.",
         "enum": [
            "BLOCKED_REASON_UNSPECIFIED",
            "SAFETY",
            "OTHER",
            "BLOCKLIST",
            "PROHIBITED_CONTENT"
         ],
         "title": "BlockedReason",
         "type": "string"
      },
      "Candidate": {
         "additionalProperties": false,
         "description": "A response candidate generated from the model.",
         "properties": {
            "content": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Contains the multi-part content of the response.\n      "
            },
            "citationMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CitationMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Source attribution of the generated content.\n      "
            },
            "finishMessage": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Describes the reason the model stopped generating tokens.\n      ",
               "title": "Finishmessage"
            },
            "tokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens for this candidate.\n      ",
               "title": "Tokencount"
            },
            "finishReason": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FinishReason"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The reason why the model stopped generating tokens.\n      If empty, the model has not stopped generating the tokens.\n      "
            },
            "urlContextMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContextMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata related to url context retrieval tool."
            },
            "avgLogprobs": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Average log probability score of the candidate.",
               "title": "Avglogprobs"
            },
            "groundingMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata specifies sources used to ground generated content."
            },
            "index": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Index of the candidate.",
               "title": "Index"
            },
            "logprobsResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LogprobsResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Log-likelihood scores for the response tokens and top tokens"
            },
            "safetyRatings": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SafetyRating"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.",
               "title": "Safetyratings"
            }
         },
         "title": "Candidate",
         "type": "object"
      },
      "Citation": {
         "additionalProperties": false,
         "description": "Source attributions for content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index into the content.",
               "title": "Endindex"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. License of the attribution.",
               "title": "License"
            },
            "publicationDate": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleTypeDate"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Publication date of the attribution."
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index into the content.",
               "title": "Startindex"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Url reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "Citation",
         "type": "object"
      },
      "CitationMetadata": {
         "additionalProperties": false,
         "description": "Citation information when the model quotes another source.",
         "properties": {
            "citations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Citation"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Contains citation information when the model directly quotes, at\n      length, from another source. Can include traditional websites and code\n      repositories.\n      ",
               "title": "Citations"
            }
         },
         "title": "CitationMetadata",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FinishReason": {
         "description": "Output only. The reason why the model stopped generating tokens.\n\nIf empty, the model has not stopped generating the tokens.",
         "enum": [
            "FINISH_REASON_UNSPECIFIED",
            "STOP",
            "MAX_TOKENS",
            "SAFETY",
            "RECITATION",
            "LANGUAGE",
            "OTHER",
            "BLOCKLIST",
            "PROHIBITED_CONTENT",
            "SPII",
            "MALFORMED_FUNCTION_CALL",
            "IMAGE_SAFETY"
         ],
         "title": "FinishReason",
         "type": "string"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerateContentResponsePromptFeedback": {
         "additionalProperties": false,
         "description": "Content filter results for a prompt sent in the request.",
         "properties": {
            "blockReason": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BlockedReason"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Blocked reason."
            },
            "blockReasonMessage": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. A readable block reason message.",
               "title": "Blockreasonmessage"
            },
            "safetyRatings": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SafetyRating"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Safety ratings.",
               "title": "Safetyratings"
            }
         },
         "title": "GenerateContentResponsePromptFeedback",
         "type": "object"
      },
      "GenerateContentResponseUsageMetadata": {
         "additionalProperties": false,
         "description": "Usage metadata about response(s).",
         "properties": {
            "cacheTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. List of modalities of the cached content in the request input.",
               "title": "Cachetokensdetails"
            },
            "cachedContentTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tokens in the cached part in the input (the cached content).",
               "title": "Cachedcontenttokencount"
            },
            "candidatesTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens in the response(s).",
               "title": "Candidatestokencount"
            },
            "candidatesTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. List of modalities that were returned in the response.",
               "title": "Candidatestokensdetails"
            },
            "promptTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens in the request. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.",
               "title": "Prompttokencount"
            },
            "promptTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. List of modalities that were processed in the request input.",
               "title": "Prompttokensdetails"
            },
            "thoughtsTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tokens present in thoughts output.",
               "title": "Thoughtstokencount"
            },
            "toolUsePromptTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tokens present in tool-use prompt(s).",
               "title": "Tooluseprompttokencount"
            },
            "toolUsePromptTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. List of modalities that were processed for tool-use request inputs.",
               "title": "Tooluseprompttokensdetails"
            },
            "totalTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total token count for prompt, response candidates, and tool-use prompts (if present).",
               "title": "Totaltokencount"
            },
            "trafficType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TrafficType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota."
            }
         },
         "title": "GenerateContentResponseUsageMetadata",
         "type": "object"
      },
      "GoogleTypeDate": {
         "additionalProperties": false,
         "description": "Represents a whole or partial calendar date, such as a birthday.\n\nThe time of day and time zone are either specified elsewhere or are\ninsignificant. The date is relative to the Gregorian Calendar. This can\nrepresent one of the following: * A full date, with non-zero year, month, and\nday values. * A month and day, with a zero year (for example, an anniversary).\n* A year on its own, with a zero month and a zero day. * A year and month,\nwith a zero day (for example, a credit card expiration date). Related types: *\ngoogle.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp",
         "properties": {
            "day": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.",
               "title": "Day"
            },
            "month": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.",
               "title": "Month"
            },
            "year": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.",
               "title": "Year"
            }
         },
         "title": "GoogleTypeDate",
         "type": "object"
      },
      "GroundingChunk": {
         "additionalProperties": false,
         "description": "Grounding chunk.",
         "properties": {
            "retrievedContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkRetrievedContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from context retrieved by the retrieval tools."
            },
            "web": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkWeb"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from the web."
            }
         },
         "title": "GroundingChunk",
         "type": "object"
      },
      "GroundingChunkRetrievedContext": {
         "additionalProperties": false,
         "description": "Chunk from context retrieved by the retrieval tools.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text of the attribution.",
               "title": "Text"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkRetrievedContext",
         "type": "object"
      },
      "GroundingChunkWeb": {
         "additionalProperties": false,
         "description": "Chunk from the web.",
         "properties": {
            "domain": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Domain of the (original) URI.",
               "title": "Domain"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the chunk.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the chunk.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkWeb",
         "type": "object"
      },
      "GroundingMetadata": {
         "additionalProperties": false,
         "description": "Metadata returned to client when grounding is enabled.",
         "properties": {
            "groundingChunks": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingChunk"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of supporting references retrieved from specified grounding source.",
               "title": "Groundingchunks"
            },
            "groundingSupports": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingSupport"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. List of grounding support.",
               "title": "Groundingsupports"
            },
            "retrievalMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetrievalMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output only. Retrieval metadata."
            },
            "retrievalQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Queries executed by the retrieval tools.",
               "title": "Retrievalqueries"
            },
            "searchEntryPoint": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SearchEntryPoint"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google search entry for the following-up web searches."
            },
            "webSearchQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web search queries for the following-up web search.",
               "title": "Websearchqueries"
            }
         },
         "title": "GroundingMetadata",
         "type": "object"
      },
      "GroundingSupport": {
         "additionalProperties": false,
         "description": "Grounding support.",
         "properties": {
            "confidenceScores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
               "title": "Confidencescores"
            },
            "groundingChunkIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.",
               "title": "Groundingchunkindices"
            },
            "segment": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Segment"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Segment of the content this support belongs to."
            }
         },
         "title": "GroundingSupport",
         "type": "object"
      },
      "HarmCategory": {
         "description": "Required. Harm category.",
         "enum": [
            "HARM_CATEGORY_UNSPECIFIED",
            "HARM_CATEGORY_HATE_SPEECH",
            "HARM_CATEGORY_DANGEROUS_CONTENT",
            "HARM_CATEGORY_HARASSMENT",
            "HARM_CATEGORY_SEXUALLY_EXPLICIT",
            "HARM_CATEGORY_CIVIC_INTEGRITY"
         ],
         "title": "HarmCategory",
         "type": "string"
      },
      "HarmProbability": {
         "description": "Output only. Harm probability levels in the content.",
         "enum": [
            "HARM_PROBABILITY_UNSPECIFIED",
            "NEGLIGIBLE",
            "LOW",
            "MEDIUM",
            "HIGH"
         ],
         "title": "HarmProbability",
         "type": "string"
      },
      "HarmSeverity": {
         "description": "Output only. Harm severity levels in the content.",
         "enum": [
            "HARM_SEVERITY_UNSPECIFIED",
            "HARM_SEVERITY_NEGLIGIBLE",
            "HARM_SEVERITY_LOW",
            "HARM_SEVERITY_MEDIUM",
            "HARM_SEVERITY_HIGH"
         ],
         "title": "HarmSeverity",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LogprobsResult": {
         "additionalProperties": false,
         "description": "Logprobs Result",
         "properties": {
            "chosenCandidates": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/LogprobsResultCandidate"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.",
               "title": "Chosencandidates"
            },
            "topCandidates": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/LogprobsResultTopCandidates"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Length = total number of decoding steps.",
               "title": "Topcandidates"
            }
         },
         "title": "LogprobsResult",
         "type": "object"
      },
      "LogprobsResultCandidate": {
         "additionalProperties": false,
         "description": "Candidate for the logprobs token and score.",
         "properties": {
            "logProbability": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's log probability.",
               "title": "Logprobability"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token string value.",
               "title": "Token"
            },
            "tokenId": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token id value.",
               "title": "Tokenid"
            }
         },
         "title": "LogprobsResultCandidate",
         "type": "object"
      },
      "LogprobsResultTopCandidates": {
         "additionalProperties": false,
         "description": "Candidates with top log probabilities at each decoding step.",
         "properties": {
            "candidates": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/LogprobsResultCandidate"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sorted by log probability in descending order.",
               "title": "Candidates"
            }
         },
         "title": "LogprobsResultTopCandidates",
         "type": "object"
      },
      "MediaModality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "VIDEO",
            "AUDIO",
            "DOCUMENT"
         ],
         "title": "MediaModality",
         "type": "string"
      },
      "ModalityTokenCount": {
         "additionalProperties": false,
         "description": "Represents token counting info for a single modality.",
         "properties": {
            "modality": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaModality"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The modality associated with this token count."
            },
            "tokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens.",
               "title": "Tokencount"
            }
         },
         "title": "ModalityTokenCount",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "RetrievalMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to retrieval in the grounding flow.",
         "properties": {
            "googleSearchDynamicRetrievalScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.",
               "title": "Googlesearchdynamicretrievalscore"
            }
         },
         "title": "RetrievalMetadata",
         "type": "object"
      },
      "SafetyRating": {
         "additionalProperties": false,
         "description": "Safety rating corresponding to the generated content.",
         "properties": {
            "blocked": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Indicates whether the content was filtered out because of this rating.",
               "title": "Blocked"
            },
            "category": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmCategory"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm category."
            },
            "probability": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmProbability"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm probability levels in the content."
            },
            "probabilityScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm probability score.",
               "title": "Probabilityscore"
            },
            "severity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmSeverity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm severity levels in the content."
            },
            "severityScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm severity score.",
               "title": "Severityscore"
            }
         },
         "title": "SafetyRating",
         "type": "object"
      },
      "SearchEntryPoint": {
         "additionalProperties": false,
         "description": "Google search entry point.",
         "properties": {
            "renderedContent": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
               "title": "Renderedcontent"
            },
            "sdkBlob": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Base64 encoded JSON representing array of tuple.",
               "title": "Sdkblob"
            }
         },
         "title": "SearchEntryPoint",
         "type": "object"
      },
      "Segment": {
         "additionalProperties": false,
         "description": "Segment of the content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
               "title": "Endindex"
            },
            "partIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The index of a Part object within its parent Content object.",
               "title": "Partindex"
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.",
               "title": "Startindex"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The text corresponding to the segment from the response.",
               "title": "Text"
            }
         },
         "title": "Segment",
         "type": "object"
      },
      "TrafficType": {
         "description": "Output only.\n\nTraffic type. This shows whether a request consumes Pay-As-You-Go or\nProvisioned Throughput quota.",
         "enum": [
            "TRAFFIC_TYPE_UNSPECIFIED",
            "ON_DEMAND",
            "PROVISIONED_THROUGHPUT"
         ],
         "title": "TrafficType",
         "type": "string"
      },
      "UrlContextMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to url context retrieval tool.",
         "properties": {
            "urlMetadata": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/UrlMetadata"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of url context.",
               "title": "Urlmetadata"
            }
         },
         "title": "UrlContextMetadata",
         "type": "object"
      },
      "UrlMetadata": {
         "additionalProperties": false,
         "description": "Context for a single url retrieval.",
         "properties": {
            "retrievedUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URL retrieved by the tool.",
               "title": "Retrievedurl"
            },
            "urlRetrievalStatus": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlRetrievalStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Status of the url retrieval."
            }
         },
         "title": "UrlMetadata",
         "type": "object"
      },
      "UrlRetrievalStatus": {
         "description": "Status of the url retrieval.",
         "enum": [
            "URL_RETRIEVAL_STATUS_UNSPECIFIED",
            "URL_RETRIEVAL_STATUS_SUCCESS",
            "URL_RETRIEVAL_STATUS_ERROR"
         ],
         "title": "UrlRetrievalStatus",
         "type": "string"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field automatic_function_calling_history: Optional[list[Content]] = None (alias 'automaticFunctionCallingHistory')
field candidates: Optional[list[Candidate]] = None

Response variations returned by the model.

field create_time: Optional[datetime] = None (alias 'createTime')

Timestamp when the request is made to the server.

field model_version: Optional[str] = None (alias 'modelVersion')

Output only. The model version used to generate the response.

field parsed: Union[BaseModel, dict[Any, Any], Enum, None] = None

First candidate from the parsed response if response_schema is provided. Not available for streaming.

field prompt_feedback: Optional[GenerateContentResponsePromptFeedback] = None (alias 'promptFeedback')

Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.

field response_id: Optional[str] = None (alias 'responseId')

Identifier for each response.

field usage_metadata: Optional[GenerateContentResponseUsageMetadata] = None (alias 'usageMetadata')

Usage metadata about the response(s).

property code_execution_result: str | None

Returns the code execution result in the response.

property executable_code: str | None

Returns the executable code in the response.

property function_calls: list[FunctionCall] | None

Returns the list of function calls in the response.

property text: str | None

Returns the concatenation of all text parts in the response.

class genai.types.GenerateContentResponseDict

Bases: TypedDict

Response message for PredictionService.GenerateContent.

candidates: Optional[list[CandidateDict]]

Response variations returned by the model.

create_time: Optional[datetime]

Timestamp when the request is made to the server.

model_version: Optional[str]

Output only. The model version used to generate the response.

prompt_feedback: Optional[GenerateContentResponsePromptFeedbackDict]

Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.

Type:

Output only. Content filter results for a prompt sent in the request. Note

response_id: Optional[str]

Identifier for each response.

usage_metadata: Optional[GenerateContentResponseUsageMetadataDict]

Usage metadata about the response(s).

pydantic model genai.types.GenerateContentResponsePromptFeedback

Bases: BaseModel

Content filter results for a prompt sent in the request.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateContentResponsePromptFeedback",
   "description": "Content filter results for a prompt sent in the request.",
   "type": "object",
   "properties": {
      "blockReason": {
         "anyOf": [
            {
               "$ref": "#/$defs/BlockedReason"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Blocked reason."
      },
      "blockReasonMessage": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. A readable block reason message.",
         "title": "Blockreasonmessage"
      },
      "safetyRatings": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/SafetyRating"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Safety ratings.",
         "title": "Safetyratings"
      }
   },
   "$defs": {
      "BlockedReason": {
         "description": "Output only. Blocked reason.",
         "enum": [
            "BLOCKED_REASON_UNSPECIFIED",
            "SAFETY",
            "OTHER",
            "BLOCKLIST",
            "PROHIBITED_CONTENT"
         ],
         "title": "BlockedReason",
         "type": "string"
      },
      "HarmCategory": {
         "description": "Required. Harm category.",
         "enum": [
            "HARM_CATEGORY_UNSPECIFIED",
            "HARM_CATEGORY_HATE_SPEECH",
            "HARM_CATEGORY_DANGEROUS_CONTENT",
            "HARM_CATEGORY_HARASSMENT",
            "HARM_CATEGORY_SEXUALLY_EXPLICIT",
            "HARM_CATEGORY_CIVIC_INTEGRITY"
         ],
         "title": "HarmCategory",
         "type": "string"
      },
      "HarmProbability": {
         "description": "Output only. Harm probability levels in the content.",
         "enum": [
            "HARM_PROBABILITY_UNSPECIFIED",
            "NEGLIGIBLE",
            "LOW",
            "MEDIUM",
            "HIGH"
         ],
         "title": "HarmProbability",
         "type": "string"
      },
      "HarmSeverity": {
         "description": "Output only. Harm severity levels in the content.",
         "enum": [
            "HARM_SEVERITY_UNSPECIFIED",
            "HARM_SEVERITY_NEGLIGIBLE",
            "HARM_SEVERITY_LOW",
            "HARM_SEVERITY_MEDIUM",
            "HARM_SEVERITY_HIGH"
         ],
         "title": "HarmSeverity",
         "type": "string"
      },
      "SafetyRating": {
         "additionalProperties": false,
         "description": "Safety rating corresponding to the generated content.",
         "properties": {
            "blocked": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Indicates whether the content was filtered out because of this rating.",
               "title": "Blocked"
            },
            "category": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmCategory"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm category."
            },
            "probability": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmProbability"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm probability levels in the content."
            },
            "probabilityScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm probability score.",
               "title": "Probabilityscore"
            },
            "severity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HarmSeverity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm severity levels in the content."
            },
            "severityScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Harm severity score.",
               "title": "Severityscore"
            }
         },
         "title": "SafetyRating",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field block_reason: Optional[BlockedReason] = None (alias 'blockReason')

Output only. Blocked reason.

field block_reason_message: Optional[str] = None (alias 'blockReasonMessage')

Output only. A readable block reason message.

field safety_ratings: Optional[list[SafetyRating]] = None (alias 'safetyRatings')

Output only. Safety ratings.

class genai.types.GenerateContentResponsePromptFeedbackDict

Bases: TypedDict

Content filter results for a prompt sent in the request.

block_reason: Optional[BlockedReason]

Output only. Blocked reason.

block_reason_message: Optional[str]

Output only. A readable block reason message.

safety_ratings: Optional[list[SafetyRatingDict]]

Output only. Safety ratings.

pydantic model genai.types.GenerateContentResponseUsageMetadata

Bases: BaseModel

Usage metadata about response(s).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateContentResponseUsageMetadata",
   "description": "Usage metadata about response(s).",
   "type": "object",
   "properties": {
      "cacheTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. List of modalities of the cached content in the request input.",
         "title": "Cachetokensdetails"
      },
      "cachedContentTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of tokens in the cached part in the input (the cached content).",
         "title": "Cachedcontenttokencount"
      },
      "candidatesTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens in the response(s).",
         "title": "Candidatestokencount"
      },
      "candidatesTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. List of modalities that were returned in the response.",
         "title": "Candidatestokensdetails"
      },
      "promptTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens in the request. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.",
         "title": "Prompttokencount"
      },
      "promptTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. List of modalities that were processed in the request input.",
         "title": "Prompttokensdetails"
      },
      "thoughtsTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of tokens present in thoughts output.",
         "title": "Thoughtstokencount"
      },
      "toolUsePromptTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of tokens present in tool-use prompt(s).",
         "title": "Tooluseprompttokencount"
      },
      "toolUsePromptTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. List of modalities that were processed for tool-use request inputs.",
         "title": "Tooluseprompttokensdetails"
      },
      "totalTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total token count for prompt, response candidates, and tool-use prompts (if present).",
         "title": "Totaltokencount"
      },
      "trafficType": {
         "anyOf": [
            {
               "$ref": "#/$defs/TrafficType"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota."
      }
   },
   "$defs": {
      "MediaModality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "VIDEO",
            "AUDIO",
            "DOCUMENT"
         ],
         "title": "MediaModality",
         "type": "string"
      },
      "ModalityTokenCount": {
         "additionalProperties": false,
         "description": "Represents token counting info for a single modality.",
         "properties": {
            "modality": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaModality"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The modality associated with this token count."
            },
            "tokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens.",
               "title": "Tokencount"
            }
         },
         "title": "ModalityTokenCount",
         "type": "object"
      },
      "TrafficType": {
         "description": "Output only.\n\nTraffic type. This shows whether a request consumes Pay-As-You-Go or\nProvisioned Throughput quota.",
         "enum": [
            "TRAFFIC_TYPE_UNSPECIFIED",
            "ON_DEMAND",
            "PROVISIONED_THROUGHPUT"
         ],
         "title": "TrafficType",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field cache_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'cacheTokensDetails')

Output only. List of modalities of the cached content in the request input.

field cached_content_token_count: Optional[int] = None (alias 'cachedContentTokenCount')

Output only. Number of tokens in the cached part in the input (the cached content).

field candidates_token_count: Optional[int] = None (alias 'candidatesTokenCount')

Number of tokens in the response(s).

field candidates_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'candidatesTokensDetails')

Output only. List of modalities that were returned in the response.

field prompt_token_count: Optional[int] = None (alias 'promptTokenCount')

Number of tokens in the request. When cached_content is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.

field prompt_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'promptTokensDetails')

Output only. List of modalities that were processed in the request input.

field thoughts_token_count: Optional[int] = None (alias 'thoughtsTokenCount')

Output only. Number of tokens present in thoughts output.

field tool_use_prompt_token_count: Optional[int] = None (alias 'toolUsePromptTokenCount')

Output only. Number of tokens present in tool-use prompt(s).

field tool_use_prompt_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'toolUsePromptTokensDetails')

Output only. List of modalities that were processed for tool-use request inputs.

field total_token_count: Optional[int] = None (alias 'totalTokenCount')

Total token count for prompt, response candidates, and tool-use prompts (if present).

field traffic_type: Optional[TrafficType] = None (alias 'trafficType')

Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota.

class genai.types.GenerateContentResponseUsageMetadataDict

Bases: TypedDict

Usage metadata about response(s).

cache_tokens_details: Optional[list[ModalityTokenCountDict]]

Output only. List of modalities of the cached content in the request input.

cached_content_token_count: Optional[int]

Output only. Number of tokens in the cached part in the input (the cached content).

candidates_token_count: Optional[int]

Number of tokens in the response(s).

candidates_tokens_details: Optional[list[ModalityTokenCountDict]]

Output only. List of modalities that were returned in the response.

prompt_token_count: Optional[int]

Number of tokens in the request. When cached_content is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.

prompt_tokens_details: Optional[list[ModalityTokenCountDict]]

Output only. List of modalities that were processed in the request input.

thoughts_token_count: Optional[int]

Output only. Number of tokens present in thoughts output.

tool_use_prompt_token_count: Optional[int]

Output only. Number of tokens present in tool-use prompt(s).

tool_use_prompt_tokens_details: Optional[list[ModalityTokenCountDict]]

Output only. List of modalities that were processed for tool-use request inputs.

total_token_count: Optional[int]

Total token count for prompt, response candidates, and tool-use prompts (if present).

traffic_type: Optional[TrafficType]

Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota.

pydantic model genai.types.GenerateImagesConfig

Bases: BaseModel

The config for generating an images.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateImagesConfig",
   "description": "The config for generating an images.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "outputGcsUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cloud Storage URI used to store the generated images.\n      ",
         "title": "Outputgcsuri"
      },
      "negativePrompt": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of what to discourage in the generated images.\n      ",
         "title": "Negativeprompt"
      },
      "numberOfImages": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of images to generate.\n      ",
         "title": "Numberofimages"
      },
      "aspectRatio": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Aspect ratio of the generated images.\n      ",
         "title": "Aspectratio"
      },
      "guidanceScale": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls how much the model adheres to the text prompt. Large\n      values increase output and prompt alignment, but may compromise image\n      quality.\n      ",
         "title": "Guidancescale"
      },
      "seed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Random seed for image generation. This is not available when\n      ``add_watermark`` is set to true.\n      ",
         "title": "Seed"
      },
      "safetyFilterLevel": {
         "anyOf": [
            {
               "$ref": "#/$defs/SafetyFilterLevel"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Filter level for safety filtering.\n      "
      },
      "personGeneration": {
         "anyOf": [
            {
               "$ref": "#/$defs/PersonGeneration"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Allows generation of people by the model.\n      "
      },
      "includeSafetyAttributes": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to report the safety scores of each generated image and\n      the positive prompt in the response.\n      ",
         "title": "Includesafetyattributes"
      },
      "includeRaiReason": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to include the Responsible AI filter reason if the image\n      is filtered out of the response.\n      ",
         "title": "Includeraireason"
      },
      "language": {
         "anyOf": [
            {
               "$ref": "#/$defs/ImagePromptLanguage"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Language of the text in the prompt.\n      "
      },
      "outputMimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "MIME type of the generated image.\n      ",
         "title": "Outputmimetype"
      },
      "outputCompressionQuality": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Compression quality of the generated image (for ``image/jpeg``\n      only).\n      ",
         "title": "Outputcompressionquality"
      },
      "addWatermark": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to add a watermark to the generated images.\n      ",
         "title": "Addwatermark"
      },
      "enhancePrompt": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to use the prompt rewriting logic.\n      ",
         "title": "Enhanceprompt"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "ImagePromptLanguage": {
         "description": "Enum that specifies the language of the text in the prompt.",
         "enum": [
            "auto",
            "en",
            "ja",
            "ko",
            "hi"
         ],
         "title": "ImagePromptLanguage",
         "type": "string"
      },
      "PersonGeneration": {
         "description": "Enum that controls the generation of people.",
         "enum": [
            "DONT_ALLOW",
            "ALLOW_ADULT",
            "ALLOW_ALL"
         ],
         "title": "PersonGeneration",
         "type": "string"
      },
      "SafetyFilterLevel": {
         "description": "Enum that controls the safety filter level for objectionable content.",
         "enum": [
            "BLOCK_LOW_AND_ABOVE",
            "BLOCK_MEDIUM_AND_ABOVE",
            "BLOCK_ONLY_HIGH",
            "BLOCK_NONE"
         ],
         "title": "SafetyFilterLevel",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field add_watermark: Optional[bool] = None (alias 'addWatermark')

Whether to add a watermark to the generated images.

field aspect_ratio: Optional[str] = None (alias 'aspectRatio')

Aspect ratio of the generated images.

field enhance_prompt: Optional[bool] = None (alias 'enhancePrompt')

Whether to use the prompt rewriting logic.

field guidance_scale: Optional[float] = None (alias 'guidanceScale')

Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field include_rai_reason: Optional[bool] = None (alias 'includeRaiReason')

Whether to include the Responsible AI filter reason if the image is filtered out of the response.

field include_safety_attributes: Optional[bool] = None (alias 'includeSafetyAttributes')

Whether to report the safety scores of each generated image and the positive prompt in the response.

field language: Optional[ImagePromptLanguage] = None

Language of the text in the prompt.

field negative_prompt: Optional[str] = None (alias 'negativePrompt')

Description of what to discourage in the generated images.

field number_of_images: Optional[int] = None (alias 'numberOfImages')

Number of images to generate.

field output_compression_quality: Optional[int] = None (alias 'outputCompressionQuality')

Compression quality of the generated image (for image/jpeg only).

field output_gcs_uri: Optional[str] = None (alias 'outputGcsUri')

Cloud Storage URI used to store the generated images.

field output_mime_type: Optional[str] = None (alias 'outputMimeType')

MIME type of the generated image.

field person_generation: Optional[PersonGeneration] = None (alias 'personGeneration')

Allows generation of people by the model.

field safety_filter_level: Optional[SafetyFilterLevel] = None (alias 'safetyFilterLevel')

Filter level for safety filtering.

field seed: Optional[int] = None

Random seed for image generation. This is not available when add_watermark is set to true.

class genai.types.GenerateImagesConfigDict

Bases: TypedDict

The config for generating an images.

add_watermark: Optional[bool]

Whether to add a watermark to the generated images.

aspect_ratio: Optional[str]

Aspect ratio of the generated images.

enhance_prompt: Optional[bool]

Whether to use the prompt rewriting logic.

guidance_scale: Optional[float]

Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

include_rai_reason: Optional[bool]

Whether to include the Responsible AI filter reason if the image is filtered out of the response.

include_safety_attributes: Optional[bool]

Whether to report the safety scores of each generated image and the positive prompt in the response.

language: Optional[ImagePromptLanguage]

Language of the text in the prompt.

negative_prompt: Optional[str]

Description of what to discourage in the generated images.

number_of_images: Optional[int]

Number of images to generate.

output_compression_quality: Optional[int]

Compression quality of the generated image (for image/jpeg only).

output_gcs_uri: Optional[str]

Cloud Storage URI used to store the generated images.

output_mime_type: Optional[str]

MIME type of the generated image.

person_generation: Optional[PersonGeneration]

Allows generation of people by the model.

safety_filter_level: Optional[SafetyFilterLevel]

Filter level for safety filtering.

seed: Optional[int]

Random seed for image generation. This is not available when add_watermark is set to true.

pydantic model genai.types.GenerateImagesResponse

Bases: BaseModel

The output images response.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateImagesResponse",
   "description": "The output images response.",
   "type": "object",
   "properties": {
      "generatedImages": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/GeneratedImage"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of generated images.\n      ",
         "title": "Generatedimages"
      },
      "positivePromptSafetyAttributes": {
         "anyOf": [
            {
               "$ref": "#/$defs/SafetyAttributes"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Safety attributes of the positive prompt. Only populated if\n      ``include_safety_attributes`` is set to True.\n      "
      }
   },
   "$defs": {
      "GeneratedImage": {
         "additionalProperties": false,
         "description": "An output image.",
         "properties": {
            "image": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Image"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The output image data.\n      "
            },
            "raiFilteredReason": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Responsible AI filter reason if the image is filtered out of the\n      response.\n      ",
               "title": "Raifilteredreason"
            },
            "safetyAttributes": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SafetyAttributes"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Safety attributes of the image. Lists of RAI categories and their\n      scores of each content.\n      "
            },
            "enhancedPrompt": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The rewritten prompt used for the image generation if the prompt\n      enhancer is enabled.\n      ",
               "title": "Enhancedprompt"
            }
         },
         "title": "GeneratedImage",
         "type": "object"
      },
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "SafetyAttributes": {
         "additionalProperties": false,
         "description": "Safety attributes of a GeneratedImage or the user-provided prompt.",
         "properties": {
            "categories": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of RAI categories.\n      ",
               "title": "Categories"
            },
            "scores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of scores of each categories.\n      ",
               "title": "Scores"
            },
            "contentType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Internal use only.\n      ",
               "title": "Contenttype"
            }
         },
         "title": "SafetyAttributes",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field generated_images: Optional[list[GeneratedImage]] = None (alias 'generatedImages')

List of generated images.

field positive_prompt_safety_attributes: Optional[SafetyAttributes] = None (alias 'positivePromptSafetyAttributes')

Safety attributes of the positive prompt. Only populated if include_safety_attributes is set to True.

class genai.types.GenerateImagesResponseDict

Bases: TypedDict

The output images response.

generated_images: Optional[list[GeneratedImageDict]]

List of generated images.

positive_prompt_safety_attributes: Optional[SafetyAttributesDict]

Safety attributes of the positive prompt. Only populated if include_safety_attributes is set to True.

pydantic model genai.types.GenerateVideosConfig

Bases: BaseModel

Configuration for generating videos.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateVideosConfig",
   "description": "Configuration for generating videos.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "numberOfVideos": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of output videos.",
         "title": "Numberofvideos"
      },
      "outputGcsUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The gcs bucket where to save the generated videos.",
         "title": "Outputgcsuri"
      },
      "fps": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Frames per second for video generation.",
         "title": "Fps"
      },
      "durationSeconds": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Duration of the clip for video generation in seconds.",
         "title": "Durationseconds"
      },
      "seed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The RNG seed. If RNG seed is exactly same for each request with unchanged inputs, the prediction results will be consistent. Otherwise, a random RNG seed will be used each time to produce a different result.",
         "title": "Seed"
      },
      "aspectRatio": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The aspect ratio for the generated video. 16:9 (landscape) and 9:16 (portrait) are supported.",
         "title": "Aspectratio"
      },
      "resolution": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The resolution for the generated video. 1280x720, 1920x1080 are supported.",
         "title": "Resolution"
      },
      "personGeneration": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether allow to generate person videos, and restrict to specific ages. Supported values are: dont_allow, allow_adult.",
         "title": "Persongeneration"
      },
      "pubsubTopic": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The pubsub topic where to publish the video generation progress.",
         "title": "Pubsubtopic"
      },
      "negativePrompt": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional field in addition to the text content. Negative prompts can be explicitly stated here to help generate the video.",
         "title": "Negativeprompt"
      },
      "enhancePrompt": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to use the prompt rewriting logic.",
         "title": "Enhanceprompt"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field aspect_ratio: Optional[str] = None (alias 'aspectRatio')

The aspect ratio for the generated video. 16:9 (landscape) and 9:16 (portrait) are supported.

field duration_seconds: Optional[int] = None (alias 'durationSeconds')

Duration of the clip for video generation in seconds.

field enhance_prompt: Optional[bool] = None (alias 'enhancePrompt')

Whether to use the prompt rewriting logic.

field fps: Optional[int] = None

Frames per second for video generation.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field negative_prompt: Optional[str] = None (alias 'negativePrompt')

Optional field in addition to the text content. Negative prompts can be explicitly stated here to help generate the video.

field number_of_videos: Optional[int] = None (alias 'numberOfVideos')

Number of output videos.

field output_gcs_uri: Optional[str] = None (alias 'outputGcsUri')

The gcs bucket where to save the generated videos.

field person_generation: Optional[str] = None (alias 'personGeneration')

Whether allow to generate person videos, and restrict to specific ages. Supported values are: dont_allow, allow_adult.

field pubsub_topic: Optional[str] = None (alias 'pubsubTopic')

The pubsub topic where to publish the video generation progress.

field resolution: Optional[str] = None

The resolution for the generated video. 1280x720, 1920x1080 are supported.

field seed: Optional[int] = None

The RNG seed. If RNG seed is exactly same for each request with unchanged inputs, the prediction results will be consistent. Otherwise, a random RNG seed will be used each time to produce a different result.

class genai.types.GenerateVideosConfigDict

Bases: TypedDict

Configuration for generating videos.

aspect_ratio: Optional[str]

16 (portrait) are supported.

Type:

The aspect ratio for the generated video. 16

Type:

9 (landscape) and 9

duration_seconds: Optional[int]

Duration of the clip for video generation in seconds.

enhance_prompt: Optional[bool]

Whether to use the prompt rewriting logic.

fps: Optional[int]

Frames per second for video generation.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

negative_prompt: Optional[str]

Optional field in addition to the text content. Negative prompts can be explicitly stated here to help generate the video.

number_of_videos: Optional[int]

Number of output videos.

output_gcs_uri: Optional[str]

The gcs bucket where to save the generated videos.

person_generation: Optional[str]

dont_allow, allow_adult.

Type:

Whether allow to generate person videos, and restrict to specific ages. Supported values are

pubsub_topic: Optional[str]

The pubsub topic where to publish the video generation progress.

resolution: Optional[str]

The resolution for the generated video. 1280x720, 1920x1080 are supported.

seed: Optional[int]

The RNG seed. If RNG seed is exactly same for each request with unchanged inputs, the prediction results will be consistent. Otherwise, a random RNG seed will be used each time to produce a different result.

pydantic model genai.types.GenerateVideosOperation

Bases: BaseModel

A video generation operation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateVideosOperation",
   "description": "A video generation operation.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
         "title": "Name"
      },
      "metadata": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata.  Any method that returns a long-running operation should document the metadata type, if any.",
         "title": "Metadata"
      },
      "done": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.",
         "title": "Done"
      },
      "error": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The error result of the operation in case of failure or cancellation.",
         "title": "Error"
      },
      "response": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerateVideosResponse"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The generated videos."
      },
      "result": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerateVideosResponse"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The generated videos."
      }
   },
   "$defs": {
      "GenerateVideosResponse": {
         "additionalProperties": false,
         "description": "Response with generated videos.",
         "properties": {
            "generatedVideos": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GeneratedVideo"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of the generated videos",
               "title": "Generatedvideos"
            },
            "raiMediaFilteredCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Returns if any videos were filtered due to RAI policies.",
               "title": "Raimediafilteredcount"
            },
            "raiMediaFilteredReasons": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Returns rai failure reasons if any.",
               "title": "Raimediafilteredreasons"
            }
         },
         "title": "GenerateVideosResponse",
         "type": "object"
      },
      "GeneratedVideo": {
         "additionalProperties": false,
         "description": "A generated video.",
         "properties": {
            "video": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Video"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The output video"
            }
         },
         "title": "GeneratedVideo",
         "type": "object"
      },
      "Video": {
         "additionalProperties": false,
         "description": "A generated video.",
         "properties": {
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Path to another storage.",
               "title": "Uri"
            },
            "videoBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Video bytes.",
               "title": "Videobytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Video encoding, for example \"video/mp4\".",
               "title": "Mimetype"
            }
         },
         "title": "Video",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field done: Optional[bool] = None

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

field error: Optional[dict[str, Any]] = None

The error result of the operation in case of failure or cancellation.

field metadata: Optional[dict[str, Any]] = None

Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.

field name: Optional[str] = None

The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.

field response: Optional[GenerateVideosResponse] = None

The generated videos.

field result: Optional[GenerateVideosResponse] = None

The generated videos.

class genai.types.GenerateVideosOperationDict

Bases: TypedDict

A video generation operation.

done: Optional[bool]

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

error: Optional[dict[str, Any]]

The error result of the operation in case of failure or cancellation.

metadata: Optional[dict[str, Any]]

Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.

name: Optional[str]

The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.

response: Optional[GenerateVideosResponseDict]

The generated videos.

result: Optional[GenerateVideosResponseDict]

The generated videos.

pydantic model genai.types.GenerateVideosResponse

Bases: BaseModel

Response with generated videos.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerateVideosResponse",
   "description": "Response with generated videos.",
   "type": "object",
   "properties": {
      "generatedVideos": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/GeneratedVideo"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of the generated videos",
         "title": "Generatedvideos"
      },
      "raiMediaFilteredCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Returns if any videos were filtered due to RAI policies.",
         "title": "Raimediafilteredcount"
      },
      "raiMediaFilteredReasons": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Returns rai failure reasons if any.",
         "title": "Raimediafilteredreasons"
      }
   },
   "$defs": {
      "GeneratedVideo": {
         "additionalProperties": false,
         "description": "A generated video.",
         "properties": {
            "video": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Video"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The output video"
            }
         },
         "title": "GeneratedVideo",
         "type": "object"
      },
      "Video": {
         "additionalProperties": false,
         "description": "A generated video.",
         "properties": {
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Path to another storage.",
               "title": "Uri"
            },
            "videoBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Video bytes.",
               "title": "Videobytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Video encoding, for example \"video/mp4\".",
               "title": "Mimetype"
            }
         },
         "title": "Video",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field generated_videos: Optional[list[GeneratedVideo]] = None (alias 'generatedVideos')

List of the generated videos

field rai_media_filtered_count: Optional[int] = None (alias 'raiMediaFilteredCount')

Returns if any videos were filtered due to RAI policies.

field rai_media_filtered_reasons: Optional[list[str]] = None (alias 'raiMediaFilteredReasons')

Returns rai failure reasons if any.

class genai.types.GenerateVideosResponseDict

Bases: TypedDict

Response with generated videos.

generated_videos: Optional[list[GeneratedVideoDict]]

List of the generated videos

rai_media_filtered_count: Optional[int]

Returns if any videos were filtered due to RAI policies.

rai_media_filtered_reasons: Optional[list[str]]

Returns rai failure reasons if any.

pydantic model genai.types.GeneratedImage

Bases: BaseModel

An output image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GeneratedImage",
   "description": "An output image.",
   "type": "object",
   "properties": {
      "image": {
         "anyOf": [
            {
               "$ref": "#/$defs/Image"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The output image data.\n      "
      },
      "raiFilteredReason": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Responsible AI filter reason if the image is filtered out of the\n      response.\n      ",
         "title": "Raifilteredreason"
      },
      "safetyAttributes": {
         "anyOf": [
            {
               "$ref": "#/$defs/SafetyAttributes"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Safety attributes of the image. Lists of RAI categories and their\n      scores of each content.\n      "
      },
      "enhancedPrompt": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The rewritten prompt used for the image generation if the prompt\n      enhancer is enabled.\n      ",
         "title": "Enhancedprompt"
      }
   },
   "$defs": {
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "SafetyAttributes": {
         "additionalProperties": false,
         "description": "Safety attributes of a GeneratedImage or the user-provided prompt.",
         "properties": {
            "categories": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of RAI categories.\n      ",
               "title": "Categories"
            },
            "scores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of scores of each categories.\n      ",
               "title": "Scores"
            },
            "contentType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Internal use only.\n      ",
               "title": "Contenttype"
            }
         },
         "title": "SafetyAttributes",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field enhanced_prompt: Optional[str] = None (alias 'enhancedPrompt')

The rewritten prompt used for the image generation if the prompt enhancer is enabled.

field image: Optional[Image] = None

The output image data.

field rai_filtered_reason: Optional[str] = None (alias 'raiFilteredReason')

Responsible AI filter reason if the image is filtered out of the response.

field safety_attributes: Optional[SafetyAttributes] = None (alias 'safetyAttributes')

Safety attributes of the image. Lists of RAI categories and their scores of each content.

class genai.types.GeneratedImageDict

Bases: TypedDict

An output image.

enhanced_prompt: Optional[str]

The rewritten prompt used for the image generation if the prompt enhancer is enabled.

image: Optional[ImageDict]

The output image data.

rai_filtered_reason: Optional[str]

Responsible AI filter reason if the image is filtered out of the response.

safety_attributes: Optional[SafetyAttributesDict]

Safety attributes of the image. Lists of RAI categories and their scores of each content.

pydantic model genai.types.GeneratedVideo

Bases: BaseModel

A generated video.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GeneratedVideo",
   "description": "A generated video.",
   "type": "object",
   "properties": {
      "video": {
         "anyOf": [
            {
               "$ref": "#/$defs/Video"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The output video"
      }
   },
   "$defs": {
      "Video": {
         "additionalProperties": false,
         "description": "A generated video.",
         "properties": {
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Path to another storage.",
               "title": "Uri"
            },
            "videoBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Video bytes.",
               "title": "Videobytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Video encoding, for example \"video/mp4\".",
               "title": "Mimetype"
            }
         },
         "title": "Video",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field video: Optional[Video] = None

The output video

class genai.types.GeneratedVideoDict

Bases: TypedDict

A generated video.

video: Optional[VideoDict]

The output video

pydantic model genai.types.GenerationConfig

Bases: BaseModel

Generation config.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerationConfig",
   "description": "Generation config.",
   "type": "object",
   "properties": {
      "audioTimestamp": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
         "title": "Audiotimestamp"
      },
      "candidateCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Number of candidates to generate.",
         "title": "Candidatecount"
      },
      "frequencyPenalty": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Frequency penalties.",
         "title": "Frequencypenalty"
      },
      "logprobs": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Logit probabilities.",
         "title": "Logprobs"
      },
      "maxOutputTokens": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The maximum number of output tokens to generate per message.",
         "title": "Maxoutputtokens"
      },
      "mediaResolution": {
         "anyOf": [
            {
               "$ref": "#/$defs/MediaResolution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. If specified, the media resolution specified will be used."
      },
      "presencePenalty": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Positive penalties.",
         "title": "Presencepenalty"
      },
      "responseLogprobs": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. If true, export the logprobs results in response.",
         "title": "Responselogprobs"
      },
      "responseMimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
         "title": "Responsemimetype"
      },
      "responseSchema": {
         "anyOf": [
            {
               "$ref": "#/$defs/Schema"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
      },
      "routingConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerationConfigRoutingConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Routing configuration."
      },
      "seed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Seed.",
         "title": "Seed"
      },
      "stopSequences": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Stop sequences.",
         "title": "Stopsequences"
      },
      "temperature": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Controls the randomness of predictions.",
         "title": "Temperature"
      },
      "topK": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. If specified, top-k sampling will be used.",
         "title": "Topk"
      },
      "topP": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. If specified, nucleus sampling will be used.",
         "title": "Topp"
      }
   },
   "$defs": {
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field audio_timestamp: Optional[bool] = None (alias 'audioTimestamp')

Optional. If enabled, audio timestamp will be included in the request to the model.

field candidate_count: Optional[int] = None (alias 'candidateCount')

Optional. Number of candidates to generate.

field frequency_penalty: Optional[float] = None (alias 'frequencyPenalty')

Optional. Frequency penalties.

field logprobs: Optional[int] = None

Optional. Logit probabilities.

field max_output_tokens: Optional[int] = None (alias 'maxOutputTokens')

Optional. The maximum number of output tokens to generate per message.

field media_resolution: Optional[MediaResolution] = None (alias 'mediaResolution')

Optional. If specified, the media resolution specified will be used.

field presence_penalty: Optional[float] = None (alias 'presencePenalty')

Optional. Positive penalties.

field response_logprobs: Optional[bool] = None (alias 'responseLogprobs')

Optional. If true, export the logprobs results in response.

field response_mime_type: Optional[str] = None (alias 'responseMimeType')

Optional. Output response mimetype of the generated candidate text. Supported mimetype: - text/plain: (default) Text output. - application/json: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.

field response_schema: Optional[Schema] = None (alias 'responseSchema')

Optional. The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: application/json: Schema for JSON response.

field routing_config: Optional[GenerationConfigRoutingConfig] = None (alias 'routingConfig')

Optional. Routing configuration.

field seed: Optional[int] = None

Optional. Seed.

field stop_sequences: Optional[list[str]] = None (alias 'stopSequences')

Optional. Stop sequences.

field temperature: Optional[float] = None

Optional. Controls the randomness of predictions.

field top_k: Optional[float] = None (alias 'topK')

Optional. If specified, top-k sampling will be used.

field top_p: Optional[float] = None (alias 'topP')

Optional. If specified, nucleus sampling will be used.

class genai.types.GenerationConfigDict

Bases: TypedDict

Generation config.

audio_timestamp: Optional[bool]

Optional. If enabled, audio timestamp will be included in the request to the model.

candidate_count: Optional[int]

Optional. Number of candidates to generate.

frequency_penalty: Optional[float]

Optional. Frequency penalties.

logprobs: Optional[int]

Optional. Logit probabilities.

max_output_tokens: Optional[int]

Optional. The maximum number of output tokens to generate per message.

media_resolution: Optional[MediaResolution]

Optional. If specified, the media resolution specified will be used.

presence_penalty: Optional[float]

Optional. Positive penalties.

response_logprobs: Optional[bool]

Optional. If true, export the logprobs results in response.

response_mime_type: Optional[str]

(default) Text output. - application/json: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.

Type:

Optional. Output response mimetype of the generated candidate text. Supported mimetype

Type:
  • text/plain

response_schema: Optional[SchemaDict]

application/json: Schema for JSON response.

Type:

Optional. The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https

Type:

//spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes

routing_config: Optional[GenerationConfigRoutingConfigDict]

Optional. Routing configuration.

seed: Optional[int]

Optional. Seed.

stop_sequences: Optional[list[str]]

Optional. Stop sequences.

temperature: Optional[float]

Optional. Controls the randomness of predictions.

top_k: Optional[float]

Optional. If specified, top-k sampling will be used.

top_p: Optional[float]

Optional. If specified, nucleus sampling will be used.

pydantic model genai.types.GenerationConfigRoutingConfig

Bases: BaseModel

The configuration for routing the request to a specific model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerationConfigRoutingConfig",
   "description": "The configuration for routing the request to a specific model.",
   "type": "object",
   "properties": {
      "autoMode": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Automated routing."
      },
      "manualMode": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Manual routing."
      }
   },
   "$defs": {
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingMode] = None (alias 'autoMode')

Automated routing.

field manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingMode] = None (alias 'manualMode')

Manual routing.

pydantic model genai.types.GenerationConfigRoutingConfigAutoRoutingMode

Bases: BaseModel

When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerationConfigRoutingConfigAutoRoutingMode",
   "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
   "type": "object",
   "properties": {
      "modelRoutingPreference": {
         "anyOf": [
            {
               "enum": [
                  "UNKNOWN",
                  "PRIORITIZE_QUALITY",
                  "BALANCED",
                  "PRIORITIZE_COST"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The model routing preference.",
         "title": "Modelroutingpreference"
      }
   },
   "additionalProperties": false
}

Fields:
field model_routing_preference: Optional[Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']] = None (alias 'modelRoutingPreference')

The model routing preference.

class genai.types.GenerationConfigRoutingConfigAutoRoutingModeDict

Bases: TypedDict

When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.

model_routing_preference: Optional[Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']]

The model routing preference.

class genai.types.GenerationConfigRoutingConfigDict

Bases: TypedDict

The configuration for routing the request to a specific model.

auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingModeDict]

Automated routing.

manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingModeDict]

Manual routing.

pydantic model genai.types.GenerationConfigRoutingConfigManualRoutingMode

Bases: BaseModel

When manual routing is set, the specified model will be used directly.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GenerationConfigRoutingConfigManualRoutingMode",
   "description": "When manual routing is set, the specified model will be used directly.",
   "type": "object",
   "properties": {
      "modelName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
         "title": "Modelname"
      }
   },
   "additionalProperties": false
}

Fields:
field model_name: Optional[str] = None (alias 'modelName')

The model name to use. Only the public LLM models are accepted. e.g. ‘gemini-1.5-pro-001’.

class genai.types.GenerationConfigRoutingConfigManualRoutingModeDict

Bases: TypedDict

When manual routing is set, the specified model will be used directly.

model_name: Optional[str]

The model name to use. Only the public LLM models are accepted. e.g. ‘gemini-1.5-pro-001’.

pydantic model genai.types.GetBatchJobConfig

Bases: BaseModel

Optional parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GetBatchJobConfig",
   "description": "Optional parameters.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.GetBatchJobConfigDict

Bases: TypedDict

Optional parameters.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.GetCachedContentConfig

Bases: BaseModel

Optional parameters for caches.get method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GetCachedContentConfig",
   "description": "Optional parameters for caches.get method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.GetCachedContentConfigDict

Bases: TypedDict

Optional parameters for caches.get method.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.GetFileConfig

Bases: BaseModel

Used to override the default configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GetFileConfig",
   "description": "Used to override the default configuration.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.GetFileConfigDict

Bases: TypedDict

Used to override the default configuration.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.GetModelConfig

Bases: BaseModel

Optional parameters for models.get method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GetModelConfig",
   "description": "Optional parameters for models.get method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.GetModelConfigDict

Bases: TypedDict

Optional parameters for models.get method.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.GetOperationConfig

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GetOperationConfig",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.GetOperationConfigDict

Bases: TypedDict

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.GetTuningJobConfig

Bases: BaseModel

Optional parameters for tunings.get method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GetTuningJobConfig",
   "description": "Optional parameters for tunings.get method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.GetTuningJobConfigDict

Bases: TypedDict

Optional parameters for tunings.get method.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.GoogleMaps

Bases: BaseModel

Tool to support Google Maps in Model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GoogleMaps",
   "description": "Tool to support Google Maps in Model.",
   "type": "object",
   "properties": {
      "authConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/AuthConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Auth config for the Google Maps tool."
      }
   },
   "$defs": {
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field auth_config: Optional[AuthConfig] = None (alias 'authConfig')

Optional. Auth config for the Google Maps tool.

class genai.types.GoogleMapsDict

Bases: TypedDict

Tool to support Google Maps in Model.

auth_config: Optional[AuthConfigDict]

Optional. Auth config for the Google Maps tool.

pydantic model genai.types.GoogleRpcStatus

Bases: BaseModel

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs.

It is used by [gRPC](https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GoogleRpcStatus",
   "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs.\n\nIt is used by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details. You can\nfind out more about this error model and how to work with it in the [API\nDesign Guide](https://cloud.google.com/apis/design/errors).",
   "type": "object",
   "properties": {
      "code": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The status code, which should be an enum value of google.rpc.Code.",
         "title": "Code"
      },
      "details": {
         "anyOf": [
            {
               "items": {
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
         "title": "Details"
      },
      "message": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
         "title": "Message"
      }
   },
   "additionalProperties": false
}

Fields:
field code: Optional[int] = None

The status code, which should be an enum value of google.rpc.Code.

field details: Optional[list[dict[str, Any]]] = None

A list of messages that carry the error details. There is a common set of message types for APIs to use.

field message: Optional[str] = None

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.

class genai.types.GoogleRpcStatusDict

Bases: TypedDict

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs.

It is used by [gRPC](https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).

code: Optional[int]

The status code, which should be an enum value of google.rpc.Code.

details: Optional[list[dict[str, Any]]]

A list of messages that carry the error details. There is a common set of message types for APIs to use.

message: Optional[str]

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.

pydantic model genai.types.GoogleSearch

Bases: BaseModel

Tool to support Google Search in Model. Powered by Google.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GoogleSearch",
   "description": "Tool to support Google Search in Model. Powered by Google.",
   "type": "object",
   "properties": {
      "timeRangeFilter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Interval"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
      }
   },
   "$defs": {
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field time_range_filter: Optional[Interval] = None (alias 'timeRangeFilter')

Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).

class genai.types.GoogleSearchDict

Bases: TypedDict

Tool to support Google Search in Model. Powered by Google.

time_range_filter: Optional[IntervalDict]

Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).

pydantic model genai.types.GoogleSearchRetrieval

Bases: BaseModel

Tool to retrieve public web data for grounding, powered by Google.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GoogleSearchRetrieval",
   "description": "Tool to retrieve public web data for grounding, powered by Google.",
   "type": "object",
   "properties": {
      "dynamicRetrievalConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/DynamicRetrievalConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Specifies the dynamic retrieval configuration for the given source."
      }
   },
   "$defs": {
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field dynamic_retrieval_config: Optional[DynamicRetrievalConfig] = None (alias 'dynamicRetrievalConfig')

Specifies the dynamic retrieval configuration for the given source.

class genai.types.GoogleSearchRetrievalDict

Bases: TypedDict

Tool to retrieve public web data for grounding, powered by Google.

dynamic_retrieval_config: Optional[DynamicRetrievalConfigDict]

Specifies the dynamic retrieval configuration for the given source.

pydantic model genai.types.GoogleTypeDate

Bases: BaseModel

Represents a whole or partial calendar date, such as a birthday.

The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GoogleTypeDate",
   "description": "Represents a whole or partial calendar date, such as a birthday.\n\nThe time of day and time zone are either specified elsewhere or are\ninsignificant. The date is relative to the Gregorian Calendar. This can\nrepresent one of the following: * A full date, with non-zero year, month, and\nday values. * A month and day, with a zero year (for example, an anniversary).\n* A year on its own, with a zero month and a zero day. * A year and month,\nwith a zero day (for example, a credit card expiration date). Related types: *\ngoogle.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp",
   "type": "object",
   "properties": {
      "day": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.",
         "title": "Day"
      },
      "month": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.",
         "title": "Month"
      },
      "year": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.",
         "title": "Year"
      }
   },
   "additionalProperties": false
}

Fields:
field day: Optional[int] = None

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn’t significant.

field month: Optional[int] = None

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

field year: Optional[int] = None

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

class genai.types.GoogleTypeDateDict

Bases: TypedDict

Represents a whole or partial calendar date, such as a birthday.

The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp

day: Optional[int]

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn’t significant.

month: Optional[int]

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

year: Optional[int]

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

pydantic model genai.types.GroundingChunk

Bases: BaseModel

Grounding chunk.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GroundingChunk",
   "description": "Grounding chunk.",
   "type": "object",
   "properties": {
      "retrievedContext": {
         "anyOf": [
            {
               "$ref": "#/$defs/GroundingChunkRetrievedContext"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Grounding chunk from context retrieved by the retrieval tools."
      },
      "web": {
         "anyOf": [
            {
               "$ref": "#/$defs/GroundingChunkWeb"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Grounding chunk from the web."
      }
   },
   "$defs": {
      "GroundingChunkRetrievedContext": {
         "additionalProperties": false,
         "description": "Chunk from context retrieved by the retrieval tools.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text of the attribution.",
               "title": "Text"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkRetrievedContext",
         "type": "object"
      },
      "GroundingChunkWeb": {
         "additionalProperties": false,
         "description": "Chunk from the web.",
         "properties": {
            "domain": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Domain of the (original) URI.",
               "title": "Domain"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the chunk.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the chunk.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkWeb",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field retrieved_context: Optional[GroundingChunkRetrievedContext] = None (alias 'retrievedContext')

Grounding chunk from context retrieved by the retrieval tools.

field web: Optional[GroundingChunkWeb] = None

Grounding chunk from the web.

class genai.types.GroundingChunkDict

Bases: TypedDict

Grounding chunk.

retrieved_context: Optional[GroundingChunkRetrievedContextDict]

Grounding chunk from context retrieved by the retrieval tools.

web: Optional[GroundingChunkWebDict]

Grounding chunk from the web.

pydantic model genai.types.GroundingChunkRetrievedContext

Bases: BaseModel

Chunk from context retrieved by the retrieval tools.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GroundingChunkRetrievedContext",
   "description": "Chunk from context retrieved by the retrieval tools.",
   "type": "object",
   "properties": {
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Text of the attribution.",
         "title": "Text"
      },
      "title": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Title of the attribution.",
         "title": "Title"
      },
      "uri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "URI reference of the attribution.",
         "title": "Uri"
      }
   },
   "additionalProperties": false
}

Fields:
field text: Optional[str] = None

Text of the attribution.

field title: Optional[str] = None

Title of the attribution.

field uri: Optional[str] = None

URI reference of the attribution.

class genai.types.GroundingChunkRetrievedContextDict

Bases: TypedDict

Chunk from context retrieved by the retrieval tools.

text: Optional[str]

Text of the attribution.

title: Optional[str]

Title of the attribution.

uri: Optional[str]

URI reference of the attribution.

pydantic model genai.types.GroundingChunkWeb

Bases: BaseModel

Chunk from the web.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GroundingChunkWeb",
   "description": "Chunk from the web.",
   "type": "object",
   "properties": {
      "domain": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Domain of the (original) URI.",
         "title": "Domain"
      },
      "title": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Title of the chunk.",
         "title": "Title"
      },
      "uri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "URI reference of the chunk.",
         "title": "Uri"
      }
   },
   "additionalProperties": false
}

Fields:
field domain: Optional[str] = None

Domain of the (original) URI.

field title: Optional[str] = None

Title of the chunk.

field uri: Optional[str] = None

URI reference of the chunk.

class genai.types.GroundingChunkWebDict

Bases: TypedDict

Chunk from the web.

domain: Optional[str]

Domain of the (original) URI.

title: Optional[str]

Title of the chunk.

uri: Optional[str]

URI reference of the chunk.

pydantic model genai.types.GroundingMetadata

Bases: BaseModel

Metadata returned to client when grounding is enabled.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GroundingMetadata",
   "description": "Metadata returned to client when grounding is enabled.",
   "type": "object",
   "properties": {
      "groundingChunks": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/GroundingChunk"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of supporting references retrieved from specified grounding source.",
         "title": "Groundingchunks"
      },
      "groundingSupports": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/GroundingSupport"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. List of grounding support.",
         "title": "Groundingsupports"
      },
      "retrievalMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/RetrievalMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Output only. Retrieval metadata."
      },
      "retrievalQueries": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Queries executed by the retrieval tools.",
         "title": "Retrievalqueries"
      },
      "searchEntryPoint": {
         "anyOf": [
            {
               "$ref": "#/$defs/SearchEntryPoint"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Google search entry for the following-up web searches."
      },
      "webSearchQueries": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Web search queries for the following-up web search.",
         "title": "Websearchqueries"
      }
   },
   "$defs": {
      "GroundingChunk": {
         "additionalProperties": false,
         "description": "Grounding chunk.",
         "properties": {
            "retrievedContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkRetrievedContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from context retrieved by the retrieval tools."
            },
            "web": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkWeb"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from the web."
            }
         },
         "title": "GroundingChunk",
         "type": "object"
      },
      "GroundingChunkRetrievedContext": {
         "additionalProperties": false,
         "description": "Chunk from context retrieved by the retrieval tools.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text of the attribution.",
               "title": "Text"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkRetrievedContext",
         "type": "object"
      },
      "GroundingChunkWeb": {
         "additionalProperties": false,
         "description": "Chunk from the web.",
         "properties": {
            "domain": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Domain of the (original) URI.",
               "title": "Domain"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the chunk.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the chunk.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkWeb",
         "type": "object"
      },
      "GroundingSupport": {
         "additionalProperties": false,
         "description": "Grounding support.",
         "properties": {
            "confidenceScores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
               "title": "Confidencescores"
            },
            "groundingChunkIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.",
               "title": "Groundingchunkindices"
            },
            "segment": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Segment"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Segment of the content this support belongs to."
            }
         },
         "title": "GroundingSupport",
         "type": "object"
      },
      "RetrievalMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to retrieval in the grounding flow.",
         "properties": {
            "googleSearchDynamicRetrievalScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.",
               "title": "Googlesearchdynamicretrievalscore"
            }
         },
         "title": "RetrievalMetadata",
         "type": "object"
      },
      "SearchEntryPoint": {
         "additionalProperties": false,
         "description": "Google search entry point.",
         "properties": {
            "renderedContent": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
               "title": "Renderedcontent"
            },
            "sdkBlob": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Base64 encoded JSON representing array of tuple.",
               "title": "Sdkblob"
            }
         },
         "title": "SearchEntryPoint",
         "type": "object"
      },
      "Segment": {
         "additionalProperties": false,
         "description": "Segment of the content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
               "title": "Endindex"
            },
            "partIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The index of a Part object within its parent Content object.",
               "title": "Partindex"
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.",
               "title": "Startindex"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The text corresponding to the segment from the response.",
               "title": "Text"
            }
         },
         "title": "Segment",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field grounding_chunks: Optional[list[GroundingChunk]] = None (alias 'groundingChunks')

List of supporting references retrieved from specified grounding source.

field grounding_supports: Optional[list[GroundingSupport]] = None (alias 'groundingSupports')

Optional. List of grounding support.

field retrieval_metadata: Optional[RetrievalMetadata] = None (alias 'retrievalMetadata')

Optional. Output only. Retrieval metadata.

field retrieval_queries: Optional[list[str]] = None (alias 'retrievalQueries')

Optional. Queries executed by the retrieval tools.

field search_entry_point: Optional[SearchEntryPoint] = None (alias 'searchEntryPoint')

Optional. Google search entry for the following-up web searches.

field web_search_queries: Optional[list[str]] = None (alias 'webSearchQueries')

Optional. Web search queries for the following-up web search.

class genai.types.GroundingMetadataDict

Bases: TypedDict

Metadata returned to client when grounding is enabled.

grounding_chunks: Optional[list[GroundingChunkDict]]

List of supporting references retrieved from specified grounding source.

grounding_supports: Optional[list[GroundingSupportDict]]

Optional. List of grounding support.

retrieval_metadata: Optional[RetrievalMetadataDict]

Optional. Output only. Retrieval metadata.

retrieval_queries: Optional[list[str]]

Optional. Queries executed by the retrieval tools.

search_entry_point: Optional[SearchEntryPointDict]

Optional. Google search entry for the following-up web searches.

web_search_queries: Optional[list[str]]

Optional. Web search queries for the following-up web search.

pydantic model genai.types.GroundingSupport

Bases: BaseModel

Grounding support.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "GroundingSupport",
   "description": "Grounding support.",
   "type": "object",
   "properties": {
      "confidenceScores": {
         "anyOf": [
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
         "title": "Confidencescores"
      },
      "groundingChunkIndices": {
         "anyOf": [
            {
               "items": {
                  "type": "integer"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.",
         "title": "Groundingchunkindices"
      },
      "segment": {
         "anyOf": [
            {
               "$ref": "#/$defs/Segment"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Segment of the content this support belongs to."
      }
   },
   "$defs": {
      "Segment": {
         "additionalProperties": false,
         "description": "Segment of the content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
               "title": "Endindex"
            },
            "partIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The index of a Part object within its parent Content object.",
               "title": "Partindex"
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.",
               "title": "Startindex"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The text corresponding to the segment from the response.",
               "title": "Text"
            }
         },
         "title": "Segment",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field confidence_scores: Optional[list[float]] = None (alias 'confidenceScores')

Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.

field grounding_chunk_indices: Optional[list[int]] = None (alias 'groundingChunkIndices')

A list of indices (into ‘grounding_chunk’) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.

field segment: Optional[Segment] = None

Segment of the content this support belongs to.

class genai.types.GroundingSupportDict

Bases: TypedDict

Grounding support.

confidence_scores: Optional[list[float]]

Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.

grounding_chunk_indices: Optional[list[int]]

A list of indices (into ‘grounding_chunk’) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.

segment: Optional[SegmentDict]

Segment of the content this support belongs to.

class genai.types.HarmBlockMethod(*values)

Bases: CaseInSensitiveEnum

Optional.

Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score.

HARM_BLOCK_METHOD_UNSPECIFIED = 'HARM_BLOCK_METHOD_UNSPECIFIED'

The harm block method is unspecified.

PROBABILITY = 'PROBABILITY'

The harm block method uses the probability score.

SEVERITY = 'SEVERITY'

The harm block method uses both probability and severity scores.

class genai.types.HarmBlockThreshold(*values)

Bases: CaseInSensitiveEnum

Required. The harm block threshold.

BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE'

Block low threshold and above (i.e. block more).

BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE'

Block medium threshold and above.

BLOCK_NONE = 'BLOCK_NONE'

Block none.

BLOCK_ONLY_HIGH = 'BLOCK_ONLY_HIGH'

Block only high threshold (i.e. block less).

HARM_BLOCK_THRESHOLD_UNSPECIFIED = 'HARM_BLOCK_THRESHOLD_UNSPECIFIED'

Unspecified harm block threshold.

OFF = 'OFF'

Turn off the safety filter.

class genai.types.HarmCategory(*values)

Bases: CaseInSensitiveEnum

Required. Harm category.

HARM_CATEGORY_CIVIC_INTEGRITY = 'HARM_CATEGORY_CIVIC_INTEGRITY'

The harm category is civic integrity.

HARM_CATEGORY_DANGEROUS_CONTENT = 'HARM_CATEGORY_DANGEROUS_CONTENT'

The harm category is dangerous content.

HARM_CATEGORY_HARASSMENT = 'HARM_CATEGORY_HARASSMENT'

The harm category is harassment.

HARM_CATEGORY_HATE_SPEECH = 'HARM_CATEGORY_HATE_SPEECH'

The harm category is hate speech.

HARM_CATEGORY_SEXUALLY_EXPLICIT = 'HARM_CATEGORY_SEXUALLY_EXPLICIT'

The harm category is sexually explicit content.

HARM_CATEGORY_UNSPECIFIED = 'HARM_CATEGORY_UNSPECIFIED'

The harm category is unspecified.

class genai.types.HarmProbability(*values)

Bases: CaseInSensitiveEnum

Output only. Harm probability levels in the content.

HARM_PROBABILITY_UNSPECIFIED = 'HARM_PROBABILITY_UNSPECIFIED'

Harm probability unspecified.

HIGH = 'HIGH'

High level of harm.

LOW = 'LOW'

Low level of harm.

MEDIUM = 'MEDIUM'

Medium level of harm.

NEGLIGIBLE = 'NEGLIGIBLE'

Negligible level of harm.

class genai.types.HarmSeverity(*values)

Bases: CaseInSensitiveEnum

Output only. Harm severity levels in the content.

HARM_SEVERITY_HIGH = 'HARM_SEVERITY_HIGH'

High level of harm severity.

HARM_SEVERITY_LOW = 'HARM_SEVERITY_LOW'

Low level of harm severity.

HARM_SEVERITY_MEDIUM = 'HARM_SEVERITY_MEDIUM'

Medium level of harm severity.

HARM_SEVERITY_NEGLIGIBLE = 'HARM_SEVERITY_NEGLIGIBLE'

Negligible level of harm severity.

HARM_SEVERITY_UNSPECIFIED = 'HARM_SEVERITY_UNSPECIFIED'

Harm severity unspecified.

pydantic model genai.types.HttpOptions

Bases: BaseModel

HTTP options to be used in each of the requests.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "HttpOptions",
   "description": "HTTP options to be used in each of the requests.",
   "type": "object",
   "properties": {
      "baseUrl": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The base URL for the AI platform service endpoint.",
         "title": "Baseurl"
      },
      "apiVersion": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Specifies the version of the API to use.",
         "title": "Apiversion"
      },
      "headers": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Additional HTTP headers to be sent with the request.",
         "title": "Headers"
      },
      "timeout": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Timeout for the request in milliseconds.",
         "title": "Timeout"
      },
      "clientArgs": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Args passed to the HTTP client.",
         "title": "Clientargs"
      },
      "asyncClientArgs": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Args passed to the async HTTP client.",
         "title": "Asyncclientargs"
      }
   },
   "additionalProperties": false
}

Fields:
field api_version: Optional[str] = None (alias 'apiVersion')

Specifies the version of the API to use.

field async_client_args: Optional[dict[str, Any]] = None (alias 'asyncClientArgs')

Args passed to the async HTTP client.

field base_url: Optional[str] = None (alias 'baseUrl')

The base URL for the AI platform service endpoint.

field client_args: Optional[dict[str, Any]] = None (alias 'clientArgs')

Args passed to the HTTP client.

field headers: Optional[dict[str, str]] = None

Additional HTTP headers to be sent with the request.

field timeout: Optional[int] = None

Timeout for the request in milliseconds.

class genai.types.HttpOptionsDict

Bases: TypedDict

HTTP options to be used in each of the requests.

api_version: Optional[str]

Specifies the version of the API to use.

async_client_args: Optional[dict[str, Any]]

Args passed to the async HTTP client.

base_url: Optional[str]

The base URL for the AI platform service endpoint.

client_args: Optional[dict[str, Any]]

Args passed to the HTTP client.

headers: Optional[dict[str, str]]

Additional HTTP headers to be sent with the request.

timeout: Optional[int]

Timeout for the request in milliseconds.

pydantic model genai.types.Image

Bases: BaseModel

An image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Image",
   "description": "An image.",
   "type": "object",
   "properties": {
      "gcsUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
         "title": "Gcsuri"
      },
      "imageBytes": {
         "anyOf": [
            {
               "format": "base64url",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
         "title": "Imagebytes"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The MIME type of the image.",
         "title": "Mimetype"
      }
   },
   "additionalProperties": false
}

Fields:
field gcs_uri: Optional[str] = None (alias 'gcsUri')

The Cloud Storage URI of the image. Image can contain a value for this field or the image_bytes field but not both.

field image_bytes: Optional[bytes] = None (alias 'imageBytes')

The image bytes data. Image can contain a value for this field or the gcs_uri field but not both.

field mime_type: Optional[str] = None (alias 'mimeType')

The MIME type of the image.

classmethod from_file(*, location, mime_type=None)

Lazy-loads an image from a local file or Google Cloud Storage.

Return type:

Image

Parameters:
  • location – The local path or Google Cloud Storage URI from which to load the image.

  • mime_type – The MIME type of the image. If not provided, the MIME type will be automatically determined.

Returns:

A loaded image as an Image object.

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

save(location)

Saves the image to a file.

Return type:

None

Parameters:

location – Local path where to save the image.

show()

Shows the image.

This method only works in a notebook environment.

Return type:

None

class genai.types.ImageDict

Bases: TypedDict

An image.

gcs_uri: Optional[str]

The Cloud Storage URI of the image. Image can contain a value for this field or the image_bytes field but not both.

image_bytes: Optional[bytes]

The image bytes data. Image can contain a value for this field or the gcs_uri field but not both.

mime_type: Optional[str]

The MIME type of the image.

class genai.types.ImagePromptLanguage(*values)

Bases: CaseInSensitiveEnum

Enum that specifies the language of the text in the prompt.

auto = 'auto'
en = 'en'
hi = 'hi'
ja = 'ja'
ko = 'ko'
pydantic model genai.types.Interval

Bases: BaseModel

Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).

The start time must be less than or equal to the end time. When the start equals the end time, the interval is an empty interval. (matches no time) When both start and end are unspecified, the interval matches any time.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Interval",
   "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
   "type": "object",
   "properties": {
      "startTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The start time of the interval.",
         "title": "Starttime"
      },
      "endTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The end time of the interval.",
         "title": "Endtime"
      }
   },
   "additionalProperties": false
}

Fields:
field end_time: Optional[datetime] = None (alias 'endTime')

The end time of the interval.

field start_time: Optional[datetime] = None (alias 'startTime')

The start time of the interval.

class genai.types.IntervalDict

Bases: TypedDict

Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).

The start time must be less than or equal to the end time. When the start equals the end time, the interval is an empty interval. (matches no time) When both start and end are unspecified, the interval matches any time.

end_time: Optional[datetime]

The end time of the interval.

start_time: Optional[datetime]

The start time of the interval.

pydantic model genai.types.JSONSchema

Bases: BaseModel

A subset of JSON Schema according to 2020-12 JSON Schema draft.

Represents a subset of a JSON Schema object that is used by the Gemini model. The difference between this class and the Schema class is that this class is compatible with OpenAPI 3.1 schema objects. And the Schema class is used to make API call to Gemini model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "$defs": {
      "JSONSchema": {
         "description": "A subset of JSON Schema according to 2020-12 JSON Schema draft.\n\nRepresents a subset of a JSON Schema object that is used by the Gemini model.\nThe difference between this class and the Schema class is that this class is\ncompatible with OpenAPI 3.1 schema objects. And the Schema class is used to\nmake API call to Gemini model.",
         "properties": {
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JSONSchemaType"
                  },
                  {
                     "items": {
                        "$ref": "#/$defs/JSONSchemaType"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Validation succeeds if the type of the instance matches the type represented by the given type, or matches at least one of the given types.",
               "title": "Type"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Define semantic information about a string instance.",
               "title": "Format"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A preferably short description about the purpose of the instance described by the schema.",
               "title": "Title"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An explanation about the purpose of the instance described by the schema.",
               "title": "Description"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "This keyword can be used to supply a default JSON value associated with a particular schema.",
               "title": "Default"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JSONSchema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Validation succeeds if each element of the instance not covered by prefixItems validates against this schema."
            },
            "min_items": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An array instance is valid if its size is greater than, or equal to, the value of this keyword.",
               "title": "Min Items"
            },
            "max_items": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An array instance is valid if its size is less than, or equal to, the value of this keyword.",
               "title": "Max Items"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {},
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Validation succeeds if the instance is equal to one of the elements in this keyword\u2019s array value.",
               "title": "Enum"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/JSONSchema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Validation succeeds if, for each name that appears in both the instance and as a name within this keyword\u2019s value, the child instance for that name successfully validates against the corresponding schema.",
               "title": "Properties"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An object instance is valid against this keyword if every item in the array is the name of a property in the instance.",
               "title": "Required"
            },
            "min_properties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An object instance is valid if its number of properties is greater than, or equal to, the value of this keyword.",
               "title": "Min Properties"
            },
            "max_properties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An object instance is valid if its number of properties is less than, or equal to, the value of this keyword.",
               "title": "Max Properties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Validation succeeds if the numeric instance is greater than or equal to the given number.",
               "title": "Minimum"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Validation succeeds if the numeric instance is less than or equal to the given number.",
               "title": "Maximum"
            },
            "min_length": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.",
               "title": "Min Length"
            },
            "max_length": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.",
               "title": "Max Length"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A string instance is considered valid if the regular expression matches the instance successfully.",
               "title": "Pattern"
            },
            "any_of": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/JSONSchema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword\u2019s value.",
               "title": "Any Of"
            }
         },
         "title": "JSONSchema",
         "type": "object"
      },
      "JSONSchemaType": {
         "description": "The type of the data supported by JSON Schema.\n\nThe values of the enums are lower case strings, while the values of the enums\nfor the Type class are upper case strings.",
         "enum": [
            "null",
            "boolean",
            "object",
            "array",
            "number",
            "integer",
            "string"
         ],
         "title": "JSONSchemaType",
         "type": "string"
      }
   },
   "$ref": "#/$defs/JSONSchema"
}

Fields:
field any_of: Optional[list[JSONSchema]] = None

An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword’s value.

field default: Optional[Any] = None

This keyword can be used to supply a default JSON value associated with a particular schema.

field description: Optional[str] = None

An explanation about the purpose of the instance described by the schema.

field enum: Optional[list[Any]] = None

Validation succeeds if the instance is equal to one of the elements in this keyword’s array value.

field format: Optional[str] = None

Define semantic information about a string instance.

field items: Optional[JSONSchema] = None

Validation succeeds if each element of the instance not covered by prefixItems validates against this schema.

field max_items: Optional[int] = None

An array instance is valid if its size is less than, or equal to, the value of this keyword.

field max_length: Optional[int] = None

A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.

field max_properties: Optional[int] = None

An object instance is valid if its number of properties is less than, or equal to, the value of this keyword.

field maximum: Optional[float] = None

Validation succeeds if the numeric instance is less than or equal to the given number.

field min_items: Optional[int] = None

An array instance is valid if its size is greater than, or equal to, the value of this keyword.

field min_length: Optional[int] = None

A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.

field min_properties: Optional[int] = None

An object instance is valid if its number of properties is greater than, or equal to, the value of this keyword.

field minimum: Optional[float] = None

Validation succeeds if the numeric instance is greater than or equal to the given number.

field pattern: Optional[str] = None

A string instance is considered valid if the regular expression matches the instance successfully.

field properties: Optional[dict[str, JSONSchema]] = None

Validation succeeds if, for each name that appears in both the instance and as a name within this keyword’s value, the child instance for that name successfully validates against the corresponding schema.

field required: Optional[list[str]] = None

An object instance is valid against this keyword if every item in the array is the name of a property in the instance.

field title: Optional[str] = None

A preferably short description about the purpose of the instance described by the schema.

field type: Union[JSONSchemaType, list[JSONSchemaType], None] = None

Validation succeeds if the type of the instance matches the type represented by the given type, or matches at least one of the given types.

class genai.types.JSONSchemaType(*values)

Bases: Enum

The type of the data supported by JSON Schema.

The values of the enums are lower case strings, while the values of the enums for the Type class are upper case strings.

ARRAY = 'array'
BOOLEAN = 'boolean'
INTEGER = 'integer'
NULL = 'null'
NUMBER = 'number'
OBJECT = 'object'
STRING = 'string'
pydantic model genai.types.JobError

Bases: BaseModel

Job error.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "JobError",
   "description": "Job error.",
   "type": "object",
   "properties": {
      "details": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
         "title": "Details"
      },
      "code": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The status code.",
         "title": "Code"
      },
      "message": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field.",
         "title": "Message"
      }
   },
   "additionalProperties": false
}

Fields:
field code: Optional[int] = None

The status code.

field details: Optional[list[str]] = None

A list of messages that carry the error details. There is a common set of message types for APIs to use.

field message: Optional[str] = None

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the details field.

class genai.types.JobErrorDict

Bases: TypedDict

Job error.

code: Optional[int]

The status code.

details: Optional[list[str]]

A list of messages that carry the error details. There is a common set of message types for APIs to use.

message: Optional[str]

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the details field.

class genai.types.JobState(*values)

Bases: CaseInSensitiveEnum

Job state.

JOB_STATE_CANCELLED = 'JOB_STATE_CANCELLED'

The job has been cancelled.

JOB_STATE_CANCELLING = 'JOB_STATE_CANCELLING'

The job is being cancelled. From this state the job may only go to either JOB_STATE_SUCCEEDED, JOB_STATE_FAILED or JOB_STATE_CANCELLED.

JOB_STATE_EXPIRED = 'JOB_STATE_EXPIRED'

The job has expired.

JOB_STATE_FAILED = 'JOB_STATE_FAILED'

The job failed.

JOB_STATE_PARTIALLY_SUCCEEDED = 'JOB_STATE_PARTIALLY_SUCCEEDED'

The job is partially succeeded, some results may be missing due to errors.

JOB_STATE_PAUSED = 'JOB_STATE_PAUSED'

The job has been stopped, and can be resumed.

JOB_STATE_PENDING = 'JOB_STATE_PENDING'

The service is preparing to run the job.

JOB_STATE_QUEUED = 'JOB_STATE_QUEUED'

The job has been just created or resumed and processing has not yet begun.

JOB_STATE_RUNNING = 'JOB_STATE_RUNNING'

The job is in progress.

JOB_STATE_SUCCEEDED = 'JOB_STATE_SUCCEEDED'

The job completed successfully.

JOB_STATE_UNSPECIFIED = 'JOB_STATE_UNSPECIFIED'

The job state is unspecified.

JOB_STATE_UPDATING = 'JOB_STATE_UPDATING'

The job is being updated. Only jobs in the JOB_STATE_RUNNING state can be updated. After updating, the job goes back to the JOB_STATE_RUNNING state.

class genai.types.Language(*values)

Bases: CaseInSensitiveEnum

Required. Programming language of the code.

LANGUAGE_UNSPECIFIED = 'LANGUAGE_UNSPECIFIED'

Unspecified language. This value should not be used.

PYTHON = 'PYTHON'

Python >= 3.10, with numpy and simpy available.

pydantic model genai.types.LatLng

Bases: BaseModel

An object that represents a latitude/longitude pair.

This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the <a href=”https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version”> WGS84 standard</a>. Values must be within normalized ranges.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LatLng",
   "description": "An object that represents a latitude/longitude pair.\n\nThis is expressed as a pair of doubles to represent degrees latitude and\ndegrees longitude. Unless specified otherwise, this object must conform to the\n<a href=\"https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version\">\nWGS84 standard</a>. Values must be within normalized ranges.",
   "type": "object",
   "properties": {
      "latitude": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].",
         "title": "Latitude"
      },
      "longitude": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]",
         "title": "Longitude"
      }
   },
   "additionalProperties": false
}

Fields:
field latitude: Optional[float] = None

The latitude in degrees. It must be in the range [-90.0, +90.0].

field longitude: Optional[float] = None

The longitude in degrees. It must be in the range [-180.0, +180.0]

class genai.types.LatLngDict

Bases: TypedDict

An object that represents a latitude/longitude pair.

This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the <a href=”https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version”> WGS84 standard</a>. Values must be within normalized ranges.

latitude: Optional[float]

The latitude in degrees. It must be in the range [-90.0, +90.0].

longitude: Optional[float]

The longitude in degrees. It must be in the range [-180.0, +180.0]

pydantic model genai.types.ListBatchJobsConfig

Bases: BaseModel

Config for optional parameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListBatchJobsConfig",
   "description": "Config for optional parameters.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "pageSize": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagesize"
      },
      "pageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagetoken"
      },
      "filter": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Filter"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field filter: Optional[str] = None
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field page_size: Optional[int] = None (alias 'pageSize')
field page_token: Optional[str] = None (alias 'pageToken')
class genai.types.ListBatchJobsConfigDict

Bases: TypedDict

Config for optional parameters.

filter: Optional[str]
http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

page_size: Optional[int]
page_token: Optional[str]
pydantic model genai.types.ListBatchJobsResponse

Bases: BaseModel

Config for batches.list return value.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListBatchJobsResponse",
   "description": "Config for batches.list return value.",
   "type": "object",
   "properties": {
      "nextPageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Nextpagetoken"
      },
      "batchJobs": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/BatchJob"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Batchjobs"
      }
   },
   "$defs": {
      "BatchJob": {
         "additionalProperties": false,
         "description": "Config for batches.create return value.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Resource name of the Job.",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The user-defined name of this Job.",
               "title": "Displayname"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JobState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The detailed state of the job."
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JobError"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Only populated when the job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED."
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the Job was created.",
               "title": "Createtime"
            },
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the Job entered any of the following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`.",
               "title": "Endtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the Job was most recently updated.",
               "title": "Updatetime"
            },
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the model that produces the predictions via the BatchJob.\n      ",
               "title": "Model"
            },
            "src": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BatchJobSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configuration for the input data.\n      "
            },
            "dest": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BatchJobDestination"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configuration for the output data.\n      "
            }
         },
         "title": "BatchJob",
         "type": "object"
      },
      "BatchJobDestination": {
         "additionalProperties": false,
         "description": "Config for `des` parameter.",
         "properties": {
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Storage format of the output files. Must be one of:\n      'jsonl', 'bigquery'.\n      ",
               "title": "Format"
            },
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Google Cloud Storage URI to the output file.\n      ",
               "title": "Gcsuri"
            },
            "bigqueryUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The BigQuery URI to the output table.\n      ",
               "title": "Bigqueryuri"
            }
         },
         "title": "BatchJobDestination",
         "type": "object"
      },
      "BatchJobSource": {
         "additionalProperties": false,
         "description": "Config for `src` parameter.",
         "properties": {
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Storage format of the input files. Must be one of:\n      'jsonl', 'bigquery'.\n      ",
               "title": "Format"
            },
            "gcsUri": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Google Cloud Storage URIs to input files.\n      ",
               "title": "Gcsuri"
            },
            "bigqueryUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The BigQuery URI to input table.\n      ",
               "title": "Bigqueryuri"
            }
         },
         "title": "BatchJobSource",
         "type": "object"
      },
      "JobError": {
         "additionalProperties": false,
         "description": "Job error.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code.",
               "title": "Code"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field.",
               "title": "Message"
            }
         },
         "title": "JobError",
         "type": "object"
      },
      "JobState": {
         "description": "Job state.",
         "enum": [
            "JOB_STATE_UNSPECIFIED",
            "JOB_STATE_QUEUED",
            "JOB_STATE_PENDING",
            "JOB_STATE_RUNNING",
            "JOB_STATE_SUCCEEDED",
            "JOB_STATE_FAILED",
            "JOB_STATE_CANCELLING",
            "JOB_STATE_CANCELLED",
            "JOB_STATE_PAUSED",
            "JOB_STATE_EXPIRED",
            "JOB_STATE_UPDATING",
            "JOB_STATE_PARTIALLY_SUCCEEDED"
         ],
         "title": "JobState",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field batch_jobs: Optional[list[BatchJob]] = None (alias 'batchJobs')
field next_page_token: Optional[str] = None (alias 'nextPageToken')
class genai.types.ListBatchJobsResponseDict

Bases: TypedDict

Config for batches.list return value.

batch_jobs: Optional[list[BatchJobDict]]
next_page_token: Optional[str]
pydantic model genai.types.ListCachedContentsConfig

Bases: BaseModel

Config for caches.list method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListCachedContentsConfig",
   "description": "Config for caches.list method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "pageSize": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagesize"
      },
      "pageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagetoken"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field page_size: Optional[int] = None (alias 'pageSize')
field page_token: Optional[str] = None (alias 'pageToken')
class genai.types.ListCachedContentsConfigDict

Bases: TypedDict

Config for caches.list method.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

page_size: Optional[int]
page_token: Optional[str]
pydantic model genai.types.ListCachedContentsResponse

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListCachedContentsResponse",
   "type": "object",
   "properties": {
      "nextPageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Nextpagetoken"
      },
      "cachedContents": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/CachedContent"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of cached contents.\n      ",
         "title": "Cachedcontents"
      }
   },
   "$defs": {
      "CachedContent": {
         "additionalProperties": false,
         "description": "A resource used in LLM queries for users to explicitly specify what to cache.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The server-generated resource name of the cached content.",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The user-generated meaningful display name of the cached content.",
               "title": "Displayname"
            },
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the publisher model to use for cached content.",
               "title": "Model"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Creation time of the cache entry.",
               "title": "Createtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "When the cache entry was last updated in UTC time.",
               "title": "Updatetime"
            },
            "expireTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Expiration time of the cached content.",
               "title": "Expiretime"
            },
            "usageMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CachedContentUsageMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata on the usage of the cached content."
            }
         },
         "title": "CachedContent",
         "type": "object"
      },
      "CachedContentUsageMetadata": {
         "additionalProperties": false,
         "description": "Metadata on the usage of the cached content.",
         "properties": {
            "audioDurationSeconds": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Duration of audio in seconds.",
               "title": "Audiodurationseconds"
            },
            "imageCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of images.",
               "title": "Imagecount"
            },
            "textCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of text characters.",
               "title": "Textcount"
            },
            "totalTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total number of tokens that the cached content consumes.",
               "title": "Totaltokencount"
            },
            "videoDurationSeconds": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Duration of video in seconds.",
               "title": "Videodurationseconds"
            }
         },
         "title": "CachedContentUsageMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field cached_contents: Optional[list[CachedContent]] = None (alias 'cachedContents')

List of cached contents.

field next_page_token: Optional[str] = None (alias 'nextPageToken')
class genai.types.ListCachedContentsResponseDict

Bases: TypedDict

cached_contents: Optional[list[CachedContentDict]]

List of cached contents.

next_page_token: Optional[str]
pydantic model genai.types.ListFilesConfig

Bases: BaseModel

Used to override the default configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListFilesConfig",
   "description": "Used to override the default configuration.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "pageSize": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagesize"
      },
      "pageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagetoken"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field page_size: Optional[int] = None (alias 'pageSize')
field page_token: Optional[str] = None (alias 'pageToken')
class genai.types.ListFilesConfigDict

Bases: TypedDict

Used to override the default configuration.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

page_size: Optional[int]
page_token: Optional[str]
pydantic model genai.types.ListFilesResponse

Bases: BaseModel

Response for the list files method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListFilesResponse",
   "description": "Response for the list files method.",
   "type": "object",
   "properties": {
      "nextPageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A token to retrieve next page of results.",
         "title": "Nextpagetoken"
      },
      "files": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/File"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The list of files.",
         "title": "Files"
      }
   },
   "$defs": {
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field files: Optional[list[File]] = None

The list of files.

field next_page_token: Optional[str] = None (alias 'nextPageToken')

A token to retrieve next page of results.

class genai.types.ListFilesResponseDict

Bases: TypedDict

Response for the list files method.

files: Optional[list[FileDict]]

The list of files.

next_page_token: Optional[str]

A token to retrieve next page of results.

pydantic model genai.types.ListModelsConfig

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListModelsConfig",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "pageSize": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagesize"
      },
      "pageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagetoken"
      },
      "filter": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Filter"
      },
      "queryBase": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Set true to list base models, false to list tuned models.",
         "title": "Querybase"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field filter: Optional[str] = None
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field page_size: Optional[int] = None (alias 'pageSize')
field page_token: Optional[str] = None (alias 'pageToken')
field query_base: Optional[bool] = None (alias 'queryBase')

Set true to list base models, false to list tuned models.

class genai.types.ListModelsConfigDict

Bases: TypedDict

filter: Optional[str]
http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

page_size: Optional[int]
page_token: Optional[str]
query_base: Optional[bool]

Set true to list base models, false to list tuned models.

pydantic model genai.types.ListModelsResponse

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListModelsResponse",
   "type": "object",
   "properties": {
      "nextPageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Nextpagetoken"
      },
      "models": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Model"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Models"
      }
   },
   "$defs": {
      "Checkpoint": {
         "additionalProperties": false,
         "description": "Describes the machine learning model version checkpoint.",
         "properties": {
            "checkpointId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the checkpoint.\n      ",
               "title": "Checkpointid"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The epoch of the checkpoint.\n      ",
               "title": "Epoch"
            },
            "step": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The step of the checkpoint.\n      ",
               "title": "Step"
            }
         },
         "title": "Checkpoint",
         "type": "object"
      },
      "Endpoint": {
         "additionalProperties": false,
         "description": "An endpoint where you deploy models.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Resource name of the endpoint.",
               "title": "Name"
            },
            "deployedModelId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "ID of the model that's deployed to the endpoint.",
               "title": "Deployedmodelid"
            }
         },
         "title": "Endpoint",
         "type": "object"
      },
      "Model": {
         "additionalProperties": false,
         "description": "A trained machine learning model.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Resource name of the model.",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Display name of the model.",
               "title": "Displayname"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the model.",
               "title": "Description"
            },
            "version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Version ID of the model. A new version is committed when a new\n      model version is uploaded or trained under an existing model ID. The\n      version ID is an auto-incrementing decimal number in string\n      representation.",
               "title": "Version"
            },
            "endpoints": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Endpoint"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of deployed models created from this base model. Note that a\n      model could have been deployed to endpoints in different locations.",
               "title": "Endpoints"
            },
            "labels": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Labels with user-defined metadata to organize your models.",
               "title": "Labels"
            },
            "tunedModelInfo": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TunedModelInfo"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Information about the tuned model from the base model."
            },
            "inputTokenLimit": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of input tokens that the model can handle.",
               "title": "Inputtokenlimit"
            },
            "outputTokenLimit": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of output tokens that the model can generate.",
               "title": "Outputtokenlimit"
            },
            "supportedActions": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of actions that are supported by the model.",
               "title": "Supportedactions"
            },
            "defaultCheckpointId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The default checkpoint id of a model version.\n      ",
               "title": "Defaultcheckpointid"
            },
            "checkpoints": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Checkpoint"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The checkpoints of the model.",
               "title": "Checkpoints"
            }
         },
         "title": "Model",
         "type": "object"
      },
      "TunedModelInfo": {
         "additionalProperties": false,
         "description": "A tuned machine learning model.",
         "properties": {
            "baseModel": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "ID of the base model that you want to tune.",
               "title": "Basemodel"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Date and time when the base model was created.",
               "title": "Createtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Date and time when the base model was last updated.",
               "title": "Updatetime"
            }
         },
         "title": "TunedModelInfo",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field models: Optional[list[Model]] = None
field next_page_token: Optional[str] = None (alias 'nextPageToken')
class genai.types.ListModelsResponseDict

Bases: TypedDict

models: Optional[list[ModelDict]]
next_page_token: Optional[str]
pydantic model genai.types.ListTuningJobsConfig

Bases: BaseModel

Configuration for the list tuning jobs method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListTuningJobsConfig",
   "description": "Configuration for the list tuning jobs method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "pageSize": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagesize"
      },
      "pageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Pagetoken"
      },
      "filter": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Filter"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field filter: Optional[str] = None
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field page_size: Optional[int] = None (alias 'pageSize')
field page_token: Optional[str] = None (alias 'pageToken')
class genai.types.ListTuningJobsConfigDict

Bases: TypedDict

Configuration for the list tuning jobs method.

filter: Optional[str]
http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

page_size: Optional[int]
page_token: Optional[str]
pydantic model genai.types.ListTuningJobsResponse

Bases: BaseModel

Response for the list tuning jobs method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ListTuningJobsResponse",
   "description": "Response for the list tuning jobs method.",
   "type": "object",
   "properties": {
      "nextPageToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A token to retrieve the next page of results. Pass to ListTuningJobsRequest.page_token to obtain that page.",
         "title": "Nextpagetoken"
      },
      "tuningJobs": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/TuningJob"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of TuningJobs in the requested page.",
         "title": "Tuningjobs"
      }
   },
   "$defs": {
      "AdapterSize": {
         "description": "Optional. Adapter size for tuning.",
         "enum": [
            "ADAPTER_SIZE_UNSPECIFIED",
            "ADAPTER_SIZE_ONE",
            "ADAPTER_SIZE_TWO",
            "ADAPTER_SIZE_FOUR",
            "ADAPTER_SIZE_EIGHT",
            "ADAPTER_SIZE_SIXTEEN",
            "ADAPTER_SIZE_THIRTY_TWO"
         ],
         "title": "AdapterSize",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DatasetDistribution": {
         "additionalProperties": false,
         "description": "Distribution computed over a tuning dataset.",
         "properties": {
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/DatasetDistributionDistributionBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "DatasetDistribution",
         "type": "object"
      },
      "DatasetDistributionDistributionBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "DatasetDistributionDistributionBucket",
         "type": "object"
      },
      "DatasetStats": {
         "additionalProperties": false,
         "description": "Statistics computed over a tuning dataset.",
         "properties": {
            "totalBillableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable characters in the tuning dataset.",
               "title": "Totalbillablecharactercount"
            },
            "totalTuningCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning characters in the tuning dataset.",
               "title": "Totaltuningcharactercount"
            },
            "tuningDatasetExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of examples in the tuning dataset.",
               "title": "Tuningdatasetexamplecount"
            },
            "tuningStepCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning steps for this Tuning Job.",
               "title": "Tuningstepcount"
            },
            "userDatasetExamples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sample user messages in the training dataset uri.",
               "title": "Userdatasetexamples"
            },
            "userInputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user input tokens."
            },
            "userMessagePerExampleDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the messages per example."
            },
            "userOutputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user output tokens."
            }
         },
         "title": "DatasetStats",
         "type": "object"
      },
      "DistillationDataStats": {
         "additionalProperties": false,
         "description": "Statistics computed for datasets used for distillation.",
         "properties": {
            "trainingDatasetStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Statistics computed for the training dataset."
            }
         },
         "title": "DistillationDataStats",
         "type": "object"
      },
      "DistillationHyperParameters": {
         "additionalProperties": false,
         "description": "Hyperparameters for Distillation.",
         "properties": {
            "adapterSize": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AdapterSize"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Adapter size for distillation."
            },
            "epochCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
               "title": "Epochcount"
            },
            "learningRateMultiplier": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Multiplier for adjusting the default learning rate.",
               "title": "Learningratemultiplier"
            }
         },
         "title": "DistillationHyperParameters",
         "type": "object"
      },
      "DistillationSpec": {
         "additionalProperties": false,
         "description": "Tuning Spec for Distillation.",
         "properties": {
            "baseTeacherModel": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base teacher model that is being distilled, e.g., \"gemini-1.0-pro-002\".",
               "title": "Baseteachermodel"
            },
            "hyperParameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DistillationHyperParameters"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Hyperparameters for Distillation."
            },
            "pipelineRootDirectory": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts.",
               "title": "Pipelinerootdirectory"
            },
            "studentModel": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The student model that is being tuned, e.g., \"google/gemma-2b-1.1-it\".",
               "title": "Studentmodel"
            },
            "trainingDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Trainingdataseturi"
            },
            "tunedTeacherModelSource": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`.",
               "title": "Tunedteachermodelsource"
            },
            "validationDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Validationdataseturi"
            }
         },
         "title": "DistillationSpec",
         "type": "object"
      },
      "EncryptionSpec": {
         "additionalProperties": false,
         "description": "Represents a customer-managed encryption key spec that can be applied to a top-level resource.",
         "properties": {
            "kmsKeyName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.",
               "title": "Kmskeyname"
            }
         },
         "title": "EncryptionSpec",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GoogleRpcStatus": {
         "additionalProperties": false,
         "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs.\n\nIt is used by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details. You can\nfind out more about this error model and how to work with it in the [API\nDesign Guide](https://cloud.google.com/apis/design/errors).",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code, which should be an enum value of google.rpc.Code.",
               "title": "Code"
            },
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
               "title": "Message"
            }
         },
         "title": "GoogleRpcStatus",
         "type": "object"
      },
      "JobState": {
         "description": "Job state.",
         "enum": [
            "JOB_STATE_UNSPECIFIED",
            "JOB_STATE_QUEUED",
            "JOB_STATE_PENDING",
            "JOB_STATE_RUNNING",
            "JOB_STATE_SUCCEEDED",
            "JOB_STATE_FAILED",
            "JOB_STATE_CANCELLING",
            "JOB_STATE_CANCELLED",
            "JOB_STATE_PAUSED",
            "JOB_STATE_EXPIRED",
            "JOB_STATE_UPDATING",
            "JOB_STATE_PARTIALLY_SUCCEEDED"
         ],
         "title": "JobState",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PartnerModelTuningSpec": {
         "additionalProperties": false,
         "description": "Tuning spec for Partner models.",
         "properties": {
            "hyperParameters": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model.",
               "title": "Hyperparameters"
            },
            "trainingDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Trainingdataseturi"
            },
            "validationDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Validationdataseturi"
            }
         },
         "title": "PartnerModelTuningSpec",
         "type": "object"
      },
      "SupervisedHyperParameters": {
         "additionalProperties": false,
         "description": "Hyperparameters for SFT.",
         "properties": {
            "adapterSize": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AdapterSize"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Adapter size for tuning."
            },
            "epochCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
               "title": "Epochcount"
            },
            "learningRateMultiplier": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Multiplier for adjusting the default learning rate.",
               "title": "Learningratemultiplier"
            }
         },
         "title": "SupervisedHyperParameters",
         "type": "object"
      },
      "SupervisedTuningDataStats": {
         "additionalProperties": false,
         "description": "Tuning data statistics for Supervised Tuning.",
         "properties": {
            "totalBillableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable characters in the tuning dataset.",
               "title": "Totalbillablecharactercount"
            },
            "totalBillableTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable tokens in the tuning dataset.",
               "title": "Totalbillabletokencount"
            },
            "totalTruncatedExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The number of examples in the dataset that have been truncated by any amount.",
               "title": "Totaltruncatedexamplecount"
            },
            "totalTuningCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning characters in the tuning dataset.",
               "title": "Totaltuningcharactercount"
            },
            "truncatedExampleIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A partial sample of the indices (starting from 1) of the truncated examples.",
               "title": "Truncatedexampleindices"
            },
            "tuningDatasetExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of examples in the tuning dataset.",
               "title": "Tuningdatasetexamplecount"
            },
            "tuningStepCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning steps for this Tuning Job.",
               "title": "Tuningstepcount"
            },
            "userDatasetExamples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sample user messages in the training dataset uri.",
               "title": "Userdatasetexamples"
            },
            "userInputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user input tokens."
            },
            "userMessagePerExampleDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the messages per example."
            },
            "userOutputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user output tokens."
            }
         },
         "title": "SupervisedTuningDataStats",
         "type": "object"
      },
      "SupervisedTuningDatasetDistribution": {
         "additionalProperties": false,
         "description": "Dataset distribution for Supervised Tuning.",
         "properties": {
            "billableSum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values that are billable.",
               "title": "Billablesum"
            },
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SupervisedTuningDatasetDistributionDatasetBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "SupervisedTuningDatasetDistribution",
         "type": "object"
      },
      "SupervisedTuningDatasetDistributionDatasetBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "SupervisedTuningDatasetDistributionDatasetBucket",
         "type": "object"
      },
      "SupervisedTuningSpec": {
         "additionalProperties": false,
         "description": "Tuning Spec for Supervised Tuning for first party models.",
         "properties": {
            "hyperParameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedHyperParameters"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Hyperparameters for SFT."
            },
            "trainingDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Trainingdataseturi"
            },
            "validationDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Validationdataseturi"
            },
            "exportLastCheckpointOnly": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported.",
               "title": "Exportlastcheckpointonly"
            }
         },
         "title": "SupervisedTuningSpec",
         "type": "object"
      },
      "TunedModel": {
         "additionalProperties": false,
         "properties": {
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.",
               "title": "Model"
            },
            "endpoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.",
               "title": "Endpoint"
            },
            "checkpoints": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/TunedModelCheckpoint"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The checkpoints associated with this TunedModel.\n      This field is only populated for tuning jobs that enable intermediate\n      checkpoints.",
               "title": "Checkpoints"
            }
         },
         "title": "TunedModel",
         "type": "object"
      },
      "TunedModelCheckpoint": {
         "additionalProperties": false,
         "description": "TunedModelCheckpoint for the Tuned Model of a Tuning Job.",
         "properties": {
            "checkpointId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the checkpoint.\n      ",
               "title": "Checkpointid"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The epoch of the checkpoint.\n      ",
               "title": "Epoch"
            },
            "step": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The step of the checkpoint.\n      ",
               "title": "Step"
            },
            "endpoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Endpoint resource name that the checkpoint is deployed to.\n      Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.\n      ",
               "title": "Endpoint"
            }
         },
         "title": "TunedModelCheckpoint",
         "type": "object"
      },
      "TuningDataStats": {
         "additionalProperties": false,
         "description": "The tuning data statistic values for TuningJob.",
         "properties": {
            "distillationDataStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DistillationDataStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Statistics for distillation."
            },
            "supervisedTuningDataStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDataStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The SFT Tuning data stats."
            }
         },
         "title": "TuningDataStats",
         "type": "object"
      },
      "TuningJob": {
         "additionalProperties": false,
         "description": "A tuning job.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`",
               "title": "Name"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JobState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The detailed state of the job."
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the TuningJob was created.",
               "title": "Createtime"
            },
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.",
               "title": "Endtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Time when the TuningJob was most recently updated.",
               "title": "Updatetime"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleRpcStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the TuningJob.",
               "title": "Description"
            },
            "baseModel": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base model that is being tuned, e.g., \"gemini-1.0-pro-002\". .",
               "title": "Basemodel"
            },
            "tunedModel": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TunedModel"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The tuned model resources associated with this TuningJob."
            },
            "supervisedTuningSpec": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningSpec"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Tuning Spec for Supervised Fine Tuning."
            },
            "tuningDataStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TuningDataStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The tuning data statistics associated with this TuningJob."
            },
            "encryptionSpec": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EncryptionSpec"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key."
            },
            "partnerModelTuningSpec": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PartnerModelTuningSpec"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Tuning Spec for open sourced and third party Partner models."
            },
            "distillationSpec": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DistillationSpec"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Tuning Spec for Distillation."
            },
            "experiment": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The Experiment associated with this TuningJob.",
               "title": "Experiment"
            },
            "labels": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.",
               "title": "Labels"
            },
            "pipelineJob": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.",
               "title": "Pipelinejob"
            },
            "tunedModelDisplayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.",
               "title": "Tunedmodeldisplayname"
            }
         },
         "title": "TuningJob",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field next_page_token: Optional[str] = None (alias 'nextPageToken')

A token to retrieve the next page of results. Pass to ListTuningJobsRequest.page_token to obtain that page.

field tuning_jobs: Optional[list[TuningJob]] = None (alias 'tuningJobs')

List of TuningJobs in the requested page.

class genai.types.ListTuningJobsResponseDict

Bases: TypedDict

Response for the list tuning jobs method.

next_page_token: Optional[str]

A token to retrieve the next page of results. Pass to ListTuningJobsRequest.page_token to obtain that page.

tuning_jobs: Optional[list[TuningJobDict]]

List of TuningJobs in the requested page.

pydantic model genai.types.LiveClientContent

Bases: BaseModel

Incremental update of the current conversation delivered from the client.

All the content here will unconditionally be appended to the conversation history and used as part of the prompt to the model to generate content.

A message here will interrupt any current model generation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveClientContent",
   "description": "Incremental update of the current conversation delivered from the client.\n\nAll the content here will unconditionally be appended to the conversation\nhistory and used as part of the prompt to the model to generate content.\n\nA message here will interrupt any current model generation.",
   "type": "object",
   "properties": {
      "turns": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Content"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The content appended to the current conversation with the model.\n\n      For single-turn queries, this is a single instance. For multi-turn\n      queries, this is a repeated field that contains conversation history and\n      latest request.\n      ",
         "title": "Turns"
      },
      "turnComplete": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If true, indicates that the server content generation should start with\n  the currently accumulated prompt. Otherwise, the server will await\n  additional messages before starting generation.",
         "title": "Turncomplete"
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field turn_complete: Optional[bool] = None (alias 'turnComplete')

If true, indicates that the server content generation should start with the currently accumulated prompt. Otherwise, the server will await additional messages before starting generation.

field turns: Optional[list[Content]] = None

The content appended to the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history and latest request.

class genai.types.LiveClientContentDict

Bases: TypedDict

Incremental update of the current conversation delivered from the client.

All the content here will unconditionally be appended to the conversation history and used as part of the prompt to the model to generate content.

A message here will interrupt any current model generation.

turn_complete: Optional[bool]

If true, indicates that the server content generation should start with the currently accumulated prompt. Otherwise, the server will await additional messages before starting generation.

turns: Optional[list[ContentDict]]

The content appended to the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history and latest request.

pydantic model genai.types.LiveClientMessage

Bases: BaseModel

Messages sent by the client in the API call.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveClientMessage",
   "description": "Messages sent by the client in the API call.",
   "type": "object",
   "properties": {
      "setup": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveClientSetup"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Message to be sent by the system when connecting to the API. SDK users should not send this message."
      },
      "clientContent": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveClientContent"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Incremental update of the current conversation delivered from the client."
      },
      "realtimeInput": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveClientRealtimeInput"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "User input that is sent in real time."
      },
      "toolResponse": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveClientToolResponse"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Response to a `ToolCallMessage` received from the server."
      }
   },
   "$defs": {
      "ActivityEnd": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {},
         "title": "ActivityEnd",
         "type": "object"
      },
      "ActivityStart": {
         "additionalProperties": false,
         "description": "Marks the start of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {},
         "title": "ActivityStart",
         "type": "object"
      },
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AudioTranscriptionConfig": {
         "additionalProperties": false,
         "description": "The audio transcription configuration in Setup.",
         "properties": {},
         "title": "AudioTranscriptionConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ContextWindowCompressionConfig": {
         "additionalProperties": false,
         "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
         "properties": {
            "triggerTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
               "title": "Triggertokens"
            },
            "slidingWindow": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SlidingWindow"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sliding window compression mechanism."
            }
         },
         "title": "ContextWindowCompressionConfig",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LiveClientContent": {
         "additionalProperties": false,
         "description": "Incremental update of the current conversation delivered from the client.\n\nAll the content here will unconditionally be appended to the conversation\nhistory and used as part of the prompt to the model to generate content.\n\nA message here will interrupt any current model generation.",
         "properties": {
            "turns": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The content appended to the current conversation with the model.\n\n      For single-turn queries, this is a single instance. For multi-turn\n      queries, this is a repeated field that contains conversation history and\n      latest request.\n      ",
               "title": "Turns"
            },
            "turnComplete": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If true, indicates that the server content generation should start with\n  the currently accumulated prompt. Otherwise, the server will await\n  additional messages before starting generation.",
               "title": "Turncomplete"
            }
         },
         "title": "LiveClientContent",
         "type": "object"
      },
      "LiveClientRealtimeInput": {
         "additionalProperties": false,
         "description": "User input that is sent in real time.\n\nThis is different from `LiveClientContent` in a few ways:\n\n  - Can be sent continuously without interruption to model generation.\n  - If there is a need to mix data interleaved across the\n    `LiveClientContent` and the `LiveClientRealtimeInput`, server attempts to\n    optimize for best response, but there are no guarantees.\n  - End of turn is not explicitly specified, but is rather derived from user\n    activity (for example, end of speech).\n  - Even before the end of turn, the data is processed incrementally\n    to optimize for a fast start of the response from the model.\n  - Is always assumed to be the user's input (cannot be used to populate\n    conversation history).",
         "properties": {
            "mediaChunks": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Blob"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Inlined bytes data for media input.",
               "title": "Mediachunks"
            },
            "audio": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The realtime audio input stream."
            },
            "audioStreamEnd": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\nIndicates that the audio stream has ended, e.g. because the microphone was\nturned off.\n\nThis should only be sent when automatic activity detection is enabled\n(which is the default).\n\nThe client can reopen the stream by sending an audio message.\n",
               "title": "Audiostreamend"
            },
            "video": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The realtime video input stream."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The realtime text input stream.",
               "title": "Text"
            },
            "activityStart": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityStart"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Marks the start of user activity."
            },
            "activityEnd": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityEnd"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Marks the end of user activity."
            }
         },
         "title": "LiveClientRealtimeInput",
         "type": "object"
      },
      "LiveClientSetup": {
         "additionalProperties": false,
         "description": "Message contains configuration that will apply for the duration of the streaming session.",
         "properties": {
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "\n      The fully qualified name of the publisher model or tuned model endpoint to\n      use.\n      ",
               "title": "Model"
            },
            "generationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The generation configuration for the session.\n      Note: only a subset of fields are supported.\n      "
            },
            "systemInstruction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "#/$defs/File"
                           },
                           {
                              "$ref": "#/$defs/Part"
                           },
                           {
                              "type": "string"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "$ref": "#/$defs/File"
                  },
                  {
                     "$ref": "#/$defs/Part"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The user provided system instructions for the model.\n      Note: only text should be used in parts and content in each part will be\n      in a separate paragraph.",
               "title": "Systeminstruction"
            },
            "tools": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tool"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": " A list of `Tools` the model may use to generate the next response.\n\n      A `Tool` is a piece of code that enables the system to interact with\n      external systems to perform an action, or set of actions, outside of\n      knowledge and scope of the model.",
               "title": "Tools"
            },
            "sessionResumption": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SessionResumptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures session resumption mechanism.\n\n          If included server will send SessionResumptionUpdate messages."
            },
            "contextWindowCompression": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContextWindowCompressionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures context window compression mechanism.\n\n      If included, server will compress context window to fit into given length."
            },
            "inputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the input aligns with the input audio language.\n      "
            },
            "outputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the output aligns with the language code\n      specified for the output audio.\n      "
            },
            "proactivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ProactivityConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the proactivity of the model. This allows the model to respond proactively to\n    the input and to ignore irrelevant input."
            }
         },
         "title": "LiveClientSetup",
         "type": "object"
      },
      "LiveClientToolResponse": {
         "additionalProperties": false,
         "description": "Client generated response to a `ToolCall` received from the server.\n\nIndividual `FunctionResponse` objects are matched to the respective\n`FunctionCall` objects by the `id` field.\n\nNote that in the unary and server-streaming GenerateContent APIs function\ncalling happens by exchanging the `Content` parts, while in the bidi\nGenerateContent APIs function calling happens over this dedicated set of\nmessages.",
         "properties": {
            "functionResponses": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionResponse"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The response to the function calls.",
               "title": "Functionresponses"
            }
         },
         "title": "LiveClientToolResponse",
         "type": "object"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "ProactivityConfig": {
         "additionalProperties": false,
         "description": "Config for proactivity features.",
         "properties": {
            "proactiveAudio": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
               "title": "Proactiveaudio"
            }
         },
         "title": "ProactivityConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SessionResumptionConfig": {
         "additionalProperties": false,
         "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
         "properties": {
            "handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
               "title": "Handle"
            },
            "transparent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
               "title": "Transparent"
            }
         },
         "title": "SessionResumptionConfig",
         "type": "object"
      },
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field client_content: Optional[LiveClientContent] = None (alias 'clientContent')

Incremental update of the current conversation delivered from the client.

field realtime_input: Optional[LiveClientRealtimeInput] = None (alias 'realtimeInput')

User input that is sent in real time.

field setup: Optional[LiveClientSetup] = None

Message to be sent by the system when connecting to the API. SDK users should not send this message.

field tool_response: Optional[LiveClientToolResponse] = None (alias 'toolResponse')

Response to a ToolCallMessage received from the server.

class genai.types.LiveClientMessageDict

Bases: TypedDict

Messages sent by the client in the API call.

client_content: Optional[LiveClientContentDict]

Incremental update of the current conversation delivered from the client.

realtime_input: Optional[LiveClientRealtimeInputDict]

User input that is sent in real time.

setup: Optional[LiveClientSetupDict]

Message to be sent by the system when connecting to the API. SDK users should not send this message.

tool_response: Optional[LiveClientToolResponseDict]

Response to a ToolCallMessage received from the server.

pydantic model genai.types.LiveClientRealtimeInput

Bases: BaseModel

User input that is sent in real time.

This is different from LiveClientContent in a few ways:

  • Can be sent continuously without interruption to model generation.

  • If there is a need to mix data interleaved across the LiveClientContent and the LiveClientRealtimeInput, server attempts to optimize for best response, but there are no guarantees.

  • End of turn is not explicitly specified, but is rather derived from user activity (for example, end of speech).

  • Even before the end of turn, the data is processed incrementally to optimize for a fast start of the response from the model.

  • Is always assumed to be the user’s input (cannot be used to populate conversation history).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveClientRealtimeInput",
   "description": "User input that is sent in real time.\n\nThis is different from `LiveClientContent` in a few ways:\n\n  - Can be sent continuously without interruption to model generation.\n  - If there is a need to mix data interleaved across the\n    `LiveClientContent` and the `LiveClientRealtimeInput`, server attempts to\n    optimize for best response, but there are no guarantees.\n  - End of turn is not explicitly specified, but is rather derived from user\n    activity (for example, end of speech).\n  - Even before the end of turn, the data is processed incrementally\n    to optimize for a fast start of the response from the model.\n  - Is always assumed to be the user's input (cannot be used to populate\n    conversation history).",
   "type": "object",
   "properties": {
      "mediaChunks": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Blob"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Inlined bytes data for media input.",
         "title": "Mediachunks"
      },
      "audio": {
         "anyOf": [
            {
               "$ref": "#/$defs/Blob"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The realtime audio input stream."
      },
      "audioStreamEnd": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nIndicates that the audio stream has ended, e.g. because the microphone was\nturned off.\n\nThis should only be sent when automatic activity detection is enabled\n(which is the default).\n\nThe client can reopen the stream by sending an audio message.\n",
         "title": "Audiostreamend"
      },
      "video": {
         "anyOf": [
            {
               "$ref": "#/$defs/Blob"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The realtime video input stream."
      },
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The realtime text input stream.",
         "title": "Text"
      },
      "activityStart": {
         "anyOf": [
            {
               "$ref": "#/$defs/ActivityStart"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Marks the start of user activity."
      },
      "activityEnd": {
         "anyOf": [
            {
               "$ref": "#/$defs/ActivityEnd"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Marks the end of user activity."
      }
   },
   "$defs": {
      "ActivityEnd": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {},
         "title": "ActivityEnd",
         "type": "object"
      },
      "ActivityStart": {
         "additionalProperties": false,
         "description": "Marks the start of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {},
         "title": "ActivityStart",
         "type": "object"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field activity_end: Optional[ActivityEnd] = None (alias 'activityEnd')

Marks the end of user activity.

field activity_start: Optional[ActivityStart] = None (alias 'activityStart')

Marks the start of user activity.

field audio: Optional[Blob] = None

The realtime audio input stream.

field audio_stream_end: Optional[bool] = None (alias 'audioStreamEnd')

Indicates that the audio stream has ended, e.g. because the microphone was turned off.

This should only be sent when automatic activity detection is enabled (which is the default).

The client can reopen the stream by sending an audio message.

field media_chunks: Optional[list[Blob]] = None (alias 'mediaChunks')

Inlined bytes data for media input.

field text: Optional[str] = None

The realtime text input stream.

field video: Optional[Blob] = None

The realtime video input stream.

class genai.types.LiveClientRealtimeInputDict

Bases: TypedDict

User input that is sent in real time.

This is different from LiveClientContent in a few ways:

  • Can be sent continuously without interruption to model generation.

  • If there is a need to mix data interleaved across the LiveClientContent and the LiveClientRealtimeInput, server attempts to optimize for best response, but there are no guarantees.

  • End of turn is not explicitly specified, but is rather derived from user activity (for example, end of speech).

  • Even before the end of turn, the data is processed incrementally to optimize for a fast start of the response from the model.

  • Is always assumed to be the user’s input (cannot be used to populate conversation history).

activity_end: Optional[ActivityEndDict]

Marks the end of user activity.

activity_start: Optional[ActivityStartDict]

Marks the start of user activity.

audio: Optional[BlobDict]

The realtime audio input stream.

audio_stream_end: Optional[bool]

Indicates that the audio stream has ended, e.g. because the microphone was turned off.

This should only be sent when automatic activity detection is enabled (which is the default).

The client can reopen the stream by sending an audio message.

media_chunks: Optional[list[BlobDict]]

Inlined bytes data for media input.

text: Optional[str]

The realtime text input stream.

video: Optional[BlobDict]

The realtime video input stream.

pydantic model genai.types.LiveClientSetup

Bases: BaseModel

Message contains configuration that will apply for the duration of the streaming session.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveClientSetup",
   "description": "Message contains configuration that will apply for the duration of the streaming session.",
   "type": "object",
   "properties": {
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\n      The fully qualified name of the publisher model or tuned model endpoint to\n      use.\n      ",
         "title": "Model"
      },
      "generationConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerationConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The generation configuration for the session.\n      Note: only a subset of fields are supported.\n      "
      },
      "systemInstruction": {
         "anyOf": [
            {
               "$ref": "#/$defs/Content"
            },
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/File"
                     },
                     {
                        "$ref": "#/$defs/Part"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "$ref": "#/$defs/File"
            },
            {
               "$ref": "#/$defs/Part"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The user provided system instructions for the model.\n      Note: only text should be used in parts and content in each part will be\n      in a separate paragraph.",
         "title": "Systeminstruction"
      },
      "tools": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Tool"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": " A list of `Tools` the model may use to generate the next response.\n\n      A `Tool` is a piece of code that enables the system to interact with\n      external systems to perform an action, or set of actions, outside of\n      knowledge and scope of the model.",
         "title": "Tools"
      },
      "sessionResumption": {
         "anyOf": [
            {
               "$ref": "#/$defs/SessionResumptionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configures session resumption mechanism.\n\n          If included server will send SessionResumptionUpdate messages."
      },
      "contextWindowCompression": {
         "anyOf": [
            {
               "$ref": "#/$defs/ContextWindowCompressionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configures context window compression mechanism.\n\n      If included, server will compress context window to fit into given length."
      },
      "inputAudioTranscription": {
         "anyOf": [
            {
               "$ref": "#/$defs/AudioTranscriptionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The transcription of the input aligns with the input audio language.\n      "
      },
      "outputAudioTranscription": {
         "anyOf": [
            {
               "$ref": "#/$defs/AudioTranscriptionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The transcription of the output aligns with the language code\n      specified for the output audio.\n      "
      },
      "proactivity": {
         "anyOf": [
            {
               "$ref": "#/$defs/ProactivityConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configures the proactivity of the model. This allows the model to respond proactively to\n    the input and to ignore irrelevant input."
      }
   },
   "$defs": {
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AudioTranscriptionConfig": {
         "additionalProperties": false,
         "description": "The audio transcription configuration in Setup.",
         "properties": {},
         "title": "AudioTranscriptionConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ContextWindowCompressionConfig": {
         "additionalProperties": false,
         "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
         "properties": {
            "triggerTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
               "title": "Triggertokens"
            },
            "slidingWindow": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SlidingWindow"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sliding window compression mechanism."
            }
         },
         "title": "ContextWindowCompressionConfig",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "ProactivityConfig": {
         "additionalProperties": false,
         "description": "Config for proactivity features.",
         "properties": {
            "proactiveAudio": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
               "title": "Proactiveaudio"
            }
         },
         "title": "ProactivityConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SessionResumptionConfig": {
         "additionalProperties": false,
         "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
         "properties": {
            "handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
               "title": "Handle"
            },
            "transparent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
               "title": "Transparent"
            }
         },
         "title": "SessionResumptionConfig",
         "type": "object"
      },
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field context_window_compression: Optional[ContextWindowCompressionConfig] = None (alias 'contextWindowCompression')

Configures context window compression mechanism.

If included, server will compress context window to fit into given length.

field generation_config: Optional[GenerationConfig] = None (alias 'generationConfig')

The generation configuration for the session. Note: only a subset of fields are supported.

field input_audio_transcription: Optional[AudioTranscriptionConfig] = None (alias 'inputAudioTranscription')

The transcription of the input aligns with the input audio language.

field model: Optional[str] = None

The fully qualified name of the publisher model or tuned model endpoint to use.

field output_audio_transcription: Optional[AudioTranscriptionConfig] = None (alias 'outputAudioTranscription')

The transcription of the output aligns with the language code specified for the output audio.

field proactivity: Optional[ProactivityConfig] = None

Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.

field session_resumption: Optional[SessionResumptionConfig] = None (alias 'sessionResumption')

Configures session resumption mechanism.

If included server will send SessionResumptionUpdate messages.

field system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, None] = None (alias 'systemInstruction')

The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

field tools: Optional[list[Union[Tool, Callable[..., Any]]]] = None

A list of Tools the model may use to generate the next response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

class genai.types.LiveClientSetupDict

Bases: TypedDict

Message contains configuration that will apply for the duration of the streaming session.

context_window_compression: Optional[ContextWindowCompressionConfigDict]

Configures context window compression mechanism.

If included, server will compress context window to fit into given length.

generation_config: Optional[GenerationConfigDict]

The generation configuration for the session. Note: only a subset of fields are supported.

input_audio_transcription: Optional[AudioTranscriptionConfigDict]

The transcription of the input aligns with the input audio language.

model: Optional[str]

The fully qualified name of the publisher model or tuned model endpoint to use.

output_audio_transcription: Optional[AudioTranscriptionConfigDict]

The transcription of the output aligns with the language code specified for the output audio.

proactivity: Optional[ProactivityConfigDict]

Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.

session_resumption: Optional[SessionResumptionConfigDict]

Configures session resumption mechanism.

If included server will send SessionResumptionUpdate messages.

system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, ContentDict, None]

The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

tools: Optional[list[Union[ToolDict, Callable[..., Any]]]]

A list of Tools the model may use to generate the next response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

pydantic model genai.types.LiveClientToolResponse

Bases: BaseModel

Client generated response to a ToolCall received from the server.

Individual FunctionResponse objects are matched to the respective FunctionCall objects by the id field.

Note that in the unary and server-streaming GenerateContent APIs function calling happens by exchanging the Content parts, while in the bidi GenerateContent APIs function calling happens over this dedicated set of messages.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveClientToolResponse",
   "description": "Client generated response to a `ToolCall` received from the server.\n\nIndividual `FunctionResponse` objects are matched to the respective\n`FunctionCall` objects by the `id` field.\n\nNote that in the unary and server-streaming GenerateContent APIs function\ncalling happens by exchanging the `Content` parts, while in the bidi\nGenerateContent APIs function calling happens over this dedicated set of\nmessages.",
   "type": "object",
   "properties": {
      "functionResponses": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/FunctionResponse"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The response to the function calls.",
         "title": "Functionresponses"
      }
   },
   "$defs": {
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field function_responses: Optional[list[FunctionResponse]] = None (alias 'functionResponses')

The response to the function calls.

class genai.types.LiveClientToolResponseDict

Bases: TypedDict

Client generated response to a ToolCall received from the server.

Individual FunctionResponse objects are matched to the respective FunctionCall objects by the id field.

Note that in the unary and server-streaming GenerateContent APIs function calling happens by exchanging the Content parts, while in the bidi GenerateContent APIs function calling happens over this dedicated set of messages.

function_responses: Optional[list[FunctionResponseDict]]

The response to the function calls.

pydantic model genai.types.LiveConnectConfig

Bases: BaseModel

Session config for the API connection.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveConnectConfig",
   "description": "Session config for the API connection.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "generationConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/GenerationConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The generation configuration for the session."
      },
      "responseModalities": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Modality"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The requested modalities of the response. Represents the set of\n      modalities that the model can return. Defaults to AUDIO if not specified.\n      ",
         "title": "Responsemodalities"
      },
      "temperature": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value that controls the degree of randomness in token selection.\n      Lower temperatures are good for prompts that require a less open-ended or\n      creative response, while higher temperatures can lead to more diverse or\n      creative results.\n      ",
         "title": "Temperature"
      },
      "topP": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Tokens are selected from the most to least probable until the sum\n      of their probabilities equals this value. Use a lower value for less\n      random responses and a higher value for more random responses.\n      ",
         "title": "Topp"
      },
      "topK": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "For each token selection step, the ``top_k`` tokens with the\n      highest probabilities are sampled. Then tokens are further filtered based\n      on ``top_p`` with the final token selected using temperature sampling. Use\n      a lower number for less random responses and a higher number for more\n      random responses.\n      ",
         "title": "Topk"
      },
      "maxOutputTokens": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum number of tokens that can be generated in the response.\n      ",
         "title": "Maxoutputtokens"
      },
      "mediaResolution": {
         "anyOf": [
            {
               "$ref": "#/$defs/MediaResolution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If specified, the media resolution specified will be used.\n      "
      },
      "seed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "When ``seed`` is fixed to a specific number, the model makes a best\n      effort to provide the same response for repeated requests. By default, a\n      random number is used.\n      ",
         "title": "Seed"
      },
      "speechConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/SpeechConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The speech generation configuration.\n      "
      },
      "enableAffectiveDialog": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If enabled, the model will detect emotions and adapt its responses accordingly.",
         "title": "Enableaffectivedialog"
      },
      "systemInstruction": {
         "anyOf": [
            {
               "$ref": "#/$defs/Content"
            },
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/File"
                     },
                     {
                        "$ref": "#/$defs/Part"
                     },
                     {
                        "type": "string"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "$ref": "#/$defs/File"
            },
            {
               "$ref": "#/$defs/Part"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The user provided system instructions for the model.\n      Note: only text should be used in parts and content in each part will be\n      in a separate paragraph.",
         "title": "Systeminstruction"
      },
      "tools": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Tool"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of `Tools` the model may use to generate the next response.\n\n      A `Tool` is a piece of code that enables the system to interact with\n      external systems to perform an action, or set of actions, outside of\n      knowledge and scope of the model.",
         "title": "Tools"
      },
      "sessionResumption": {
         "anyOf": [
            {
               "$ref": "#/$defs/SessionResumptionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configures session resumption mechanism.\n\nIf included the server will send SessionResumptionUpdate messages."
      },
      "inputAudioTranscription": {
         "anyOf": [
            {
               "$ref": "#/$defs/AudioTranscriptionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The transcription of the input aligns with the input audio language.\n      "
      },
      "outputAudioTranscription": {
         "anyOf": [
            {
               "$ref": "#/$defs/AudioTranscriptionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The transcription of the output aligns with the language code\n      specified for the output audio.\n      "
      },
      "realtimeInputConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/RealtimeInputConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configures the realtime input behavior in BidiGenerateContent."
      },
      "contextWindowCompression": {
         "anyOf": [
            {
               "$ref": "#/$defs/ContextWindowCompressionConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configures context window compression mechanism.\n\n      If included, server will compress context window to fit into given length."
      },
      "proactivity": {
         "anyOf": [
            {
               "$ref": "#/$defs/ProactivityConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configures the proactivity of the model. This allows the model to respond proactively to\n    the input and to ignore irrelevant input."
      }
   },
   "$defs": {
      "ActivityHandling": {
         "description": "The different ways of handling user activity.",
         "enum": [
            "ACTIVITY_HANDLING_UNSPECIFIED",
            "START_OF_ACTIVITY_INTERRUPTS",
            "NO_INTERRUPTION"
         ],
         "title": "ActivityHandling",
         "type": "string"
      },
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AudioTranscriptionConfig": {
         "additionalProperties": false,
         "description": "The audio transcription configuration in Setup.",
         "properties": {},
         "title": "AudioTranscriptionConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "AutomaticActivityDetection": {
         "additionalProperties": false,
         "description": "Configures automatic detection of activity.",
         "properties": {
            "disabled": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.",
               "title": "Disabled"
            },
            "startOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/StartSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely speech is to be detected."
            },
            "endOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EndSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely detected speech is ended."
            },
            "prefixPaddingMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.",
               "title": "Prefixpaddingms"
            },
            "silenceDurationMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.",
               "title": "Silencedurationms"
            }
         },
         "title": "AutomaticActivityDetection",
         "type": "object"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ContextWindowCompressionConfig": {
         "additionalProperties": false,
         "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
         "properties": {
            "triggerTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
               "title": "Triggertokens"
            },
            "slidingWindow": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SlidingWindow"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sliding window compression mechanism."
            }
         },
         "title": "ContextWindowCompressionConfig",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EndSensitivity": {
         "description": "End of speech sensitivity.",
         "enum": [
            "END_SENSITIVITY_UNSPECIFIED",
            "END_SENSITIVITY_HIGH",
            "END_SENSITIVITY_LOW"
         ],
         "title": "EndSensitivity",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Modality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "AUDIO"
         ],
         "title": "Modality",
         "type": "string"
      },
      "MultiSpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the multi-speaker setup.",
         "properties": {
            "speakerVoiceConfigs": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SpeakerVoiceConfig"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.",
               "title": "Speakervoiceconfigs"
            }
         },
         "title": "MultiSpeakerVoiceConfig",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "ProactivityConfig": {
         "additionalProperties": false,
         "description": "Config for proactivity features.",
         "properties": {
            "proactiveAudio": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
               "title": "Proactiveaudio"
            }
         },
         "title": "ProactivityConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "RealtimeInputConfig": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {
            "automaticActivityDetection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AutomaticActivityDetection"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals."
            },
            "activityHandling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityHandling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines what effect activity has."
            },
            "turnCoverage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TurnCoverage"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines which input is included in the user's turn."
            }
         },
         "title": "RealtimeInputConfig",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SessionResumptionConfig": {
         "additionalProperties": false,
         "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
         "properties": {
            "handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
               "title": "Handle"
            },
            "transparent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
               "title": "Transparent"
            }
         },
         "title": "SessionResumptionConfig",
         "type": "object"
      },
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "SpeechConfig": {
         "additionalProperties": false,
         "description": "The speech generation configuration.",
         "properties": {
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            },
            "multiSpeakerVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the multi-speaker setup.\n          It is mutually exclusive with the voice_config field.\n          "
            },
            "languageCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Language code (ISO 639. e.g. en-US) for the speech synthesization.\n      Only available for Live API.\n      ",
               "title": "Languagecode"
            }
         },
         "title": "SpeechConfig",
         "type": "object"
      },
      "StartSensitivity": {
         "description": "Start of speech sensitivity.",
         "enum": [
            "START_SENSITIVITY_UNSPECIFIED",
            "START_SENSITIVITY_HIGH",
            "START_SENSITIVITY_LOW"
         ],
         "title": "StartSensitivity",
         "type": "string"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "TurnCoverage": {
         "description": "Options about which input is included in the user's turn.",
         "enum": [
            "TURN_COVERAGE_UNSPECIFIED",
            "TURN_INCLUDES_ONLY_ACTIVITY",
            "TURN_INCLUDES_ALL_INPUT"
         ],
         "title": "TurnCoverage",
         "type": "string"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field context_window_compression: Optional[ContextWindowCompressionConfig] = None (alias 'contextWindowCompression')

Configures context window compression mechanism.

If included, server will compress context window to fit into given length.

field enable_affective_dialog: Optional[bool] = None (alias 'enableAffectiveDialog')

If enabled, the model will detect emotions and adapt its responses accordingly.

field generation_config: Optional[GenerationConfig] = None (alias 'generationConfig')

The generation configuration for the session.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field input_audio_transcription: Optional[AudioTranscriptionConfig] = None (alias 'inputAudioTranscription')

The transcription of the input aligns with the input audio language.

field max_output_tokens: Optional[int] = None (alias 'maxOutputTokens')

Maximum number of tokens that can be generated in the response.

field media_resolution: Optional[MediaResolution] = None (alias 'mediaResolution')

If specified, the media resolution specified will be used.

field output_audio_transcription: Optional[AudioTranscriptionConfig] = None (alias 'outputAudioTranscription')

The transcription of the output aligns with the language code specified for the output audio.

field proactivity: Optional[ProactivityConfig] = None

Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.

field realtime_input_config: Optional[RealtimeInputConfig] = None (alias 'realtimeInputConfig')

Configures the realtime input behavior in BidiGenerateContent.

field response_modalities: Optional[list[Modality]] = None (alias 'responseModalities')

The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.

field seed: Optional[int] = None

When seed is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests. By default, a random number is used.

field session_resumption: Optional[SessionResumptionConfig] = None (alias 'sessionResumption')

Configures session resumption mechanism.

If included the server will send SessionResumptionUpdate messages.

field speech_config: Optional[SpeechConfig] = None (alias 'speechConfig')

The speech generation configuration.

field system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, None] = None (alias 'systemInstruction')

The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

field temperature: Optional[float] = None

Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results.

field tools: Optional[list[Union[Tool, Callable[..., Any]]]] = None

A list of Tools the model may use to generate the next response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

field top_k: Optional[float] = None (alias 'topK')

For each token selection step, the top_k tokens with the highest probabilities are sampled. Then tokens are further filtered based on top_p with the final token selected using temperature sampling. Use a lower number for less random responses and a higher number for more random responses.

field top_p: Optional[float] = None (alias 'topP')

Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses.

class genai.types.LiveConnectConfigDict

Bases: TypedDict

Session config for the API connection.

context_window_compression: Optional[ContextWindowCompressionConfigDict]

Configures context window compression mechanism.

If included, server will compress context window to fit into given length.

enable_affective_dialog: Optional[bool]

If enabled, the model will detect emotions and adapt its responses accordingly.

generation_config: Optional[GenerationConfigDict]

The generation configuration for the session.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

input_audio_transcription: Optional[AudioTranscriptionConfigDict]

The transcription of the input aligns with the input audio language.

max_output_tokens: Optional[int]

Maximum number of tokens that can be generated in the response.

media_resolution: Optional[MediaResolution]

If specified, the media resolution specified will be used.

output_audio_transcription: Optional[AudioTranscriptionConfigDict]

The transcription of the output aligns with the language code specified for the output audio.

proactivity: Optional[ProactivityConfigDict]

Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.

realtime_input_config: Optional[RealtimeInputConfigDict]

Configures the realtime input behavior in BidiGenerateContent.

response_modalities: Optional[list[Modality]]

The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.

seed: Optional[int]

When seed is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests. By default, a random number is used.

session_resumption: Optional[SessionResumptionConfigDict]

Configures session resumption mechanism.

If included the server will send SessionResumptionUpdate messages.

speech_config: Optional[SpeechConfigDict]

The speech generation configuration.

system_instruction: Union[Content, list[Union[File, Part, Image, str]], File, Part, Image, str, ContentDict, None]

The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

temperature: Optional[float]

Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results.

tools: Optional[list[Union[ToolDict, Callable[..., Any]]]]

A list of Tools the model may use to generate the next response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

top_k: Optional[float]

For each token selection step, the top_k tokens with the highest probabilities are sampled. Then tokens are further filtered based on top_p with the final token selected using temperature sampling. Use a lower number for less random responses and a higher number for more random responses.

top_p: Optional[float]

Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses.

pydantic model genai.types.LiveConnectParameters

Bases: BaseModel

Parameters for connecting to the live API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveConnectParameters",
   "description": "Parameters for connecting to the live API.",
   "type": "object",
   "properties": {
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "ID of the model to use. For a list of models, see `Google models\n    <https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_.",
         "title": "Model"
      },
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveConnectConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional configuration parameters for the request.\n      "
      }
   },
   "$defs": {
      "ActivityHandling": {
         "description": "The different ways of handling user activity.",
         "enum": [
            "ACTIVITY_HANDLING_UNSPECIFIED",
            "START_OF_ACTIVITY_INTERRUPTS",
            "NO_INTERRUPTION"
         ],
         "title": "ActivityHandling",
         "type": "string"
      },
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AudioTranscriptionConfig": {
         "additionalProperties": false,
         "description": "The audio transcription configuration in Setup.",
         "properties": {},
         "title": "AudioTranscriptionConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "AutomaticActivityDetection": {
         "additionalProperties": false,
         "description": "Configures automatic detection of activity.",
         "properties": {
            "disabled": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.",
               "title": "Disabled"
            },
            "startOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/StartSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely speech is to be detected."
            },
            "endOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EndSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely detected speech is ended."
            },
            "prefixPaddingMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.",
               "title": "Prefixpaddingms"
            },
            "silenceDurationMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.",
               "title": "Silencedurationms"
            }
         },
         "title": "AutomaticActivityDetection",
         "type": "object"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ContextWindowCompressionConfig": {
         "additionalProperties": false,
         "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
         "properties": {
            "triggerTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
               "title": "Triggertokens"
            },
            "slidingWindow": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SlidingWindow"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sliding window compression mechanism."
            }
         },
         "title": "ContextWindowCompressionConfig",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EndSensitivity": {
         "description": "End of speech sensitivity.",
         "enum": [
            "END_SENSITIVITY_UNSPECIFIED",
            "END_SENSITIVITY_HIGH",
            "END_SENSITIVITY_LOW"
         ],
         "title": "EndSensitivity",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LiveConnectConfig": {
         "additionalProperties": false,
         "description": "Session config for the API connection.",
         "properties": {
            "httpOptions": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HttpOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Used to override HTTP request options."
            },
            "generationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The generation configuration for the session."
            },
            "responseModalities": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Modality"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The requested modalities of the response. Represents the set of\n      modalities that the model can return. Defaults to AUDIO if not specified.\n      ",
               "title": "Responsemodalities"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value that controls the degree of randomness in token selection.\n      Lower temperatures are good for prompts that require a less open-ended or\n      creative response, while higher temperatures can lead to more diverse or\n      creative results.\n      ",
               "title": "Temperature"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Tokens are selected from the most to least probable until the sum\n      of their probabilities equals this value. Use a lower value for less\n      random responses and a higher value for more random responses.\n      ",
               "title": "Topp"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "For each token selection step, the ``top_k`` tokens with the\n      highest probabilities are sampled. Then tokens are further filtered based\n      on ``top_p`` with the final token selected using temperature sampling. Use\n      a lower number for less random responses and a higher number for more\n      random responses.\n      ",
               "title": "Topk"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of tokens that can be generated in the response.\n      ",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If specified, the media resolution specified will be used.\n      "
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "When ``seed`` is fixed to a specific number, the model makes a best\n      effort to provide the same response for repeated requests. By default, a\n      random number is used.\n      ",
               "title": "Seed"
            },
            "speechConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SpeechConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The speech generation configuration.\n      "
            },
            "enableAffectiveDialog": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model will detect emotions and adapt its responses accordingly.",
               "title": "Enableaffectivedialog"
            },
            "systemInstruction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "#/$defs/File"
                           },
                           {
                              "$ref": "#/$defs/Part"
                           },
                           {
                              "type": "string"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "$ref": "#/$defs/File"
                  },
                  {
                     "$ref": "#/$defs/Part"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The user provided system instructions for the model.\n      Note: only text should be used in parts and content in each part will be\n      in a separate paragraph.",
               "title": "Systeminstruction"
            },
            "tools": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tool"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Tools` the model may use to generate the next response.\n\n      A `Tool` is a piece of code that enables the system to interact with\n      external systems to perform an action, or set of actions, outside of\n      knowledge and scope of the model.",
               "title": "Tools"
            },
            "sessionResumption": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SessionResumptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures session resumption mechanism.\n\nIf included the server will send SessionResumptionUpdate messages."
            },
            "inputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the input aligns with the input audio language.\n      "
            },
            "outputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the output aligns with the language code\n      specified for the output audio.\n      "
            },
            "realtimeInputConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RealtimeInputConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the realtime input behavior in BidiGenerateContent."
            },
            "contextWindowCompression": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContextWindowCompressionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures context window compression mechanism.\n\n      If included, server will compress context window to fit into given length."
            },
            "proactivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ProactivityConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the proactivity of the model. This allows the model to respond proactively to\n    the input and to ignore irrelevant input."
            }
         },
         "title": "LiveConnectConfig",
         "type": "object"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Modality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "AUDIO"
         ],
         "title": "Modality",
         "type": "string"
      },
      "MultiSpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the multi-speaker setup.",
         "properties": {
            "speakerVoiceConfigs": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SpeakerVoiceConfig"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.",
               "title": "Speakervoiceconfigs"
            }
         },
         "title": "MultiSpeakerVoiceConfig",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "ProactivityConfig": {
         "additionalProperties": false,
         "description": "Config for proactivity features.",
         "properties": {
            "proactiveAudio": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
               "title": "Proactiveaudio"
            }
         },
         "title": "ProactivityConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "RealtimeInputConfig": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {
            "automaticActivityDetection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AutomaticActivityDetection"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals."
            },
            "activityHandling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityHandling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines what effect activity has."
            },
            "turnCoverage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TurnCoverage"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines which input is included in the user's turn."
            }
         },
         "title": "RealtimeInputConfig",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SessionResumptionConfig": {
         "additionalProperties": false,
         "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
         "properties": {
            "handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
               "title": "Handle"
            },
            "transparent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
               "title": "Transparent"
            }
         },
         "title": "SessionResumptionConfig",
         "type": "object"
      },
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "SpeechConfig": {
         "additionalProperties": false,
         "description": "The speech generation configuration.",
         "properties": {
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            },
            "multiSpeakerVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the multi-speaker setup.\n          It is mutually exclusive with the voice_config field.\n          "
            },
            "languageCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Language code (ISO 639. e.g. en-US) for the speech synthesization.\n      Only available for Live API.\n      ",
               "title": "Languagecode"
            }
         },
         "title": "SpeechConfig",
         "type": "object"
      },
      "StartSensitivity": {
         "description": "Start of speech sensitivity.",
         "enum": [
            "START_SENSITIVITY_UNSPECIFIED",
            "START_SENSITIVITY_HIGH",
            "START_SENSITIVITY_LOW"
         ],
         "title": "StartSensitivity",
         "type": "string"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "TurnCoverage": {
         "description": "Options about which input is included in the user's turn.",
         "enum": [
            "TURN_COVERAGE_UNSPECIFIED",
            "TURN_INCLUDES_ONLY_ACTIVITY",
            "TURN_INCLUDES_ALL_INPUT"
         ],
         "title": "TurnCoverage",
         "type": "string"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field config: Optional[LiveConnectConfig] = None

Optional configuration parameters for the request.

field model: Optional[str] = None

ID of the model to use. For a list of models, see Google models.

class genai.types.LiveConnectParametersDict

Bases: TypedDict

Parameters for connecting to the live API.

config: Optional[LiveConnectConfigDict]

Optional configuration parameters for the request.

model: Optional[str]

ID of the model to use. For a list of models, see Google models.

pydantic model genai.types.LiveEphemeralParameters

Bases: BaseModel

Config for LiveEphemeralParameters for Auth Token creation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveEphemeralParameters",
   "description": "Config for LiveEphemeralParameters for Auth Token creation.",
   "type": "object",
   "properties": {
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "ID of the model to configure in the ephemeral token for Live API.\n      For a list of models, see `Gemini models\n      <https://ai.google.dev/gemini-api/docs/models>`.",
         "title": "Model"
      },
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveConnectConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration specific to Live API connections created using this token."
      }
   },
   "$defs": {
      "ActivityHandling": {
         "description": "The different ways of handling user activity.",
         "enum": [
            "ACTIVITY_HANDLING_UNSPECIFIED",
            "START_OF_ACTIVITY_INTERRUPTS",
            "NO_INTERRUPTION"
         ],
         "title": "ActivityHandling",
         "type": "string"
      },
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AudioTranscriptionConfig": {
         "additionalProperties": false,
         "description": "The audio transcription configuration in Setup.",
         "properties": {},
         "title": "AudioTranscriptionConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "AutomaticActivityDetection": {
         "additionalProperties": false,
         "description": "Configures automatic detection of activity.",
         "properties": {
            "disabled": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.",
               "title": "Disabled"
            },
            "startOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/StartSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely speech is to be detected."
            },
            "endOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EndSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely detected speech is ended."
            },
            "prefixPaddingMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.",
               "title": "Prefixpaddingms"
            },
            "silenceDurationMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.",
               "title": "Silencedurationms"
            }
         },
         "title": "AutomaticActivityDetection",
         "type": "object"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ContextWindowCompressionConfig": {
         "additionalProperties": false,
         "description": "Enables context window compression -- mechanism managing model context window so it does not exceed given length.",
         "properties": {
            "triggerTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens (before running turn) that triggers context window compression mechanism.",
               "title": "Triggertokens"
            },
            "slidingWindow": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SlidingWindow"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sliding window compression mechanism."
            }
         },
         "title": "ContextWindowCompressionConfig",
         "type": "object"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EndSensitivity": {
         "description": "End of speech sensitivity.",
         "enum": [
            "END_SENSITIVITY_UNSPECIFIED",
            "END_SENSITIVITY_HIGH",
            "END_SENSITIVITY_LOW"
         ],
         "title": "EndSensitivity",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "File": {
         "additionalProperties": false,
         "description": "A file uploaded to the API.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
               "title": "Name"
            },
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image'",
               "title": "Displayname"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. MIME type of the file.",
               "title": "Mimetype"
            },
            "sizeBytes": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Size of the file in bytes.",
               "title": "Sizebytes"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was created.",
               "title": "Createtime"
            },
            "expirationTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
               "title": "Expirationtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The timestamp of when the `File` was last updated.",
               "title": "Updatetime"
            },
            "sha256Hash": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.",
               "title": "Sha256Hash"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`.",
               "title": "Uri"
            },
            "downloadUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The URI of the `File`, only set for downloadable (generated) files.",
               "title": "Downloaduri"
            },
            "state": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileState"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Processing state of the File."
            },
            "source": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileSource"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The source of the `File`."
            },
            "videoMetadata": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Metadata for a video.",
               "title": "Videometadata"
            },
            "error": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Error status if File processing failed."
            }
         },
         "title": "File",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FileSource": {
         "description": "Source of the File.",
         "enum": [
            "SOURCE_UNSPECIFIED",
            "UPLOADED",
            "GENERATED"
         ],
         "title": "FileSource",
         "type": "string"
      },
      "FileState": {
         "description": "State for the lifecycle of a File.",
         "enum": [
            "STATE_UNSPECIFIED",
            "PROCESSING",
            "ACTIVE",
            "FAILED"
         ],
         "title": "FileState",
         "type": "string"
      },
      "FileStatus": {
         "additionalProperties": false,
         "description": "Status of a File that uses a common error model.",
         "properties": {
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Message"
            },
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code. 0 for OK, 1 for CANCELLED",
               "title": "Code"
            }
         },
         "title": "FileStatus",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GenerationConfig": {
         "additionalProperties": false,
         "description": "Generation config.",
         "properties": {
            "audioTimestamp": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If enabled, audio timestamp will be included in the request to the model.",
               "title": "Audiotimestamp"
            },
            "candidateCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of candidates to generate.",
               "title": "Candidatecount"
            },
            "frequencyPenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Frequency penalties.",
               "title": "Frequencypenalty"
            },
            "logprobs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Logit probabilities.",
               "title": "Logprobs"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The maximum number of output tokens to generate per message.",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, the media resolution specified will be used."
            },
            "presencePenalty": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Positive penalties.",
               "title": "Presencepenalty"
            },
            "responseLogprobs": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If true, export the logprobs results in response.",
               "title": "Responselogprobs"
            },
            "responseMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.",
               "title": "Responsemimetype"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
            },
            "routingConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Routing configuration."
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Seed.",
               "title": "Seed"
            },
            "stopSequences": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Stop sequences.",
               "title": "Stopsequences"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Controls the randomness of predictions.",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, top-k sampling will be used.",
               "title": "Topk"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If specified, nucleus sampling will be used.",
               "title": "Topp"
            }
         },
         "title": "GenerationConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfig": {
         "additionalProperties": false,
         "description": "The configuration for routing the request to a specific model.",
         "properties": {
            "autoMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigAutoRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Automated routing."
            },
            "manualMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfigRoutingConfigManualRoutingMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Manual routing."
            }
         },
         "title": "GenerationConfigRoutingConfig",
         "type": "object"
      },
      "GenerationConfigRoutingConfigAutoRoutingMode": {
         "additionalProperties": false,
         "description": "When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.",
         "properties": {
            "modelRoutingPreference": {
               "anyOf": [
                  {
                     "enum": [
                        "UNKNOWN",
                        "PRIORITIZE_QUALITY",
                        "BALANCED",
                        "PRIORITIZE_COST"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model routing preference.",
               "title": "Modelroutingpreference"
            }
         },
         "title": "GenerationConfigRoutingConfigAutoRoutingMode",
         "type": "object"
      },
      "GenerationConfigRoutingConfigManualRoutingMode": {
         "additionalProperties": false,
         "description": "When manual routing is set, the specified model will be used directly.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'.",
               "title": "Modelname"
            }
         },
         "title": "GenerationConfigRoutingConfigManualRoutingMode",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LiveConnectConfig": {
         "additionalProperties": false,
         "description": "Session config for the API connection.",
         "properties": {
            "httpOptions": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HttpOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Used to override HTTP request options."
            },
            "generationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The generation configuration for the session."
            },
            "responseModalities": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Modality"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The requested modalities of the response. Represents the set of\n      modalities that the model can return. Defaults to AUDIO if not specified.\n      ",
               "title": "Responsemodalities"
            },
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value that controls the degree of randomness in token selection.\n      Lower temperatures are good for prompts that require a less open-ended or\n      creative response, while higher temperatures can lead to more diverse or\n      creative results.\n      ",
               "title": "Temperature"
            },
            "topP": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Tokens are selected from the most to least probable until the sum\n      of their probabilities equals this value. Use a lower value for less\n      random responses and a higher value for more random responses.\n      ",
               "title": "Topp"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "For each token selection step, the ``top_k`` tokens with the\n      highest probabilities are sampled. Then tokens are further filtered based\n      on ``top_p`` with the final token selected using temperature sampling. Use\n      a lower number for less random responses and a higher number for more\n      random responses.\n      ",
               "title": "Topk"
            },
            "maxOutputTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of tokens that can be generated in the response.\n      ",
               "title": "Maxoutputtokens"
            },
            "mediaResolution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaResolution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If specified, the media resolution specified will be used.\n      "
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "When ``seed`` is fixed to a specific number, the model makes a best\n      effort to provide the same response for repeated requests. By default, a\n      random number is used.\n      ",
               "title": "Seed"
            },
            "speechConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SpeechConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The speech generation configuration.\n      "
            },
            "enableAffectiveDialog": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model will detect emotions and adapt its responses accordingly.",
               "title": "Enableaffectivedialog"
            },
            "systemInstruction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "#/$defs/File"
                           },
                           {
                              "$ref": "#/$defs/Part"
                           },
                           {
                              "type": "string"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "$ref": "#/$defs/File"
                  },
                  {
                     "$ref": "#/$defs/Part"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The user provided system instructions for the model.\n      Note: only text should be used in parts and content in each part will be\n      in a separate paragraph.",
               "title": "Systeminstruction"
            },
            "tools": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Tool"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of `Tools` the model may use to generate the next response.\n\n      A `Tool` is a piece of code that enables the system to interact with\n      external systems to perform an action, or set of actions, outside of\n      knowledge and scope of the model.",
               "title": "Tools"
            },
            "sessionResumption": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SessionResumptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures session resumption mechanism.\n\nIf included the server will send SessionResumptionUpdate messages."
            },
            "inputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the input aligns with the input audio language.\n      "
            },
            "outputAudioTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The transcription of the output aligns with the language code\n      specified for the output audio.\n      "
            },
            "realtimeInputConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RealtimeInputConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the realtime input behavior in BidiGenerateContent."
            },
            "contextWindowCompression": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContextWindowCompressionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures context window compression mechanism.\n\n      If included, server will compress context window to fit into given length."
            },
            "proactivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ProactivityConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Configures the proactivity of the model. This allows the model to respond proactively to\n    the input and to ignore irrelevant input."
            }
         },
         "title": "LiveConnectConfig",
         "type": "object"
      },
      "MediaResolution": {
         "description": "The media resolution to use.",
         "enum": [
            "MEDIA_RESOLUTION_UNSPECIFIED",
            "MEDIA_RESOLUTION_LOW",
            "MEDIA_RESOLUTION_MEDIUM",
            "MEDIA_RESOLUTION_HIGH"
         ],
         "title": "MediaResolution",
         "type": "string"
      },
      "Modality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "AUDIO"
         ],
         "title": "Modality",
         "type": "string"
      },
      "MultiSpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the multi-speaker setup.",
         "properties": {
            "speakerVoiceConfigs": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SpeakerVoiceConfig"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.",
               "title": "Speakervoiceconfigs"
            }
         },
         "title": "MultiSpeakerVoiceConfig",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "ProactivityConfig": {
         "additionalProperties": false,
         "description": "Config for proactivity features.",
         "properties": {
            "proactiveAudio": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
               "title": "Proactiveaudio"
            }
         },
         "title": "ProactivityConfig",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "RealtimeInputConfig": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {
            "automaticActivityDetection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AutomaticActivityDetection"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals."
            },
            "activityHandling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityHandling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines what effect activity has."
            },
            "turnCoverage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TurnCoverage"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines which input is included in the user's turn."
            }
         },
         "title": "RealtimeInputConfig",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "SessionResumptionConfig": {
         "additionalProperties": false,
         "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
         "properties": {
            "handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
               "title": "Handle"
            },
            "transparent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
               "title": "Transparent"
            }
         },
         "title": "SessionResumptionConfig",
         "type": "object"
      },
      "SlidingWindow": {
         "additionalProperties": false,
         "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
         "properties": {
            "targetTokens": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
               "title": "Targettokens"
            }
         },
         "title": "SlidingWindow",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "SpeechConfig": {
         "additionalProperties": false,
         "description": "The speech generation configuration.",
         "properties": {
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            },
            "multiSpeakerVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the multi-speaker setup.\n          It is mutually exclusive with the voice_config field.\n          "
            },
            "languageCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Language code (ISO 639. e.g. en-US) for the speech synthesization.\n      Only available for Live API.\n      ",
               "title": "Languagecode"
            }
         },
         "title": "SpeechConfig",
         "type": "object"
      },
      "StartSensitivity": {
         "description": "Start of speech sensitivity.",
         "enum": [
            "START_SENSITIVITY_UNSPECIFIED",
            "START_SENSITIVITY_HIGH",
            "START_SENSITIVITY_LOW"
         ],
         "title": "StartSensitivity",
         "type": "string"
      },
      "Tool": {
         "additionalProperties": false,
         "description": "Tool details of a tool that the model may use to generate a response.",
         "properties": {
            "functionDeclarations": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionDeclaration"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of function declarations that the tool supports.",
               "title": "Functiondeclarations"
            },
            "retrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Retrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
            },
            "googleSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
            },
            "googleSearchRetrieval": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleSearchRetrieval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
            },
            "enterpriseWebSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EnterpriseWebSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
            },
            "googleMaps": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GoogleMaps"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
            },
            "urlContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Tool to support URL context retrieval."
            },
            "codeExecution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolCodeExecution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
            }
         },
         "title": "Tool",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "TurnCoverage": {
         "description": "Options about which input is included in the user's turn.",
         "enum": [
            "TURN_COVERAGE_UNSPECIFIED",
            "TURN_INCLUDES_ONLY_ACTIVITY",
            "TURN_INCLUDES_ALL_INPUT"
         ],
         "title": "TurnCoverage",
         "type": "string"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field config: Optional[LiveConnectConfig] = None

Configuration specific to Live API connections created using this token.

field model: Optional[str] = None

ID of the model to configure in the ephemeral token for Live API. For a list of models, see Gemini models <https://ai.google.dev/gemini-api/docs/models>.

class genai.types.LiveEphemeralParametersDict

Bases: TypedDict

Config for LiveEphemeralParameters for Auth Token creation.

config: Optional[LiveConnectConfigDict]

Configuration specific to Live API connections created using this token.

model: Optional[str]

ID of the model to configure in the ephemeral token for Live API. For a list of models, see Gemini models <https://ai.google.dev/gemini-api/docs/models>.

pydantic model genai.types.LiveMusicClientContent

Bases: BaseModel

User input to start or steer the music.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicClientContent",
   "description": "User input to start or steer the music.",
   "type": "object",
   "properties": {
      "weightedPrompts": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/WeightedPrompt"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Weighted prompts as the model input.",
         "title": "Weightedprompts"
      }
   },
   "$defs": {
      "WeightedPrompt": {
         "additionalProperties": false,
         "description": "Maps a prompt to a relative weight to steer music generation.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text prompt.",
               "title": "Text"
            },
            "weight": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
               "title": "Weight"
            }
         },
         "title": "WeightedPrompt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field weighted_prompts: Optional[list[WeightedPrompt]] = None (alias 'weightedPrompts')

Weighted prompts as the model input.

class genai.types.LiveMusicClientContentDict

Bases: TypedDict

User input to start or steer the music.

weighted_prompts: Optional[list[WeightedPromptDict]]

Weighted prompts as the model input.

pydantic model genai.types.LiveMusicClientMessage

Bases: BaseModel

Messages sent by the client in the LiveMusicClientMessage call.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicClientMessage",
   "description": "Messages sent by the client in the LiveMusicClientMessage call.",
   "type": "object",
   "properties": {
      "setup": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicClientSetup"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Message to be sent in the first (and only in the first) `LiveMusicClientMessage`.\n      Clients should wait for a `LiveMusicSetupComplete` message before\n      sending any additional messages."
      },
      "clientContent": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicClientContent"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "User input to influence music generation."
      },
      "musicGenerationConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicGenerationConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for music generation."
      },
      "playbackControl": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicPlaybackControl"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Playback control signal for the music generation."
      }
   },
   "$defs": {
      "LiveMusicClientContent": {
         "additionalProperties": false,
         "description": "User input to start or steer the music.",
         "properties": {
            "weightedPrompts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/WeightedPrompt"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts as the model input.",
               "title": "Weightedprompts"
            }
         },
         "title": "LiveMusicClientContent",
         "type": "object"
      },
      "LiveMusicClientSetup": {
         "additionalProperties": false,
         "description": "Message to be sent by the system when connecting to the API.",
         "properties": {
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The model's resource name. Format: `models/{model}`.",
               "title": "Model"
            }
         },
         "title": "LiveMusicClientSetup",
         "type": "object"
      },
      "LiveMusicGenerationConfig": {
         "additionalProperties": false,
         "description": "Configuration for music generation.",
         "properties": {
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the variance in audio generation. Higher values produce\n      higher variance. Range is [0.0, 3.0].",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how the model selects tokens for output. Samples the topK\n      tokens with the highest probabilities. Range is [1, 1000].",
               "title": "Topk"
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Seeds audio generation. If not set, the request uses a randomly\n      generated seed.",
               "title": "Seed"
            },
            "guidance": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how closely the model follows prompts.\n      Higher guidance follows more closely, but will make transitions more\n      abrupt. Range is [0.0, 6.0].",
               "title": "Guidance"
            },
            "bpm": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Beats per minute. Range is [60, 200].",
               "title": "Bpm"
            },
            "density": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Density of sounds. Range is [0.0, 1.0].",
               "title": "Density"
            },
            "brightness": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Brightness of the music. Range is [0.0, 1.0].",
               "title": "Brightness"
            },
            "scale": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Scale"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scale of the generated music."
            },
            "muteBass": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain bass.",
               "title": "Mutebass"
            },
            "muteDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain drums.",
               "title": "Mutedrums"
            },
            "onlyBassAndDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain only bass and drums.",
               "title": "Onlybassanddrums"
            },
            "musicGenerationMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MusicGenerationMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of music generation. Default mode is QUALITY."
            }
         },
         "title": "LiveMusicGenerationConfig",
         "type": "object"
      },
      "LiveMusicPlaybackControl": {
         "description": "The playback control signal to apply to the music generation.",
         "enum": [
            "PLAYBACK_CONTROL_UNSPECIFIED",
            "PLAY",
            "PAUSE",
            "STOP",
            "RESET_CONTEXT"
         ],
         "title": "LiveMusicPlaybackControl",
         "type": "string"
      },
      "MusicGenerationMode": {
         "description": "The mode of music generation.",
         "enum": [
            "MUSIC_GENERATION_MODE_UNSPECIFIED",
            "QUALITY",
            "DIVERSITY"
         ],
         "title": "MusicGenerationMode",
         "type": "string"
      },
      "Scale": {
         "description": "Scale of the generated music.",
         "enum": [
            "SCALE_UNSPECIFIED",
            "C_MAJOR_A_MINOR",
            "D_FLAT_MAJOR_B_FLAT_MINOR",
            "D_MAJOR_B_MINOR",
            "E_FLAT_MAJOR_C_MINOR",
            "E_MAJOR_D_FLAT_MINOR",
            "F_MAJOR_D_MINOR",
            "G_FLAT_MAJOR_E_FLAT_MINOR",
            "G_MAJOR_E_MINOR",
            "A_FLAT_MAJOR_F_MINOR",
            "A_MAJOR_G_FLAT_MINOR",
            "B_FLAT_MAJOR_G_MINOR",
            "B_MAJOR_A_FLAT_MINOR"
         ],
         "title": "Scale",
         "type": "string"
      },
      "WeightedPrompt": {
         "additionalProperties": false,
         "description": "Maps a prompt to a relative weight to steer music generation.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text prompt.",
               "title": "Text"
            },
            "weight": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
               "title": "Weight"
            }
         },
         "title": "WeightedPrompt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field client_content: Optional[LiveMusicClientContent] = None (alias 'clientContent')

User input to influence music generation.

field music_generation_config: Optional[LiveMusicGenerationConfig] = None (alias 'musicGenerationConfig')

Configuration for music generation.

field playback_control: Optional[LiveMusicPlaybackControl] = None (alias 'playbackControl')

Playback control signal for the music generation.

field setup: Optional[LiveMusicClientSetup] = None

Message to be sent in the first (and only in the first) LiveMusicClientMessage. Clients should wait for a LiveMusicSetupComplete message before sending any additional messages.

class genai.types.LiveMusicClientMessageDict

Bases: TypedDict

Messages sent by the client in the LiveMusicClientMessage call.

client_content: Optional[LiveMusicClientContentDict]

User input to influence music generation.

music_generation_config: Optional[LiveMusicGenerationConfigDict]

Configuration for music generation.

playback_control: Optional[LiveMusicPlaybackControl]

Playback control signal for the music generation.

setup: Optional[LiveMusicClientSetupDict]

Message to be sent in the first (and only in the first) LiveMusicClientMessage. Clients should wait for a LiveMusicSetupComplete message before sending any additional messages.

pydantic model genai.types.LiveMusicClientSetup

Bases: BaseModel

Message to be sent by the system when connecting to the API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicClientSetup",
   "description": "Message to be sent by the system when connecting to the API.",
   "type": "object",
   "properties": {
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The model's resource name. Format: `models/{model}`.",
         "title": "Model"
      }
   },
   "additionalProperties": false
}

Fields:
field model: Optional[str] = None

The model’s resource name. Format: models/{model}.

class genai.types.LiveMusicClientSetupDict

Bases: TypedDict

Message to be sent by the system when connecting to the API.

model: Optional[str]

models/{model}.

Type:

The model’s resource name. Format

pydantic model genai.types.LiveMusicConnectParameters

Bases: BaseModel

Parameters for connecting to the live API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicConnectParameters",
   "description": "Parameters for connecting to the live API.",
   "type": "object",
   "properties": {
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The model's resource name.",
         "title": "Model"
      }
   },
   "additionalProperties": false
}

Fields:
field model: Optional[str] = None

The model’s resource name.

class genai.types.LiveMusicConnectParametersDict

Bases: TypedDict

Parameters for connecting to the live API.

model: Optional[str]

The model’s resource name.

pydantic model genai.types.LiveMusicFilteredPrompt

Bases: BaseModel

A prompt that was filtered with the reason.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicFilteredPrompt",
   "description": "A prompt that was filtered with the reason.",
   "type": "object",
   "properties": {
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The text prompt that was filtered.",
         "title": "Text"
      },
      "filteredReason": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reason the prompt was filtered.",
         "title": "Filteredreason"
      }
   },
   "additionalProperties": false
}

Fields:
field filtered_reason: Optional[str] = None (alias 'filteredReason')

The reason the prompt was filtered.

field text: Optional[str] = None

The text prompt that was filtered.

class genai.types.LiveMusicFilteredPromptDict

Bases: TypedDict

A prompt that was filtered with the reason.

filtered_reason: Optional[str]

The reason the prompt was filtered.

text: Optional[str]

The text prompt that was filtered.

pydantic model genai.types.LiveMusicGenerationConfig

Bases: BaseModel

Configuration for music generation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicGenerationConfig",
   "description": "Configuration for music generation.",
   "type": "object",
   "properties": {
      "temperature": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the variance in audio generation. Higher values produce\n      higher variance. Range is [0.0, 3.0].",
         "title": "Temperature"
      },
      "topK": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls how the model selects tokens for output. Samples the topK\n      tokens with the highest probabilities. Range is [1, 1000].",
         "title": "Topk"
      },
      "seed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Seeds audio generation. If not set, the request uses a randomly\n      generated seed.",
         "title": "Seed"
      },
      "guidance": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls how closely the model follows prompts.\n      Higher guidance follows more closely, but will make transitions more\n      abrupt. Range is [0.0, 6.0].",
         "title": "Guidance"
      },
      "bpm": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Beats per minute. Range is [60, 200].",
         "title": "Bpm"
      },
      "density": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Density of sounds. Range is [0.0, 1.0].",
         "title": "Density"
      },
      "brightness": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Brightness of the music. Range is [0.0, 1.0].",
         "title": "Brightness"
      },
      "scale": {
         "anyOf": [
            {
               "$ref": "#/$defs/Scale"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Scale of the generated music."
      },
      "muteBass": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether the audio output should contain bass.",
         "title": "Mutebass"
      },
      "muteDrums": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether the audio output should contain drums.",
         "title": "Mutedrums"
      },
      "onlyBassAndDrums": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether the audio output should contain only bass and drums.",
         "title": "Onlybassanddrums"
      },
      "musicGenerationMode": {
         "anyOf": [
            {
               "$ref": "#/$defs/MusicGenerationMode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The mode of music generation. Default mode is QUALITY."
      }
   },
   "$defs": {
      "MusicGenerationMode": {
         "description": "The mode of music generation.",
         "enum": [
            "MUSIC_GENERATION_MODE_UNSPECIFIED",
            "QUALITY",
            "DIVERSITY"
         ],
         "title": "MusicGenerationMode",
         "type": "string"
      },
      "Scale": {
         "description": "Scale of the generated music.",
         "enum": [
            "SCALE_UNSPECIFIED",
            "C_MAJOR_A_MINOR",
            "D_FLAT_MAJOR_B_FLAT_MINOR",
            "D_MAJOR_B_MINOR",
            "E_FLAT_MAJOR_C_MINOR",
            "E_MAJOR_D_FLAT_MINOR",
            "F_MAJOR_D_MINOR",
            "G_FLAT_MAJOR_E_FLAT_MINOR",
            "G_MAJOR_E_MINOR",
            "A_FLAT_MAJOR_F_MINOR",
            "A_MAJOR_G_FLAT_MINOR",
            "B_FLAT_MAJOR_G_MINOR",
            "B_MAJOR_A_FLAT_MINOR"
         ],
         "title": "Scale",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field bpm: Optional[int] = None

Beats per minute. Range is [60, 200].

field brightness: Optional[float] = None

Brightness of the music. Range is [0.0, 1.0].

field density: Optional[float] = None

Density of sounds. Range is [0.0, 1.0].

field guidance: Optional[float] = None

Controls how closely the model follows prompts. Higher guidance follows more closely, but will make transitions more abrupt. Range is [0.0, 6.0].

field music_generation_mode: Optional[MusicGenerationMode] = None (alias 'musicGenerationMode')

The mode of music generation. Default mode is QUALITY.

field mute_bass: Optional[bool] = None (alias 'muteBass')

Whether the audio output should contain bass.

field mute_drums: Optional[bool] = None (alias 'muteDrums')

Whether the audio output should contain drums.

field only_bass_and_drums: Optional[bool] = None (alias 'onlyBassAndDrums')

Whether the audio output should contain only bass and drums.

field scale: Optional[Scale] = None

Scale of the generated music.

field seed: Optional[int] = None

Seeds audio generation. If not set, the request uses a randomly generated seed.

field temperature: Optional[float] = None

Controls the variance in audio generation. Higher values produce higher variance. Range is [0.0, 3.0].

field top_k: Optional[int] = None (alias 'topK')

Controls how the model selects tokens for output. Samples the topK tokens with the highest probabilities. Range is [1, 1000].

class genai.types.LiveMusicGenerationConfigDict

Bases: TypedDict

Configuration for music generation.

bpm: Optional[int]

Beats per minute. Range is [60, 200].

brightness: Optional[float]

Brightness of the music. Range is [0.0, 1.0].

density: Optional[float]

Density of sounds. Range is [0.0, 1.0].

guidance: Optional[float]

Controls how closely the model follows prompts. Higher guidance follows more closely, but will make transitions more abrupt. Range is [0.0, 6.0].

music_generation_mode: Optional[MusicGenerationMode]

The mode of music generation. Default mode is QUALITY.

mute_bass: Optional[bool]

Whether the audio output should contain bass.

mute_drums: Optional[bool]

Whether the audio output should contain drums.

only_bass_and_drums: Optional[bool]

Whether the audio output should contain only bass and drums.

scale: Optional[Scale]

Scale of the generated music.

seed: Optional[int]

Seeds audio generation. If not set, the request uses a randomly generated seed.

temperature: Optional[float]

Controls the variance in audio generation. Higher values produce higher variance. Range is [0.0, 3.0].

top_k: Optional[int]

Controls how the model selects tokens for output. Samples the topK tokens with the highest probabilities. Range is [1, 1000].

class genai.types.LiveMusicPlaybackControl(*values)

Bases: CaseInSensitiveEnum

The playback control signal to apply to the music generation.

PAUSE = 'PAUSE'

Hold the music generation. Use PLAY to resume from the current position.

PLAY = 'PLAY'

Start generating the music.

PLAYBACK_CONTROL_UNSPECIFIED = 'PLAYBACK_CONTROL_UNSPECIFIED'

This value is unused.

RESET_CONTEXT = 'RESET_CONTEXT'

Reset the context of the music generation without stopping it. Retains the current prompts and config.

STOP = 'STOP'

Stop the music generation and reset the context (prompts retained). Use PLAY to restart the music generation.

pydantic model genai.types.LiveMusicServerContent

Bases: BaseModel

Server update generated by the model in response to client messages.

Content is generated as quickly as possible, and not in real time. Clients may choose to buffer and play it out in real time.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicServerContent",
   "description": "Server update generated by the model in response to client messages.\n\nContent is generated as quickly as possible, and not in real time.\nClients may choose to buffer and play it out in real time.",
   "type": "object",
   "properties": {
      "audioChunks": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/AudioChunk"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The audio chunks that the model has generated.",
         "title": "Audiochunks"
      }
   },
   "$defs": {
      "AudioChunk": {
         "additionalProperties": false,
         "description": "Representation of an audio chunk.",
         "properties": {
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Raw byets of audio data.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "MIME type of the audio chunk.",
               "title": "Mimetype"
            },
            "sourceMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicSourceMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Prompts and config used for generating this audio chunk."
            }
         },
         "title": "AudioChunk",
         "type": "object"
      },
      "LiveMusicClientContent": {
         "additionalProperties": false,
         "description": "User input to start or steer the music.",
         "properties": {
            "weightedPrompts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/WeightedPrompt"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts as the model input.",
               "title": "Weightedprompts"
            }
         },
         "title": "LiveMusicClientContent",
         "type": "object"
      },
      "LiveMusicGenerationConfig": {
         "additionalProperties": false,
         "description": "Configuration for music generation.",
         "properties": {
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the variance in audio generation. Higher values produce\n      higher variance. Range is [0.0, 3.0].",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how the model selects tokens for output. Samples the topK\n      tokens with the highest probabilities. Range is [1, 1000].",
               "title": "Topk"
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Seeds audio generation. If not set, the request uses a randomly\n      generated seed.",
               "title": "Seed"
            },
            "guidance": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how closely the model follows prompts.\n      Higher guidance follows more closely, but will make transitions more\n      abrupt. Range is [0.0, 6.0].",
               "title": "Guidance"
            },
            "bpm": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Beats per minute. Range is [60, 200].",
               "title": "Bpm"
            },
            "density": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Density of sounds. Range is [0.0, 1.0].",
               "title": "Density"
            },
            "brightness": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Brightness of the music. Range is [0.0, 1.0].",
               "title": "Brightness"
            },
            "scale": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Scale"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scale of the generated music."
            },
            "muteBass": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain bass.",
               "title": "Mutebass"
            },
            "muteDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain drums.",
               "title": "Mutedrums"
            },
            "onlyBassAndDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain only bass and drums.",
               "title": "Onlybassanddrums"
            },
            "musicGenerationMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MusicGenerationMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of music generation. Default mode is QUALITY."
            }
         },
         "title": "LiveMusicGenerationConfig",
         "type": "object"
      },
      "LiveMusicSourceMetadata": {
         "additionalProperties": false,
         "description": "Prompts and config used for generating this audio chunk.",
         "properties": {
            "clientContent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicClientContent"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts for generating this audio chunk."
            },
            "musicGenerationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicGenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Music generation config for generating this audio chunk."
            }
         },
         "title": "LiveMusicSourceMetadata",
         "type": "object"
      },
      "MusicGenerationMode": {
         "description": "The mode of music generation.",
         "enum": [
            "MUSIC_GENERATION_MODE_UNSPECIFIED",
            "QUALITY",
            "DIVERSITY"
         ],
         "title": "MusicGenerationMode",
         "type": "string"
      },
      "Scale": {
         "description": "Scale of the generated music.",
         "enum": [
            "SCALE_UNSPECIFIED",
            "C_MAJOR_A_MINOR",
            "D_FLAT_MAJOR_B_FLAT_MINOR",
            "D_MAJOR_B_MINOR",
            "E_FLAT_MAJOR_C_MINOR",
            "E_MAJOR_D_FLAT_MINOR",
            "F_MAJOR_D_MINOR",
            "G_FLAT_MAJOR_E_FLAT_MINOR",
            "G_MAJOR_E_MINOR",
            "A_FLAT_MAJOR_F_MINOR",
            "A_MAJOR_G_FLAT_MINOR",
            "B_FLAT_MAJOR_G_MINOR",
            "B_MAJOR_A_FLAT_MINOR"
         ],
         "title": "Scale",
         "type": "string"
      },
      "WeightedPrompt": {
         "additionalProperties": false,
         "description": "Maps a prompt to a relative weight to steer music generation.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text prompt.",
               "title": "Text"
            },
            "weight": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
               "title": "Weight"
            }
         },
         "title": "WeightedPrompt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field audio_chunks: Optional[list[AudioChunk]] = None (alias 'audioChunks')

The audio chunks that the model has generated.

class genai.types.LiveMusicServerContentDict

Bases: TypedDict

Server update generated by the model in response to client messages.

Content is generated as quickly as possible, and not in real time. Clients may choose to buffer and play it out in real time.

audio_chunks: Optional[list[AudioChunkDict]]

The audio chunks that the model has generated.

pydantic model genai.types.LiveMusicServerMessage

Bases: BaseModel

Response message for the LiveMusicClientMessage call.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicServerMessage",
   "description": "Response message for the LiveMusicClientMessage call.",
   "type": "object",
   "properties": {
      "setupComplete": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicServerSetupComplete"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Message sent in response to a `LiveMusicClientSetup` message from the client.\n      Clients should wait for this message before sending any additional messages."
      },
      "serverContent": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicServerContent"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Content generated by the model in response to client messages."
      },
      "filteredPrompt": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicFilteredPrompt"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A prompt that was filtered with the reason."
      }
   },
   "$defs": {
      "AudioChunk": {
         "additionalProperties": false,
         "description": "Representation of an audio chunk.",
         "properties": {
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Raw byets of audio data.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "MIME type of the audio chunk.",
               "title": "Mimetype"
            },
            "sourceMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicSourceMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Prompts and config used for generating this audio chunk."
            }
         },
         "title": "AudioChunk",
         "type": "object"
      },
      "LiveMusicClientContent": {
         "additionalProperties": false,
         "description": "User input to start or steer the music.",
         "properties": {
            "weightedPrompts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/WeightedPrompt"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts as the model input.",
               "title": "Weightedprompts"
            }
         },
         "title": "LiveMusicClientContent",
         "type": "object"
      },
      "LiveMusicFilteredPrompt": {
         "additionalProperties": false,
         "description": "A prompt that was filtered with the reason.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The text prompt that was filtered.",
               "title": "Text"
            },
            "filteredReason": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The reason the prompt was filtered.",
               "title": "Filteredreason"
            }
         },
         "title": "LiveMusicFilteredPrompt",
         "type": "object"
      },
      "LiveMusicGenerationConfig": {
         "additionalProperties": false,
         "description": "Configuration for music generation.",
         "properties": {
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the variance in audio generation. Higher values produce\n      higher variance. Range is [0.0, 3.0].",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how the model selects tokens for output. Samples the topK\n      tokens with the highest probabilities. Range is [1, 1000].",
               "title": "Topk"
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Seeds audio generation. If not set, the request uses a randomly\n      generated seed.",
               "title": "Seed"
            },
            "guidance": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how closely the model follows prompts.\n      Higher guidance follows more closely, but will make transitions more\n      abrupt. Range is [0.0, 6.0].",
               "title": "Guidance"
            },
            "bpm": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Beats per minute. Range is [60, 200].",
               "title": "Bpm"
            },
            "density": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Density of sounds. Range is [0.0, 1.0].",
               "title": "Density"
            },
            "brightness": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Brightness of the music. Range is [0.0, 1.0].",
               "title": "Brightness"
            },
            "scale": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Scale"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scale of the generated music."
            },
            "muteBass": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain bass.",
               "title": "Mutebass"
            },
            "muteDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain drums.",
               "title": "Mutedrums"
            },
            "onlyBassAndDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain only bass and drums.",
               "title": "Onlybassanddrums"
            },
            "musicGenerationMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MusicGenerationMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of music generation. Default mode is QUALITY."
            }
         },
         "title": "LiveMusicGenerationConfig",
         "type": "object"
      },
      "LiveMusicServerContent": {
         "additionalProperties": false,
         "description": "Server update generated by the model in response to client messages.\n\nContent is generated as quickly as possible, and not in real time.\nClients may choose to buffer and play it out in real time.",
         "properties": {
            "audioChunks": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/AudioChunk"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The audio chunks that the model has generated.",
               "title": "Audiochunks"
            }
         },
         "title": "LiveMusicServerContent",
         "type": "object"
      },
      "LiveMusicServerSetupComplete": {
         "additionalProperties": false,
         "description": "Sent in response to a `LiveMusicClientSetup` message from the client.",
         "properties": {},
         "title": "LiveMusicServerSetupComplete",
         "type": "object"
      },
      "LiveMusicSourceMetadata": {
         "additionalProperties": false,
         "description": "Prompts and config used for generating this audio chunk.",
         "properties": {
            "clientContent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicClientContent"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts for generating this audio chunk."
            },
            "musicGenerationConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveMusicGenerationConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Music generation config for generating this audio chunk."
            }
         },
         "title": "LiveMusicSourceMetadata",
         "type": "object"
      },
      "MusicGenerationMode": {
         "description": "The mode of music generation.",
         "enum": [
            "MUSIC_GENERATION_MODE_UNSPECIFIED",
            "QUALITY",
            "DIVERSITY"
         ],
         "title": "MusicGenerationMode",
         "type": "string"
      },
      "Scale": {
         "description": "Scale of the generated music.",
         "enum": [
            "SCALE_UNSPECIFIED",
            "C_MAJOR_A_MINOR",
            "D_FLAT_MAJOR_B_FLAT_MINOR",
            "D_MAJOR_B_MINOR",
            "E_FLAT_MAJOR_C_MINOR",
            "E_MAJOR_D_FLAT_MINOR",
            "F_MAJOR_D_MINOR",
            "G_FLAT_MAJOR_E_FLAT_MINOR",
            "G_MAJOR_E_MINOR",
            "A_FLAT_MAJOR_F_MINOR",
            "A_MAJOR_G_FLAT_MINOR",
            "B_FLAT_MAJOR_G_MINOR",
            "B_MAJOR_A_FLAT_MINOR"
         ],
         "title": "Scale",
         "type": "string"
      },
      "WeightedPrompt": {
         "additionalProperties": false,
         "description": "Maps a prompt to a relative weight to steer music generation.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text prompt.",
               "title": "Text"
            },
            "weight": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
               "title": "Weight"
            }
         },
         "title": "WeightedPrompt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field filtered_prompt: Optional[LiveMusicFilteredPrompt] = None (alias 'filteredPrompt')

A prompt that was filtered with the reason.

field server_content: Optional[LiveMusicServerContent] = None (alias 'serverContent')

Content generated by the model in response to client messages.

field setup_complete: Optional[LiveMusicServerSetupComplete] = None (alias 'setupComplete')

Message sent in response to a LiveMusicClientSetup message from the client. Clients should wait for this message before sending any additional messages.

class genai.types.LiveMusicServerMessageDict

Bases: TypedDict

Response message for the LiveMusicClientMessage call.

filtered_prompt: Optional[LiveMusicFilteredPromptDict]

A prompt that was filtered with the reason.

server_content: Optional[LiveMusicServerContentDict]

Content generated by the model in response to client messages.

setup_complete: Optional[LiveMusicServerSetupCompleteDict]

Message sent in response to a LiveMusicClientSetup message from the client. Clients should wait for this message before sending any additional messages.

pydantic model genai.types.LiveMusicServerSetupComplete

Bases: BaseModel

Sent in response to a LiveMusicClientSetup message from the client.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicServerSetupComplete",
   "description": "Sent in response to a `LiveMusicClientSetup` message from the client.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.LiveMusicServerSetupCompleteDict

Bases: TypedDict

Sent in response to a LiveMusicClientSetup message from the client.

pydantic model genai.types.LiveMusicSetConfigParameters

Bases: BaseModel

Parameters for setting config for the live music API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicSetConfigParameters",
   "description": "Parameters for setting config for the live music API.",
   "type": "object",
   "properties": {
      "musicGenerationConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicGenerationConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for music generation."
      }
   },
   "$defs": {
      "LiveMusicGenerationConfig": {
         "additionalProperties": false,
         "description": "Configuration for music generation.",
         "properties": {
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the variance in audio generation. Higher values produce\n      higher variance. Range is [0.0, 3.0].",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how the model selects tokens for output. Samples the topK\n      tokens with the highest probabilities. Range is [1, 1000].",
               "title": "Topk"
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Seeds audio generation. If not set, the request uses a randomly\n      generated seed.",
               "title": "Seed"
            },
            "guidance": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how closely the model follows prompts.\n      Higher guidance follows more closely, but will make transitions more\n      abrupt. Range is [0.0, 6.0].",
               "title": "Guidance"
            },
            "bpm": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Beats per minute. Range is [60, 200].",
               "title": "Bpm"
            },
            "density": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Density of sounds. Range is [0.0, 1.0].",
               "title": "Density"
            },
            "brightness": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Brightness of the music. Range is [0.0, 1.0].",
               "title": "Brightness"
            },
            "scale": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Scale"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scale of the generated music."
            },
            "muteBass": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain bass.",
               "title": "Mutebass"
            },
            "muteDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain drums.",
               "title": "Mutedrums"
            },
            "onlyBassAndDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain only bass and drums.",
               "title": "Onlybassanddrums"
            },
            "musicGenerationMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MusicGenerationMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of music generation. Default mode is QUALITY."
            }
         },
         "title": "LiveMusicGenerationConfig",
         "type": "object"
      },
      "MusicGenerationMode": {
         "description": "The mode of music generation.",
         "enum": [
            "MUSIC_GENERATION_MODE_UNSPECIFIED",
            "QUALITY",
            "DIVERSITY"
         ],
         "title": "MusicGenerationMode",
         "type": "string"
      },
      "Scale": {
         "description": "Scale of the generated music.",
         "enum": [
            "SCALE_UNSPECIFIED",
            "C_MAJOR_A_MINOR",
            "D_FLAT_MAJOR_B_FLAT_MINOR",
            "D_MAJOR_B_MINOR",
            "E_FLAT_MAJOR_C_MINOR",
            "E_MAJOR_D_FLAT_MINOR",
            "F_MAJOR_D_MINOR",
            "G_FLAT_MAJOR_E_FLAT_MINOR",
            "G_MAJOR_E_MINOR",
            "A_FLAT_MAJOR_F_MINOR",
            "A_MAJOR_G_FLAT_MINOR",
            "B_FLAT_MAJOR_G_MINOR",
            "B_MAJOR_A_FLAT_MINOR"
         ],
         "title": "Scale",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field music_generation_config: Optional[LiveMusicGenerationConfig] = None (alias 'musicGenerationConfig')

Configuration for music generation.

class genai.types.LiveMusicSetConfigParametersDict

Bases: TypedDict

Parameters for setting config for the live music API.

music_generation_config: Optional[LiveMusicGenerationConfigDict]

Configuration for music generation.

pydantic model genai.types.LiveMusicSetWeightedPromptsParameters

Bases: BaseModel

Parameters for setting weighted prompts for the live music API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicSetWeightedPromptsParameters",
   "description": "Parameters for setting weighted prompts for the live music API.",
   "type": "object",
   "properties": {
      "weightedPrompts": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/WeightedPrompt"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A map of text prompts to weights to use for the generation request.",
         "title": "Weightedprompts"
      }
   },
   "$defs": {
      "WeightedPrompt": {
         "additionalProperties": false,
         "description": "Maps a prompt to a relative weight to steer music generation.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text prompt.",
               "title": "Text"
            },
            "weight": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
               "title": "Weight"
            }
         },
         "title": "WeightedPrompt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field weighted_prompts: Optional[list[WeightedPrompt]] = None (alias 'weightedPrompts')

A map of text prompts to weights to use for the generation request.

class genai.types.LiveMusicSetWeightedPromptsParametersDict

Bases: TypedDict

Parameters for setting weighted prompts for the live music API.

weighted_prompts: Optional[list[WeightedPromptDict]]

A map of text prompts to weights to use for the generation request.

pydantic model genai.types.LiveMusicSourceMetadata

Bases: BaseModel

Prompts and config used for generating this audio chunk.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveMusicSourceMetadata",
   "description": "Prompts and config used for generating this audio chunk.",
   "type": "object",
   "properties": {
      "clientContent": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicClientContent"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Weighted prompts for generating this audio chunk."
      },
      "musicGenerationConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveMusicGenerationConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Music generation config for generating this audio chunk."
      }
   },
   "$defs": {
      "LiveMusicClientContent": {
         "additionalProperties": false,
         "description": "User input to start or steer the music.",
         "properties": {
            "weightedPrompts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/WeightedPrompt"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weighted prompts as the model input.",
               "title": "Weightedprompts"
            }
         },
         "title": "LiveMusicClientContent",
         "type": "object"
      },
      "LiveMusicGenerationConfig": {
         "additionalProperties": false,
         "description": "Configuration for music generation.",
         "properties": {
            "temperature": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the variance in audio generation. Higher values produce\n      higher variance. Range is [0.0, 3.0].",
               "title": "Temperature"
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how the model selects tokens for output. Samples the topK\n      tokens with the highest probabilities. Range is [1, 1000].",
               "title": "Topk"
            },
            "seed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Seeds audio generation. If not set, the request uses a randomly\n      generated seed.",
               "title": "Seed"
            },
            "guidance": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls how closely the model follows prompts.\n      Higher guidance follows more closely, but will make transitions more\n      abrupt. Range is [0.0, 6.0].",
               "title": "Guidance"
            },
            "bpm": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Beats per minute. Range is [60, 200].",
               "title": "Bpm"
            },
            "density": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Density of sounds. Range is [0.0, 1.0].",
               "title": "Density"
            },
            "brightness": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Brightness of the music. Range is [0.0, 1.0].",
               "title": "Brightness"
            },
            "scale": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Scale"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scale of the generated music."
            },
            "muteBass": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain bass.",
               "title": "Mutebass"
            },
            "muteDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain drums.",
               "title": "Mutedrums"
            },
            "onlyBassAndDrums": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether the audio output should contain only bass and drums.",
               "title": "Onlybassanddrums"
            },
            "musicGenerationMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MusicGenerationMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of music generation. Default mode is QUALITY."
            }
         },
         "title": "LiveMusicGenerationConfig",
         "type": "object"
      },
      "MusicGenerationMode": {
         "description": "The mode of music generation.",
         "enum": [
            "MUSIC_GENERATION_MODE_UNSPECIFIED",
            "QUALITY",
            "DIVERSITY"
         ],
         "title": "MusicGenerationMode",
         "type": "string"
      },
      "Scale": {
         "description": "Scale of the generated music.",
         "enum": [
            "SCALE_UNSPECIFIED",
            "C_MAJOR_A_MINOR",
            "D_FLAT_MAJOR_B_FLAT_MINOR",
            "D_MAJOR_B_MINOR",
            "E_FLAT_MAJOR_C_MINOR",
            "E_MAJOR_D_FLAT_MINOR",
            "F_MAJOR_D_MINOR",
            "G_FLAT_MAJOR_E_FLAT_MINOR",
            "G_MAJOR_E_MINOR",
            "A_FLAT_MAJOR_F_MINOR",
            "A_MAJOR_G_FLAT_MINOR",
            "B_FLAT_MAJOR_G_MINOR",
            "B_MAJOR_A_FLAT_MINOR"
         ],
         "title": "Scale",
         "type": "string"
      },
      "WeightedPrompt": {
         "additionalProperties": false,
         "description": "Maps a prompt to a relative weight to steer music generation.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text prompt.",
               "title": "Text"
            },
            "weight": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
               "title": "Weight"
            }
         },
         "title": "WeightedPrompt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field client_content: Optional[LiveMusicClientContent] = None (alias 'clientContent')

Weighted prompts for generating this audio chunk.

field music_generation_config: Optional[LiveMusicGenerationConfig] = None (alias 'musicGenerationConfig')

Music generation config for generating this audio chunk.

class genai.types.LiveMusicSourceMetadataDict

Bases: TypedDict

Prompts and config used for generating this audio chunk.

client_content: Optional[LiveMusicClientContentDict]

Weighted prompts for generating this audio chunk.

music_generation_config: Optional[LiveMusicGenerationConfigDict]

Music generation config for generating this audio chunk.

pydantic model genai.types.LiveSendRealtimeInputParameters

Bases: BaseModel

Parameters for sending realtime input to the live API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveSendRealtimeInputParameters",
   "description": "Parameters for sending realtime input to the live API.",
   "type": "object",
   "properties": {
      "media": {
         "anyOf": [
            {
               "$ref": "#/$defs/Blob"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Realtime input to send to the session.",
         "title": "Media"
      },
      "audio": {
         "anyOf": [
            {
               "$ref": "#/$defs/Blob"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The realtime audio input stream."
      },
      "audioStreamEnd": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "\nIndicates that the audio stream has ended, e.g. because the microphone was\nturned off.\n\nThis should only be sent when automatic activity detection is enabled\n(which is the default).\n\nThe client can reopen the stream by sending an audio message.\n",
         "title": "Audiostreamend"
      },
      "video": {
         "anyOf": [
            {
               "$ref": "#/$defs/Blob"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The realtime video input stream.",
         "title": "Video"
      },
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The realtime text input stream.",
         "title": "Text"
      },
      "activityStart": {
         "anyOf": [
            {
               "$ref": "#/$defs/ActivityStart"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Marks the start of user activity."
      },
      "activityEnd": {
         "anyOf": [
            {
               "$ref": "#/$defs/ActivityEnd"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Marks the end of user activity."
      }
   },
   "$defs": {
      "ActivityEnd": {
         "additionalProperties": false,
         "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {},
         "title": "ActivityEnd",
         "type": "object"
      },
      "ActivityStart": {
         "additionalProperties": false,
         "description": "Marks the start of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
         "properties": {},
         "title": "ActivityStart",
         "type": "object"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field activity_end: Optional[ActivityEnd] = None (alias 'activityEnd')

Marks the end of user activity.

field activity_start: Optional[ActivityStart] = None (alias 'activityStart')

Marks the start of user activity.

field audio: Optional[Blob] = None

The realtime audio input stream.

field audio_stream_end: Optional[bool] = None (alias 'audioStreamEnd')

Indicates that the audio stream has ended, e.g. because the microphone was turned off.

This should only be sent when automatic activity detection is enabled (which is the default).

The client can reopen the stream by sending an audio message.

field media: Union[Blob, Image, None] = None

Realtime input to send to the session.

field text: Optional[str] = None

The realtime text input stream.

field video: Union[Blob, Image, None] = None

The realtime video input stream.

class genai.types.LiveSendRealtimeInputParametersDict

Bases: TypedDict

Parameters for sending realtime input to the live API.

activity_end: Optional[ActivityEndDict]

Marks the end of user activity.

activity_start: Optional[ActivityStartDict]

Marks the start of user activity.

audio: Optional[BlobDict]

The realtime audio input stream.

audio_stream_end: Optional[bool]

Indicates that the audio stream has ended, e.g. because the microphone was turned off.

This should only be sent when automatic activity detection is enabled (which is the default).

The client can reopen the stream by sending an audio message.

media: Union[Blob, Image, BlobDict, None]

Realtime input to send to the session.

text: Optional[str]

The realtime text input stream.

video: Union[Blob, Image, BlobDict, None]

The realtime video input stream.

pydantic model genai.types.LiveServerContent

Bases: BaseModel

Incremental server update generated by the model in response to client messages.

Content is generated as quickly as possible, and not in real time. Clients may choose to buffer and play it out in real time.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveServerContent",
   "description": "Incremental server update generated by the model in response to client messages.\n\nContent is generated as quickly as possible, and not in real time. Clients\nmay choose to buffer and play it out in real time.",
   "type": "object",
   "properties": {
      "modelTurn": {
         "anyOf": [
            {
               "$ref": "#/$defs/Content"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The content that the model has generated as part of the current conversation with the user."
      },
      "turnComplete": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If true, indicates that the model is done generating. Generation will only start in response to additional client messages. Can be set alongside `content`, indicating that the `content` is the last in the turn.",
         "title": "Turncomplete"
      },
      "interrupted": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue.",
         "title": "Interrupted"
      },
      "groundingMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/GroundingMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Metadata returned to client when grounding is enabled."
      },
      "generationComplete": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If true, indicates that the model is done generating. When model is\n      interrupted while generating there will be no generation_complete message\n      in interrupted turn, it will go through interrupted > turn_complete.\n      When model assumes realtime playback there will be delay between\n      generation_complete and turn_complete that is caused by model\n      waiting for playback to finish. If true, indicates that the model\n      has finished generating all content. This is a signal to the client\n      that it can stop sending messages.",
         "title": "Generationcomplete"
      },
      "inputTranscription": {
         "anyOf": [
            {
               "$ref": "#/$defs/Transcription"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Input transcription. The transcription is independent to the model\n      turn which means it doesn\u2019t imply any ordering between transcription and\n      model turn."
      },
      "outputTranscription": {
         "anyOf": [
            {
               "$ref": "#/$defs/Transcription"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output transcription. The transcription is independent to the model\n      turn which means it doesn\u2019t imply any ordering between transcription and\n      model turn.\n      "
      },
      "urlContextMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/UrlContextMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Metadata related to url context retrieval tool."
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GroundingChunk": {
         "additionalProperties": false,
         "description": "Grounding chunk.",
         "properties": {
            "retrievedContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkRetrievedContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from context retrieved by the retrieval tools."
            },
            "web": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkWeb"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from the web."
            }
         },
         "title": "GroundingChunk",
         "type": "object"
      },
      "GroundingChunkRetrievedContext": {
         "additionalProperties": false,
         "description": "Chunk from context retrieved by the retrieval tools.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text of the attribution.",
               "title": "Text"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkRetrievedContext",
         "type": "object"
      },
      "GroundingChunkWeb": {
         "additionalProperties": false,
         "description": "Chunk from the web.",
         "properties": {
            "domain": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Domain of the (original) URI.",
               "title": "Domain"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the chunk.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the chunk.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkWeb",
         "type": "object"
      },
      "GroundingMetadata": {
         "additionalProperties": false,
         "description": "Metadata returned to client when grounding is enabled.",
         "properties": {
            "groundingChunks": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingChunk"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of supporting references retrieved from specified grounding source.",
               "title": "Groundingchunks"
            },
            "groundingSupports": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingSupport"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. List of grounding support.",
               "title": "Groundingsupports"
            },
            "retrievalMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetrievalMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output only. Retrieval metadata."
            },
            "retrievalQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Queries executed by the retrieval tools.",
               "title": "Retrievalqueries"
            },
            "searchEntryPoint": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SearchEntryPoint"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google search entry for the following-up web searches."
            },
            "webSearchQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web search queries for the following-up web search.",
               "title": "Websearchqueries"
            }
         },
         "title": "GroundingMetadata",
         "type": "object"
      },
      "GroundingSupport": {
         "additionalProperties": false,
         "description": "Grounding support.",
         "properties": {
            "confidenceScores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
               "title": "Confidencescores"
            },
            "groundingChunkIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.",
               "title": "Groundingchunkindices"
            },
            "segment": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Segment"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Segment of the content this support belongs to."
            }
         },
         "title": "GroundingSupport",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "RetrievalMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to retrieval in the grounding flow.",
         "properties": {
            "googleSearchDynamicRetrievalScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.",
               "title": "Googlesearchdynamicretrievalscore"
            }
         },
         "title": "RetrievalMetadata",
         "type": "object"
      },
      "SearchEntryPoint": {
         "additionalProperties": false,
         "description": "Google search entry point.",
         "properties": {
            "renderedContent": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
               "title": "Renderedcontent"
            },
            "sdkBlob": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Base64 encoded JSON representing array of tuple.",
               "title": "Sdkblob"
            }
         },
         "title": "SearchEntryPoint",
         "type": "object"
      },
      "Segment": {
         "additionalProperties": false,
         "description": "Segment of the content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
               "title": "Endindex"
            },
            "partIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The index of a Part object within its parent Content object.",
               "title": "Partindex"
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.",
               "title": "Startindex"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The text corresponding to the segment from the response.",
               "title": "Text"
            }
         },
         "title": "Segment",
         "type": "object"
      },
      "Transcription": {
         "additionalProperties": false,
         "description": "Audio transcription in Server Conent.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Transcription text.\n      ",
               "title": "Text"
            },
            "finished": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The bool indicates the end of the transcription.\n      ",
               "title": "Finished"
            }
         },
         "title": "Transcription",
         "type": "object"
      },
      "UrlContextMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to url context retrieval tool.",
         "properties": {
            "urlMetadata": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/UrlMetadata"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of url context.",
               "title": "Urlmetadata"
            }
         },
         "title": "UrlContextMetadata",
         "type": "object"
      },
      "UrlMetadata": {
         "additionalProperties": false,
         "description": "Context for a single url retrieval.",
         "properties": {
            "retrievedUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URL retrieved by the tool.",
               "title": "Retrievedurl"
            },
            "urlRetrievalStatus": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlRetrievalStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Status of the url retrieval."
            }
         },
         "title": "UrlMetadata",
         "type": "object"
      },
      "UrlRetrievalStatus": {
         "description": "Status of the url retrieval.",
         "enum": [
            "URL_RETRIEVAL_STATUS_UNSPECIFIED",
            "URL_RETRIEVAL_STATUS_SUCCESS",
            "URL_RETRIEVAL_STATUS_ERROR"
         ],
         "title": "UrlRetrievalStatus",
         "type": "string"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field generation_complete: Optional[bool] = None (alias 'generationComplete')

If true, indicates that the model is done generating. When model is interrupted while generating there will be no generation_complete message in interrupted turn, it will go through interrupted > turn_complete. When model assumes realtime playback there will be delay between generation_complete and turn_complete that is caused by model waiting for playback to finish. If true, indicates that the model has finished generating all content. This is a signal to the client that it can stop sending messages.

field grounding_metadata: Optional[GroundingMetadata] = None (alias 'groundingMetadata')

Metadata returned to client when grounding is enabled.

field input_transcription: Optional[Transcription] = None (alias 'inputTranscription')

Input transcription. The transcription is independent to the model turn which means it doesn’t imply any ordering between transcription and model turn.

field interrupted: Optional[bool] = None

If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue.

field model_turn: Optional[Content] = None (alias 'modelTurn')

The content that the model has generated as part of the current conversation with the user.

field output_transcription: Optional[Transcription] = None (alias 'outputTranscription')

Output transcription. The transcription is independent to the model turn which means it doesn’t imply any ordering between transcription and model turn.

field turn_complete: Optional[bool] = None (alias 'turnComplete')

If true, indicates that the model is done generating. Generation will only start in response to additional client messages. Can be set alongside content, indicating that the content is the last in the turn.

field url_context_metadata: Optional[UrlContextMetadata] = None (alias 'urlContextMetadata')

Metadata related to url context retrieval tool.

class genai.types.LiveServerContentDict

Bases: TypedDict

Incremental server update generated by the model in response to client messages.

Content is generated as quickly as possible, and not in real time. Clients may choose to buffer and play it out in real time.

generation_complete: Optional[bool]

If true, indicates that the model is done generating. When model is interrupted while generating there will be no generation_complete message in interrupted turn, it will go through interrupted > turn_complete. When model assumes realtime playback there will be delay between generation_complete and turn_complete that is caused by model waiting for playback to finish. If true, indicates that the model has finished generating all content. This is a signal to the client that it can stop sending messages.

grounding_metadata: Optional[GroundingMetadataDict]

Metadata returned to client when grounding is enabled.

input_transcription: Optional[TranscriptionDict]

Input transcription. The transcription is independent to the model turn which means it doesn’t imply any ordering between transcription and model turn.

interrupted: Optional[bool]

If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue.

model_turn: Optional[ContentDict]

The content that the model has generated as part of the current conversation with the user.

output_transcription: Optional[TranscriptionDict]

Output transcription. The transcription is independent to the model turn which means it doesn’t imply any ordering between transcription and model turn.

turn_complete: Optional[bool]

If true, indicates that the model is done generating. Generation will only start in response to additional client messages. Can be set alongside content, indicating that the content is the last in the turn.

url_context_metadata: Optional[UrlContextMetadataDict]

Metadata related to url context retrieval tool.

pydantic model genai.types.LiveServerGoAway

Bases: BaseModel

Server will not be able to service client soon.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveServerGoAway",
   "description": "Server will not be able to service client soon.",
   "type": "object",
   "properties": {
      "timeLeft": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The remaining time before the connection will be terminated as ABORTED. The minimal time returned here is specified differently together with the rate limits for a given model.",
         "title": "Timeleft"
      }
   },
   "additionalProperties": false
}

Fields:
field time_left: Optional[str] = None (alias 'timeLeft')

The remaining time before the connection will be terminated as ABORTED. The minimal time returned here is specified differently together with the rate limits for a given model.

class genai.types.LiveServerGoAwayDict

Bases: TypedDict

Server will not be able to service client soon.

time_left: Optional[str]

The remaining time before the connection will be terminated as ABORTED. The minimal time returned here is specified differently together with the rate limits for a given model.

pydantic model genai.types.LiveServerMessage

Bases: BaseModel

Response message for API call.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveServerMessage",
   "description": "Response message for API call.",
   "type": "object",
   "properties": {
      "setupComplete": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveServerSetupComplete"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Sent in response to a `LiveClientSetup` message from the client."
      },
      "serverContent": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveServerContent"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Content generated by the model in response to client messages."
      },
      "toolCall": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveServerToolCall"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Request for the client to execute the `function_calls` and return the responses with the matching `id`s."
      },
      "toolCallCancellation": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveServerToolCallCancellation"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Notification for the client that a previously issued `ToolCallMessage` with the specified `id`s should have been not executed and should be cancelled."
      },
      "usageMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/UsageMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Usage metadata about model response(s)."
      },
      "goAway": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveServerGoAway"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Server will disconnect soon."
      },
      "sessionResumptionUpdate": {
         "anyOf": [
            {
               "$ref": "#/$defs/LiveServerSessionResumptionUpdate"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Update of the session resumption state."
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GroundingChunk": {
         "additionalProperties": false,
         "description": "Grounding chunk.",
         "properties": {
            "retrievedContext": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkRetrievedContext"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from context retrieved by the retrieval tools."
            },
            "web": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingChunkWeb"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Grounding chunk from the web."
            }
         },
         "title": "GroundingChunk",
         "type": "object"
      },
      "GroundingChunkRetrievedContext": {
         "additionalProperties": false,
         "description": "Chunk from context retrieved by the retrieval tools.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text of the attribution.",
               "title": "Text"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the attribution.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the attribution.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkRetrievedContext",
         "type": "object"
      },
      "GroundingChunkWeb": {
         "additionalProperties": false,
         "description": "Chunk from the web.",
         "properties": {
            "domain": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Domain of the (original) URI.",
               "title": "Domain"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Title of the chunk.",
               "title": "Title"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URI reference of the chunk.",
               "title": "Uri"
            }
         },
         "title": "GroundingChunkWeb",
         "type": "object"
      },
      "GroundingMetadata": {
         "additionalProperties": false,
         "description": "Metadata returned to client when grounding is enabled.",
         "properties": {
            "groundingChunks": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingChunk"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of supporting references retrieved from specified grounding source.",
               "title": "Groundingchunks"
            },
            "groundingSupports": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/GroundingSupport"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. List of grounding support.",
               "title": "Groundingsupports"
            },
            "retrievalMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetrievalMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Output only. Retrieval metadata."
            },
            "retrievalQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Queries executed by the retrieval tools.",
               "title": "Retrievalqueries"
            },
            "searchEntryPoint": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SearchEntryPoint"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Google search entry for the following-up web searches."
            },
            "webSearchQueries": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web search queries for the following-up web search.",
               "title": "Websearchqueries"
            }
         },
         "title": "GroundingMetadata",
         "type": "object"
      },
      "GroundingSupport": {
         "additionalProperties": false,
         "description": "Grounding support.",
         "properties": {
            "confidenceScores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.",
               "title": "Confidencescores"
            },
            "groundingChunkIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.",
               "title": "Groundingchunkindices"
            },
            "segment": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Segment"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Segment of the content this support belongs to."
            }
         },
         "title": "GroundingSupport",
         "type": "object"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "LiveServerContent": {
         "additionalProperties": false,
         "description": "Incremental server update generated by the model in response to client messages.\n\nContent is generated as quickly as possible, and not in real time. Clients\nmay choose to buffer and play it out in real time.",
         "properties": {
            "modelTurn": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The content that the model has generated as part of the current conversation with the user."
            },
            "turnComplete": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If true, indicates that the model is done generating. Generation will only start in response to additional client messages. Can be set alongside `content`, indicating that the `content` is the last in the turn.",
               "title": "Turncomplete"
            },
            "interrupted": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue.",
               "title": "Interrupted"
            },
            "groundingMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata returned to client when grounding is enabled."
            },
            "generationComplete": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If true, indicates that the model is done generating. When model is\n      interrupted while generating there will be no generation_complete message\n      in interrupted turn, it will go through interrupted > turn_complete.\n      When model assumes realtime playback there will be delay between\n      generation_complete and turn_complete that is caused by model\n      waiting for playback to finish. If true, indicates that the model\n      has finished generating all content. This is a signal to the client\n      that it can stop sending messages.",
               "title": "Generationcomplete"
            },
            "inputTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Transcription"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Input transcription. The transcription is independent to the model\n      turn which means it doesn\u2019t imply any ordering between transcription and\n      model turn."
            },
            "outputTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Transcription"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output transcription. The transcription is independent to the model\n      turn which means it doesn\u2019t imply any ordering between transcription and\n      model turn.\n      "
            },
            "urlContextMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlContextMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata related to url context retrieval tool."
            }
         },
         "title": "LiveServerContent",
         "type": "object"
      },
      "LiveServerGoAway": {
         "additionalProperties": false,
         "description": "Server will not be able to service client soon.",
         "properties": {
            "timeLeft": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The remaining time before the connection will be terminated as ABORTED. The minimal time returned here is specified differently together with the rate limits for a given model.",
               "title": "Timeleft"
            }
         },
         "title": "LiveServerGoAway",
         "type": "object"
      },
      "LiveServerSessionResumptionUpdate": {
         "additionalProperties": false,
         "description": "Update of the session resumption state.\n\nOnly sent if `session_resumption` was set in the connection config.",
         "properties": {
            "newHandle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "New handle that represents state that can be resumed. Empty if `resumable`=false.",
               "title": "Newhandle"
            },
            "resumable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "True if session can be resumed at this point. It might be not possible to resume session at some points. In that case we send update empty new_handle and resumable=false. Example of such case could be model executing function calls or just generating. Resuming session (using previous session token) in such state will result in some data loss.",
               "title": "Resumable"
            },
            "lastConsumedClientMessageIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when `SessionResumptionConfig.transparent` is set.\n\nPresence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResmumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).\n\nNote: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames arelikely not needed.",
               "title": "Lastconsumedclientmessageindex"
            }
         },
         "title": "LiveServerSessionResumptionUpdate",
         "type": "object"
      },
      "LiveServerSetupComplete": {
         "additionalProperties": false,
         "description": "Sent in response to a `LiveGenerateContentSetup` message from the client.",
         "properties": {},
         "title": "LiveServerSetupComplete",
         "type": "object"
      },
      "LiveServerToolCall": {
         "additionalProperties": false,
         "description": "Request for the client to execute the `function_calls` and return the responses with the matching `id`s.",
         "properties": {
            "functionCalls": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/FunctionCall"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The function call to be executed.",
               "title": "Functioncalls"
            }
         },
         "title": "LiveServerToolCall",
         "type": "object"
      },
      "LiveServerToolCallCancellation": {
         "additionalProperties": false,
         "description": "Notification for the client that a previously issued `ToolCallMessage` with the specified `id`s should have been not executed and should be cancelled.\n\nIf there were side-effects to those tool calls, clients may attempt to undo\nthe tool calls. This message occurs only in cases where the clients interrupt\nserver turns.",
         "properties": {
            "ids": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ids of the tool calls to be cancelled.",
               "title": "Ids"
            }
         },
         "title": "LiveServerToolCallCancellation",
         "type": "object"
      },
      "MediaModality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "VIDEO",
            "AUDIO",
            "DOCUMENT"
         ],
         "title": "MediaModality",
         "type": "string"
      },
      "ModalityTokenCount": {
         "additionalProperties": false,
         "description": "Represents token counting info for a single modality.",
         "properties": {
            "modality": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaModality"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The modality associated with this token count."
            },
            "tokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens.",
               "title": "Tokencount"
            }
         },
         "title": "ModalityTokenCount",
         "type": "object"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "RetrievalMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to retrieval in the grounding flow.",
         "properties": {
            "googleSearchDynamicRetrievalScore": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.",
               "title": "Googlesearchdynamicretrievalscore"
            }
         },
         "title": "RetrievalMetadata",
         "type": "object"
      },
      "SearchEntryPoint": {
         "additionalProperties": false,
         "description": "Google search entry point.",
         "properties": {
            "renderedContent": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
               "title": "Renderedcontent"
            },
            "sdkBlob": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Base64 encoded JSON representing array of tuple.",
               "title": "Sdkblob"
            }
         },
         "title": "SearchEntryPoint",
         "type": "object"
      },
      "Segment": {
         "additionalProperties": false,
         "description": "Segment of the content.",
         "properties": {
            "endIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
               "title": "Endindex"
            },
            "partIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The index of a Part object within its parent Content object.",
               "title": "Partindex"
            },
            "startIndex": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.",
               "title": "Startindex"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The text corresponding to the segment from the response.",
               "title": "Text"
            }
         },
         "title": "Segment",
         "type": "object"
      },
      "TrafficType": {
         "description": "Output only.\n\nTraffic type. This shows whether a request consumes Pay-As-You-Go or\nProvisioned Throughput quota.",
         "enum": [
            "TRAFFIC_TYPE_UNSPECIFIED",
            "ON_DEMAND",
            "PROVISIONED_THROUGHPUT"
         ],
         "title": "TrafficType",
         "type": "string"
      },
      "Transcription": {
         "additionalProperties": false,
         "description": "Audio transcription in Server Conent.",
         "properties": {
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Transcription text.\n      ",
               "title": "Text"
            },
            "finished": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The bool indicates the end of the transcription.\n      ",
               "title": "Finished"
            }
         },
         "title": "Transcription",
         "type": "object"
      },
      "UrlContextMetadata": {
         "additionalProperties": false,
         "description": "Metadata related to url context retrieval tool.",
         "properties": {
            "urlMetadata": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/UrlMetadata"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of url context.",
               "title": "Urlmetadata"
            }
         },
         "title": "UrlContextMetadata",
         "type": "object"
      },
      "UrlMetadata": {
         "additionalProperties": false,
         "description": "Context for a single url retrieval.",
         "properties": {
            "retrievedUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URL retrieved by the tool.",
               "title": "Retrievedurl"
            },
            "urlRetrievalStatus": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlRetrievalStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Status of the url retrieval."
            }
         },
         "title": "UrlMetadata",
         "type": "object"
      },
      "UrlRetrievalStatus": {
         "description": "Status of the url retrieval.",
         "enum": [
            "URL_RETRIEVAL_STATUS_UNSPECIFIED",
            "URL_RETRIEVAL_STATUS_SUCCESS",
            "URL_RETRIEVAL_STATUS_ERROR"
         ],
         "title": "UrlRetrievalStatus",
         "type": "string"
      },
      "UsageMetadata": {
         "additionalProperties": false,
         "description": "Usage metadata about response(s).",
         "properties": {
            "promptTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.",
               "title": "Prompttokencount"
            },
            "cachedContentTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens in the cached part of the prompt (the cached content).",
               "title": "Cachedcontenttokencount"
            },
            "responseTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total number of tokens across all the generated response candidates.",
               "title": "Responsetokencount"
            },
            "toolUsePromptTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens present in tool-use prompt(s).",
               "title": "Tooluseprompttokencount"
            },
            "thoughtsTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens of thoughts for thinking models.",
               "title": "Thoughtstokencount"
            },
            "totalTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total token count for prompt, response candidates, and tool-use prompts(if present).",
               "title": "Totaltokencount"
            },
            "promptTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of modalities that were processed in the request input.",
               "title": "Prompttokensdetails"
            },
            "cacheTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of modalities that were processed in the cache input.",
               "title": "Cachetokensdetails"
            },
            "responseTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of modalities that were returned in the response.",
               "title": "Responsetokensdetails"
            },
            "toolUsePromptTokensDetails": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/ModalityTokenCount"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of modalities that were processed in the tool-use prompt.",
               "title": "Tooluseprompttokensdetails"
            },
            "trafficType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TrafficType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Traffic type. This shows whether a request consumes Pay-As-You-Go\n or Provisioned Throughput quota."
            }
         },
         "title": "UsageMetadata",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field go_away: Optional[LiveServerGoAway] = None (alias 'goAway')

Server will disconnect soon.

field server_content: Optional[LiveServerContent] = None (alias 'serverContent')

Content generated by the model in response to client messages.

field session_resumption_update: Optional[LiveServerSessionResumptionUpdate] = None (alias 'sessionResumptionUpdate')

Update of the session resumption state.

field setup_complete: Optional[LiveServerSetupComplete] = None (alias 'setupComplete')

Sent in response to a LiveClientSetup message from the client.

field tool_call: Optional[LiveServerToolCall] = None (alias 'toolCall')

Request for the client to execute the function_calls and return the responses with the matching `id`s.

field tool_call_cancellation: Optional[LiveServerToolCallCancellation] = None (alias 'toolCallCancellation')

Notification for the client that a previously issued ToolCallMessage with the specified `id`s should have been not executed and should be cancelled.

field usage_metadata: Optional[UsageMetadata] = None (alias 'usageMetadata')

Usage metadata about model response(s).

property data: bytes | None

Returns the concatenation of all inline data parts in the response.

property text: str | None

Returns the concatenation of all text parts in the response.

class genai.types.LiveServerMessageDict

Bases: TypedDict

Response message for API call.

go_away: Optional[LiveServerGoAwayDict]

Server will disconnect soon.

server_content: Optional[LiveServerContentDict]

Content generated by the model in response to client messages.

session_resumption_update: Optional[LiveServerSessionResumptionUpdateDict]

Update of the session resumption state.

setup_complete: Optional[LiveServerSetupCompleteDict]

Sent in response to a LiveClientSetup message from the client.

tool_call: Optional[LiveServerToolCallDict]

Request for the client to execute the function_calls and return the responses with the matching `id`s.

tool_call_cancellation: Optional[LiveServerToolCallCancellationDict]

Notification for the client that a previously issued ToolCallMessage with the specified `id`s should have been not executed and should be cancelled.

usage_metadata: Optional[UsageMetadataDict]

Usage metadata about model response(s).

pydantic model genai.types.LiveServerSessionResumptionUpdate

Bases: BaseModel

Update of the session resumption state.

Only sent if session_resumption was set in the connection config.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveServerSessionResumptionUpdate",
   "description": "Update of the session resumption state.\n\nOnly sent if `session_resumption` was set in the connection config.",
   "type": "object",
   "properties": {
      "newHandle": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "New handle that represents state that can be resumed. Empty if `resumable`=false.",
         "title": "Newhandle"
      },
      "resumable": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "True if session can be resumed at this point. It might be not possible to resume session at some points. In that case we send update empty new_handle and resumable=false. Example of such case could be model executing function calls or just generating. Resuming session (using previous session token) in such state will result in some data loss.",
         "title": "Resumable"
      },
      "lastConsumedClientMessageIndex": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when `SessionResumptionConfig.transparent` is set.\n\nPresence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResmumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).\n\nNote: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames arelikely not needed.",
         "title": "Lastconsumedclientmessageindex"
      }
   },
   "additionalProperties": false
}

Fields:
field last_consumed_client_message_index: Optional[int] = None (alias 'lastConsumedClientMessageIndex')

Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when SessionResumptionConfig.transparent is set.

Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last SessionResmumptionTokenUpdate. This field will enable them to limit buffering (avoid keeping all requests in RAM).

Note: This should not be used for when resuming a session at some time later – in those cases partial audio and video frames arelikely not needed.

field new_handle: Optional[str] = None (alias 'newHandle')

New handle that represents state that can be resumed. Empty if `resumable`=false.

field resumable: Optional[bool] = None

True if session can be resumed at this point. It might be not possible to resume session at some points. In that case we send update empty new_handle and resumable=false. Example of such case could be model executing function calls or just generating. Resuming session (using previous session token) in such state will result in some data loss.

class genai.types.LiveServerSessionResumptionUpdateDict

Bases: TypedDict

Update of the session resumption state.

Only sent if session_resumption was set in the connection config.

last_consumed_client_message_index: Optional[int]

Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when SessionResumptionConfig.transparent is set.

Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last SessionResmumptionTokenUpdate. This field will enable them to limit buffering (avoid keeping all requests in RAM).

Note: This should not be used for when resuming a session at some time later – in those cases partial audio and video frames arelikely not needed.

new_handle: Optional[str]

New handle that represents state that can be resumed. Empty if `resumable`=false.

resumable: Optional[bool]

True if session can be resumed at this point. It might be not possible to resume session at some points. In that case we send update empty new_handle and resumable=false. Example of such case could be model executing function calls or just generating. Resuming session (using previous session token) in such state will result in some data loss.

pydantic model genai.types.LiveServerSetupComplete

Bases: BaseModel

Sent in response to a LiveGenerateContentSetup message from the client.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveServerSetupComplete",
   "description": "Sent in response to a `LiveGenerateContentSetup` message from the client.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.LiveServerSetupCompleteDict

Bases: TypedDict

Sent in response to a LiveGenerateContentSetup message from the client.

pydantic model genai.types.LiveServerToolCall

Bases: BaseModel

Request for the client to execute the function_calls and return the responses with the matching `id`s.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveServerToolCall",
   "description": "Request for the client to execute the `function_calls` and return the responses with the matching `id`s.",
   "type": "object",
   "properties": {
      "functionCalls": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/FunctionCall"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The function call to be executed.",
         "title": "Functioncalls"
      }
   },
   "$defs": {
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field function_calls: Optional[list[FunctionCall]] = None (alias 'functionCalls')

The function call to be executed.

pydantic model genai.types.LiveServerToolCallCancellation

Bases: BaseModel

Notification for the client that a previously issued ToolCallMessage with the specified `id`s should have been not executed and should be cancelled.

If there were side-effects to those tool calls, clients may attempt to undo the tool calls. This message occurs only in cases where the clients interrupt server turns.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LiveServerToolCallCancellation",
   "description": "Notification for the client that a previously issued `ToolCallMessage` with the specified `id`s should have been not executed and should be cancelled.\n\nIf there were side-effects to those tool calls, clients may attempt to undo\nthe tool calls. This message occurs only in cases where the clients interrupt\nserver turns.",
   "type": "object",
   "properties": {
      "ids": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The ids of the tool calls to be cancelled.",
         "title": "Ids"
      }
   },
   "additionalProperties": false
}

Fields:
field ids: Optional[list[str]] = None

The ids of the tool calls to be cancelled.

class genai.types.LiveServerToolCallCancellationDict

Bases: TypedDict

Notification for the client that a previously issued ToolCallMessage with the specified `id`s should have been not executed and should be cancelled.

If there were side-effects to those tool calls, clients may attempt to undo the tool calls. This message occurs only in cases where the clients interrupt server turns.

ids: Optional[list[str]]

The ids of the tool calls to be cancelled.

class genai.types.LiveServerToolCallDict

Bases: TypedDict

Request for the client to execute the function_calls and return the responses with the matching `id`s.

function_calls: Optional[list[FunctionCallDict]]

The function call to be executed.

pydantic model genai.types.LogprobsResult

Bases: BaseModel

Logprobs Result

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LogprobsResult",
   "description": "Logprobs Result",
   "type": "object",
   "properties": {
      "chosenCandidates": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/LogprobsResultCandidate"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.",
         "title": "Chosencandidates"
      },
      "topCandidates": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/LogprobsResultTopCandidates"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Length = total number of decoding steps.",
         "title": "Topcandidates"
      }
   },
   "$defs": {
      "LogprobsResultCandidate": {
         "additionalProperties": false,
         "description": "Candidate for the logprobs token and score.",
         "properties": {
            "logProbability": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's log probability.",
               "title": "Logprobability"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token string value.",
               "title": "Token"
            },
            "tokenId": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token id value.",
               "title": "Tokenid"
            }
         },
         "title": "LogprobsResultCandidate",
         "type": "object"
      },
      "LogprobsResultTopCandidates": {
         "additionalProperties": false,
         "description": "Candidates with top log probabilities at each decoding step.",
         "properties": {
            "candidates": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/LogprobsResultCandidate"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Sorted by log probability in descending order.",
               "title": "Candidates"
            }
         },
         "title": "LogprobsResultTopCandidates",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field chosen_candidates: Optional[list[LogprobsResultCandidate]] = None (alias 'chosenCandidates')

Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.

field top_candidates: Optional[list[LogprobsResultTopCandidates]] = None (alias 'topCandidates')

Length = total number of decoding steps.

pydantic model genai.types.LogprobsResultCandidate

Bases: BaseModel

Candidate for the logprobs token and score.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LogprobsResultCandidate",
   "description": "Candidate for the logprobs token and score.",
   "type": "object",
   "properties": {
      "logProbability": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The candidate's log probability.",
         "title": "Logprobability"
      },
      "token": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The candidate's token string value.",
         "title": "Token"
      },
      "tokenId": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The candidate's token id value.",
         "title": "Tokenid"
      }
   },
   "additionalProperties": false
}

Fields:
field log_probability: Optional[float] = None (alias 'logProbability')

The candidate’s log probability.

field token: Optional[str] = None

The candidate’s token string value.

field token_id: Optional[int] = None (alias 'tokenId')

The candidate’s token id value.

class genai.types.LogprobsResultCandidateDict

Bases: TypedDict

Candidate for the logprobs token and score.

log_probability: Optional[float]

The candidate’s log probability.

token: Optional[str]

The candidate’s token string value.

token_id: Optional[int]

The candidate’s token id value.

class genai.types.LogprobsResultDict

Bases: TypedDict

Logprobs Result

chosen_candidates: Optional[list[LogprobsResultCandidateDict]]

Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates.

top_candidates: Optional[list[LogprobsResultTopCandidatesDict]]

Length = total number of decoding steps.

pydantic model genai.types.LogprobsResultTopCandidates

Bases: BaseModel

Candidates with top log probabilities at each decoding step.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "LogprobsResultTopCandidates",
   "description": "Candidates with top log probabilities at each decoding step.",
   "type": "object",
   "properties": {
      "candidates": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/LogprobsResultCandidate"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Sorted by log probability in descending order.",
         "title": "Candidates"
      }
   },
   "$defs": {
      "LogprobsResultCandidate": {
         "additionalProperties": false,
         "description": "Candidate for the logprobs token and score.",
         "properties": {
            "logProbability": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's log probability.",
               "title": "Logprobability"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token string value.",
               "title": "Token"
            },
            "tokenId": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The candidate's token id value.",
               "title": "Tokenid"
            }
         },
         "title": "LogprobsResultCandidate",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field candidates: Optional[list[LogprobsResultCandidate]] = None

Sorted by log probability in descending order.

class genai.types.LogprobsResultTopCandidatesDict

Bases: TypedDict

Candidates with top log probabilities at each decoding step.

candidates: Optional[list[LogprobsResultCandidateDict]]

Sorted by log probability in descending order.

pydantic model genai.types.MaskReferenceConfig

Bases: BaseModel

Configuration for a Mask reference image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "MaskReferenceConfig",
   "description": "Configuration for a Mask reference image.",
   "type": "object",
   "properties": {
      "maskMode": {
         "anyOf": [
            {
               "$ref": "#/$defs/MaskReferenceMode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Prompts the model to generate a mask instead of you needing to\n      provide one (unless MASK_MODE_USER_PROVIDED is used)."
      },
      "segmentationClasses": {
         "anyOf": [
            {
               "items": {
                  "type": "integer"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of up to 5 class ids to use for semantic segmentation.\n      Automatically creates an image mask based on specific objects.",
         "title": "Segmentationclasses"
      },
      "maskDilation": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Dilation percentage of the mask provided.\n      Float between 0 and 1.",
         "title": "Maskdilation"
      }
   },
   "$defs": {
      "MaskReferenceMode": {
         "description": "Enum representing the mask mode of a mask reference image.",
         "enum": [
            "MASK_MODE_DEFAULT",
            "MASK_MODE_USER_PROVIDED",
            "MASK_MODE_BACKGROUND",
            "MASK_MODE_FOREGROUND",
            "MASK_MODE_SEMANTIC"
         ],
         "title": "MaskReferenceMode",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field mask_dilation: Optional[float] = None (alias 'maskDilation')

Dilation percentage of the mask provided. Float between 0 and 1.

field mask_mode: Optional[MaskReferenceMode] = None (alias 'maskMode')

Prompts the model to generate a mask instead of you needing to provide one (unless MASK_MODE_USER_PROVIDED is used).

field segmentation_classes: Optional[list[int]] = None (alias 'segmentationClasses')

A list of up to 5 class ids to use for semantic segmentation. Automatically creates an image mask based on specific objects.

class genai.types.MaskReferenceConfigDict

Bases: TypedDict

Configuration for a Mask reference image.

mask_dilation: Optional[float]

Dilation percentage of the mask provided. Float between 0 and 1.

mask_mode: Optional[MaskReferenceMode]

Prompts the model to generate a mask instead of you needing to provide one (unless MASK_MODE_USER_PROVIDED is used).

segmentation_classes: Optional[list[int]]

A list of up to 5 class ids to use for semantic segmentation. Automatically creates an image mask based on specific objects.

pydantic model genai.types.MaskReferenceImage

Bases: BaseModel

A mask reference image.

This encapsulates either a mask image provided by the user and configs for the user provided mask, or only config parameters for the model to generate a mask.

A mask image is an image whose non-zero values indicate where to edit the base image. If the user provides a mask image, the mask must be in the same dimensions as the raw image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "MaskReferenceImage",
   "description": "A mask reference image.\n\nThis encapsulates either a mask image provided by the user and configs for\nthe user provided mask, or only config parameters for the model to generate\na mask.\n\nA mask image is an image whose non-zero values indicate where to edit the base\nimage. If the user provides a mask image, the mask must be in the same\ndimensions as the raw image.",
   "type": "object",
   "properties": {
      "referenceImage": {
         "anyOf": [
            {
               "$ref": "#/$defs/Image"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reference image for the editing operation."
      },
      "referenceId": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The id of the reference image.",
         "title": "Referenceid"
      },
      "referenceType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of the reference image. Only set by the SDK.",
         "title": "Referencetype"
      },
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/MaskReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for the mask reference image."
      },
      "maskImageConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/MaskReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": ""
      }
   },
   "$defs": {
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "MaskReferenceConfig": {
         "additionalProperties": false,
         "description": "Configuration for a Mask reference image.",
         "properties": {
            "maskMode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MaskReferenceMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Prompts the model to generate a mask instead of you needing to\n      provide one (unless MASK_MODE_USER_PROVIDED is used)."
            },
            "segmentationClasses": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of up to 5 class ids to use for semantic segmentation.\n      Automatically creates an image mask based on specific objects.",
               "title": "Segmentationclasses"
            },
            "maskDilation": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Dilation percentage of the mask provided.\n      Float between 0 and 1.",
               "title": "Maskdilation"
            }
         },
         "title": "MaskReferenceConfig",
         "type": "object"
      },
      "MaskReferenceMode": {
         "description": "Enum representing the mask mode of a mask reference image.",
         "enum": [
            "MASK_MODE_DEFAULT",
            "MASK_MODE_USER_PROVIDED",
            "MASK_MODE_BACKGROUND",
            "MASK_MODE_FOREGROUND",
            "MASK_MODE_SEMANTIC"
         ],
         "title": "MaskReferenceMode",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • _validate_mask_image_config » all fields

field config: Optional[MaskReferenceConfig] = None

Re-map config to mask_reference_config to send to API.

Configuration for the mask reference image.

Validated by:
  • _validate_mask_image_config

field mask_image_config: Optional[MaskReferenceConfig] = None (alias 'maskImageConfig')
Validated by:
  • _validate_mask_image_config

field reference_id: Optional[int] = None (alias 'referenceId')

The id of the reference image.

Validated by:
  • _validate_mask_image_config

field reference_image: Optional[Image] = None (alias 'referenceImage')

The reference image for the editing operation.

Validated by:
  • _validate_mask_image_config

field reference_type: Optional[str] = None (alias 'referenceType')

The type of the reference image. Only set by the SDK.

Validated by:
  • _validate_mask_image_config

class genai.types.MaskReferenceImageDict

Bases: TypedDict

A mask reference image.

This encapsulates either a mask image provided by the user and configs for the user provided mask, or only config parameters for the model to generate a mask.

A mask image is an image whose non-zero values indicate where to edit the base image. If the user provides a mask image, the mask must be in the same dimensions as the raw image.

config: Optional[MaskReferenceConfigDict]

Configuration for the mask reference image.

reference_id: Optional[int]

The id of the reference image.

reference_image: Optional[ImageDict]

The reference image for the editing operation.

reference_type: Optional[str]

The type of the reference image. Only set by the SDK.

class genai.types.MaskReferenceMode(*values)

Bases: CaseInSensitiveEnum

Enum representing the mask mode of a mask reference image.

MASK_MODE_BACKGROUND = 'MASK_MODE_BACKGROUND'
MASK_MODE_DEFAULT = 'MASK_MODE_DEFAULT'
MASK_MODE_FOREGROUND = 'MASK_MODE_FOREGROUND'
MASK_MODE_SEMANTIC = 'MASK_MODE_SEMANTIC'
MASK_MODE_USER_PROVIDED = 'MASK_MODE_USER_PROVIDED'
class genai.types.MediaModality(*values)

Bases: CaseInSensitiveEnum

Server content modalities.

AUDIO = 'AUDIO'

Audio.

DOCUMENT = 'DOCUMENT'

Document, e.g. PDF.

IMAGE = 'IMAGE'

Images.

MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED'

The modality is unspecified.

TEXT = 'TEXT'

Plain text.

VIDEO = 'VIDEO'

Video.

class genai.types.MediaResolution(*values)

Bases: CaseInSensitiveEnum

The media resolution to use.

MEDIA_RESOLUTION_HIGH = 'MEDIA_RESOLUTION_HIGH'

Media resolution set to high (zoomed reframing with 256 tokens).

MEDIA_RESOLUTION_LOW = 'MEDIA_RESOLUTION_LOW'

Media resolution set to low (64 tokens).

MEDIA_RESOLUTION_MEDIUM = 'MEDIA_RESOLUTION_MEDIUM'

Media resolution set to medium (256 tokens).

MEDIA_RESOLUTION_UNSPECIFIED = 'MEDIA_RESOLUTION_UNSPECIFIED'

Media resolution has not been set

class genai.types.Modality(*values)

Bases: CaseInSensitiveEnum

Server content modalities.

AUDIO = 'AUDIO'

Indicates the model should return images.

IMAGE = 'IMAGE'

Indicates the model should return images.

MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED'

The modality is unspecified.

TEXT = 'TEXT'

Indicates the model should return text

pydantic model genai.types.ModalityTokenCount

Bases: BaseModel

Represents token counting info for a single modality.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ModalityTokenCount",
   "description": "Represents token counting info for a single modality.",
   "type": "object",
   "properties": {
      "modality": {
         "anyOf": [
            {
               "$ref": "#/$defs/MediaModality"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The modality associated with this token count."
      },
      "tokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens.",
         "title": "Tokencount"
      }
   },
   "$defs": {
      "MediaModality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "VIDEO",
            "AUDIO",
            "DOCUMENT"
         ],
         "title": "MediaModality",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field modality: Optional[MediaModality] = None

The modality associated with this token count.

field token_count: Optional[int] = None (alias 'tokenCount')

Number of tokens.

class genai.types.ModalityTokenCountDict

Bases: TypedDict

Represents token counting info for a single modality.

modality: Optional[MediaModality]

The modality associated with this token count.

token_count: Optional[int]

Number of tokens.

class genai.types.Mode(*values)

Bases: CaseInSensitiveEnum

The mode of the predictor to be used in dynamic retrieval.

MODE_DYNAMIC = 'MODE_DYNAMIC'

Run retrieval only when system decides it is necessary.

MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'

Always trigger retrieval.

pydantic model genai.types.Model

Bases: BaseModel

A trained machine learning model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Model",
   "description": "A trained machine learning model.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Resource name of the model.",
         "title": "Name"
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Display name of the model.",
         "title": "Displayname"
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the model.",
         "title": "Description"
      },
      "version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Version ID of the model. A new version is committed when a new\n      model version is uploaded or trained under an existing model ID. The\n      version ID is an auto-incrementing decimal number in string\n      representation.",
         "title": "Version"
      },
      "endpoints": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Endpoint"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of deployed models created from this base model. Note that a\n      model could have been deployed to endpoints in different locations.",
         "title": "Endpoints"
      },
      "labels": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Labels with user-defined metadata to organize your models.",
         "title": "Labels"
      },
      "tunedModelInfo": {
         "anyOf": [
            {
               "$ref": "#/$defs/TunedModelInfo"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Information about the tuned model from the base model."
      },
      "inputTokenLimit": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The maximum number of input tokens that the model can handle.",
         "title": "Inputtokenlimit"
      },
      "outputTokenLimit": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The maximum number of output tokens that the model can generate.",
         "title": "Outputtokenlimit"
      },
      "supportedActions": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of actions that are supported by the model.",
         "title": "Supportedactions"
      },
      "defaultCheckpointId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The default checkpoint id of a model version.\n      ",
         "title": "Defaultcheckpointid"
      },
      "checkpoints": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Checkpoint"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The checkpoints of the model.",
         "title": "Checkpoints"
      }
   },
   "$defs": {
      "Checkpoint": {
         "additionalProperties": false,
         "description": "Describes the machine learning model version checkpoint.",
         "properties": {
            "checkpointId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the checkpoint.\n      ",
               "title": "Checkpointid"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The epoch of the checkpoint.\n      ",
               "title": "Epoch"
            },
            "step": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The step of the checkpoint.\n      ",
               "title": "Step"
            }
         },
         "title": "Checkpoint",
         "type": "object"
      },
      "Endpoint": {
         "additionalProperties": false,
         "description": "An endpoint where you deploy models.",
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Resource name of the endpoint.",
               "title": "Name"
            },
            "deployedModelId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "ID of the model that's deployed to the endpoint.",
               "title": "Deployedmodelid"
            }
         },
         "title": "Endpoint",
         "type": "object"
      },
      "TunedModelInfo": {
         "additionalProperties": false,
         "description": "A tuned machine learning model.",
         "properties": {
            "baseModel": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "ID of the base model that you want to tune.",
               "title": "Basemodel"
            },
            "createTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Date and time when the base model was created.",
               "title": "Createtime"
            },
            "updateTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Date and time when the base model was last updated.",
               "title": "Updatetime"
            }
         },
         "title": "TunedModelInfo",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field checkpoints: Optional[list[Checkpoint]] = None

The checkpoints of the model.

field default_checkpoint_id: Optional[str] = None (alias 'defaultCheckpointId')

The default checkpoint id of a model version.

field description: Optional[str] = None

Description of the model.

field display_name: Optional[str] = None (alias 'displayName')

Display name of the model.

field endpoints: Optional[list[Endpoint]] = None

List of deployed models created from this base model. Note that a model could have been deployed to endpoints in different locations.

field input_token_limit: Optional[int] = None (alias 'inputTokenLimit')

The maximum number of input tokens that the model can handle.

field labels: Optional[dict[str, str]] = None

Labels with user-defined metadata to organize your models.

field name: Optional[str] = None

Resource name of the model.

field output_token_limit: Optional[int] = None (alias 'outputTokenLimit')

The maximum number of output tokens that the model can generate.

field supported_actions: Optional[list[str]] = None (alias 'supportedActions')

List of actions that are supported by the model.

field tuned_model_info: Optional[TunedModelInfo] = None (alias 'tunedModelInfo')

Information about the tuned model from the base model.

field version: Optional[str] = None

Version ID of the model. A new version is committed when a new model version is uploaded or trained under an existing model ID. The version ID is an auto-incrementing decimal number in string representation.

pydantic model genai.types.ModelContent

Bases: Content

ModelContent facilitates the creation of a Content object with a model role.

Example usages:

  • Create a model Content object with a string: model_content = ModelContent(“Why is the sky blue?”)

  • Create a model Content object with a file data Part object: model_content = ModelContent(Part.from_uri(file_uril=”gs://bucket/file.txt”, mime_type=”text/plain”))

  • Create a model Content object with byte data Part object: model_content = ModelContent(Part.from_bytes(data=b”Hello, World!”, mime_type=”text/plain”))

    You can create a model Content object using other classmethods in the Part class as well. You can also create a model Content using a list of Part objects or strings.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ModelContent",
   "description": "ModelContent facilitates the creation of a Content object with a model role.\n\nExample usages:\n\n- Create a model Content object with a string:\n  model_content = ModelContent(\"Why is the sky blue?\")\n- Create a model Content object with a file data Part object:\n  model_content = ModelContent(Part.from_uri(file_uril=\"gs://bucket/file.txt\",\n  mime_type=\"text/plain\"))\n- Create a model Content object with byte data Part object:\n  model_content = ModelContent(Part.from_bytes(data=b\"Hello, World!\",\n  mime_type=\"text/plain\"))\n\n  You can create a model Content object using other classmethods in the Part\n  class as well.\n  You can also create a model Content using a list of Part objects or strings.",
   "type": "object",
   "properties": {
      "parts": {
         "items": {
            "$ref": "#/$defs/Part"
         },
         "title": "Parts",
         "type": "array"
      },
      "role": {
         "const": "model",
         "default": "model",
         "enum": [
            "model"
         ],
         "title": "Role",
         "type": "string"
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "parts"
   ]
}

Fields:
field parts: list[Part] [Required]
field role: Literal['model'] = 'model'
class genai.types.ModelDict

Bases: TypedDict

A trained machine learning model.

checkpoints: Optional[list[CheckpointDict]]

The checkpoints of the model.

default_checkpoint_id: Optional[str]

The default checkpoint id of a model version.

description: Optional[str]

Description of the model.

display_name: Optional[str]

Display name of the model.

endpoints: Optional[list[EndpointDict]]

List of deployed models created from this base model. Note that a model could have been deployed to endpoints in different locations.

input_token_limit: Optional[int]

The maximum number of input tokens that the model can handle.

labels: Optional[dict[str, str]]

Labels with user-defined metadata to organize your models.

name: Optional[str]

Resource name of the model.

output_token_limit: Optional[int]

The maximum number of output tokens that the model can generate.

supported_actions: Optional[list[str]]

List of actions that are supported by the model.

tuned_model_info: Optional[TunedModelInfoDict]

Information about the tuned model from the base model.

version: Optional[str]

Version ID of the model. A new version is committed when a new model version is uploaded or trained under an existing model ID. The version ID is an auto-incrementing decimal number in string representation.

pydantic model genai.types.ModelSelectionConfig

Bases: BaseModel

Config for model selection.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ModelSelectionConfig",
   "description": "Config for model selection.",
   "type": "object",
   "properties": {
      "featureSelectionPreference": {
         "anyOf": [
            {
               "$ref": "#/$defs/FeatureSelectionPreference"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Options for feature selection preference."
      }
   },
   "$defs": {
      "FeatureSelectionPreference": {
         "description": "Options for feature selection preference.",
         "enum": [
            "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",
            "PRIORITIZE_QUALITY",
            "BALANCED",
            "PRIORITIZE_COST"
         ],
         "title": "FeatureSelectionPreference",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field feature_selection_preference: Optional[FeatureSelectionPreference] = None (alias 'featureSelectionPreference')

Options for feature selection preference.

class genai.types.ModelSelectionConfigDict

Bases: TypedDict

Config for model selection.

feature_selection_preference: Optional[FeatureSelectionPreference]

Options for feature selection preference.

pydantic model genai.types.MultiSpeakerVoiceConfig

Bases: BaseModel

The configuration for the multi-speaker setup.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "MultiSpeakerVoiceConfig",
   "description": "The configuration for the multi-speaker setup.",
   "type": "object",
   "properties": {
      "speakerVoiceConfigs": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/SpeakerVoiceConfig"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The configuration for the speaker to use.",
         "title": "Speakervoiceconfigs"
      }
   },
   "$defs": {
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field speaker_voice_configs: Optional[list[SpeakerVoiceConfig]] = None (alias 'speakerVoiceConfigs')

The configuration for the speaker to use.

class genai.types.MultiSpeakerVoiceConfigDict

Bases: TypedDict

The configuration for the multi-speaker setup.

speaker_voice_configs: Optional[list[SpeakerVoiceConfigDict]]

The configuration for the speaker to use.

class genai.types.MusicGenerationMode(*values)

Bases: CaseInSensitiveEnum

The mode of music generation.

DIVERSITY = 'DIVERSITY'

Steer text prompts to regions of latent space with a larger diversity of music.

MUSIC_GENERATION_MODE_UNSPECIFIED = 'MUSIC_GENERATION_MODE_UNSPECIFIED'

This value is unused.

QUALITY = 'QUALITY'

Steer text prompts to regions of latent space with higher quality music.

pydantic model genai.types.Operation

Bases: BaseModel

A long-running operation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Operation",
   "description": "A long-running operation.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
         "title": "Name"
      },
      "metadata": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata.  Any method that returns a long-running operation should document the metadata type, if any.",
         "title": "Metadata"
      },
      "done": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.",
         "title": "Done"
      },
      "error": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The error result of the operation in case of failure or cancellation.",
         "title": "Error"
      }
   },
   "additionalProperties": false
}

Fields:
field done: Optional[bool] = None

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

field error: Optional[dict[str, Any]] = None

The error result of the operation in case of failure or cancellation.

field metadata: Optional[dict[str, Any]] = None

Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.

field name: Optional[str] = None

The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.

class genai.types.OperationDict

Bases: TypedDict

A long-running operation.

done: Optional[bool]

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

error: Optional[dict[str, Any]]

The error result of the operation in case of failure or cancellation.

metadata: Optional[dict[str, Any]]

Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.

name: Optional[str]

The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.

class genai.types.Outcome(*values)

Bases: CaseInSensitiveEnum

Required. Outcome of the code execution.

OUTCOME_DEADLINE_EXCEEDED = 'OUTCOME_DEADLINE_EXCEEDED'

Code execution ran for too long, and was cancelled. There may or may not be a partial output present.

OUTCOME_FAILED = 'OUTCOME_FAILED'

Code execution finished but with a failure. stderr should contain the reason.

OUTCOME_OK = 'OUTCOME_OK'

Code execution completed successfully.

OUTCOME_UNSPECIFIED = 'OUTCOME_UNSPECIFIED'

Unspecified status. This value should not be used.

pydantic model genai.types.Part

Bases: BaseModel

A datatype containing media content.

Exactly one field within a Part should be set, representing the specific type of content being conveyed. Using multiple fields within the same Part instance is considered invalid.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Part",
   "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
   "type": "object",
   "properties": {
      "videoMetadata": {
         "anyOf": [
            {
               "$ref": "#/$defs/VideoMetadata"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Metadata for a given video."
      },
      "thought": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates if the part is thought from the model.",
         "title": "Thought"
      },
      "inlineData": {
         "anyOf": [
            {
               "$ref": "#/$defs/Blob"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Inlined bytes data."
      },
      "codeExecutionResult": {
         "anyOf": [
            {
               "$ref": "#/$defs/CodeExecutionResult"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Result of executing the [ExecutableCode]."
      },
      "executableCode": {
         "anyOf": [
            {
               "$ref": "#/$defs/ExecutableCode"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Code generated by the model that is meant to be executed."
      },
      "fileData": {
         "anyOf": [
            {
               "$ref": "#/$defs/FileData"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. URI based data."
      },
      "functionCall": {
         "anyOf": [
            {
               "$ref": "#/$defs/FunctionCall"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
      },
      "functionResponse": {
         "anyOf": [
            {
               "$ref": "#/$defs/FunctionResponse"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
      },
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Text part (can be code).",
         "title": "Text"
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field code_execution_result: Optional[CodeExecutionResult] = None (alias 'codeExecutionResult')

Optional. Result of executing the [ExecutableCode].

field executable_code: Optional[ExecutableCode] = None (alias 'executableCode')

Optional. Code generated by the model that is meant to be executed.

field file_data: Optional[FileData] = None (alias 'fileData')

Optional. URI based data.

field function_call: Optional[FunctionCall] = None (alias 'functionCall')

Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.

field function_response: Optional[FunctionResponse] = None (alias 'functionResponse')

Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.

field inline_data: Optional[Blob] = None (alias 'inlineData')

Optional. Inlined bytes data.

field text: Optional[str] = None

Optional. Text part (can be code).

field thought: Optional[bool] = None

Indicates if the part is thought from the model.

field video_metadata: Optional[VideoMetadata] = None (alias 'videoMetadata')

Metadata for a given video.

classmethod from_bytes(*, data, mime_type)
Return type:

Part

classmethod from_code_execution_result(*, outcome, output)
Return type:

Part

classmethod from_executable_code(*, code, language)
Return type:

Part

classmethod from_function_call(*, name, args)
Return type:

Part

classmethod from_function_response(*, name, response)
Return type:

Part

classmethod from_text(*, text)
Return type:

Part

classmethod from_uri(*, file_uri, mime_type=None)

Creates a Part from a file uri.

Return type:

Part

Parameters:
  • file_uri (str) – The uri of the file

  • mime_type (str) – mime_type: The MIME type of the image. If not provided, the MIME type will be automatically determined.

class genai.types.PartDict

Bases: TypedDict

A datatype containing media content.

Exactly one field within a Part should be set, representing the specific type of content being conveyed. Using multiple fields within the same Part instance is considered invalid.

code_execution_result: Optional[CodeExecutionResultDict]

Optional. Result of executing the [ExecutableCode].

executable_code: Optional[ExecutableCodeDict]

Optional. Code generated by the model that is meant to be executed.

file_data: Optional[FileDataDict]

Optional. URI based data.

function_call: Optional[FunctionCallDict]

Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.

function_response: Optional[FunctionResponseDict]

Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.

inline_data: Optional[BlobDict]

Optional. Inlined bytes data.

text: Optional[str]

Optional. Text part (can be code).

thought: Optional[bool]

Indicates if the part is thought from the model.

video_metadata: Optional[VideoMetadataDict]

Metadata for a given video.

pydantic model genai.types.PartnerModelTuningSpec

Bases: BaseModel

Tuning spec for Partner models.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "PartnerModelTuningSpec",
   "description": "Tuning spec for Partner models.",
   "type": "object",
   "properties": {
      "hyperParameters": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model.",
         "title": "Hyperparameters"
      },
      "trainingDatasetUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
         "title": "Trainingdataseturi"
      },
      "validationDatasetUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
         "title": "Validationdataseturi"
      }
   },
   "additionalProperties": false
}

Fields:
field hyper_parameters: Optional[dict[str, Any]] = None (alias 'hyperParameters')

Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model.

field training_dataset_uri: Optional[str] = None (alias 'trainingDatasetUri')

Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

field validation_dataset_uri: Optional[str] = None (alias 'validationDatasetUri')

Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.

class genai.types.PartnerModelTuningSpecDict

Bases: TypedDict

Tuning spec for Partner models.

hyper_parameters: Optional[dict[str, Any]]

Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model.

training_dataset_uri: Optional[str]

Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

validation_dataset_uri: Optional[str]

Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.

class genai.types.PersonGeneration(*values)

Bases: CaseInSensitiveEnum

Enum that controls the generation of people.

ALLOW_ADULT = 'ALLOW_ADULT'
ALLOW_ALL = 'ALLOW_ALL'
DONT_ALLOW = 'DONT_ALLOW'
pydantic model genai.types.PrebuiltVoiceConfig

Bases: BaseModel

The configuration for the prebuilt speaker to use.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "PrebuiltVoiceConfig",
   "description": "The configuration for the prebuilt speaker to use.",
   "type": "object",
   "properties": {
      "voiceName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the prebuilt voice to use.",
         "title": "Voicename"
      }
   },
   "additionalProperties": false
}

Fields:
field voice_name: Optional[str] = None (alias 'voiceName')

The name of the prebuilt voice to use.

class genai.types.PrebuiltVoiceConfigDict

Bases: TypedDict

The configuration for the prebuilt speaker to use.

voice_name: Optional[str]

The name of the prebuilt voice to use.

pydantic model genai.types.ProactivityConfig

Bases: BaseModel

Config for proactivity features.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ProactivityConfig",
   "description": "Config for proactivity features.",
   "type": "object",
   "properties": {
      "proactiveAudio": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If enabled, the model can reject responding to the last prompt. For\n        example, this allows the model to ignore out of context speech or to stay\n        silent if the user did not make a request, yet.",
         "title": "Proactiveaudio"
      }
   },
   "additionalProperties": false
}

Fields:
field proactive_audio: Optional[bool] = None (alias 'proactiveAudio')

If enabled, the model can reject responding to the last prompt. For example, this allows the model to ignore out of context speech or to stay silent if the user did not make a request, yet.

class genai.types.ProactivityConfigDict

Bases: TypedDict

Config for proactivity features.

proactive_audio: Optional[bool]

If enabled, the model can reject responding to the last prompt. For example, this allows the model to ignore out of context speech or to stay silent if the user did not make a request, yet.

pydantic model genai.types.RagRetrievalConfig

Bases: BaseModel

Specifies the context retrieval config.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RagRetrievalConfig",
   "description": "Specifies the context retrieval config.",
   "type": "object",
   "properties": {
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/RagRetrievalConfigFilter"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Config for filters."
      },
      "hybridSearch": {
         "anyOf": [
            {
               "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Config for Hybrid Search."
      },
      "ranking": {
         "anyOf": [
            {
               "$ref": "#/$defs/RagRetrievalConfigRanking"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Config for ranking and reranking."
      },
      "topK": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The number of contexts to retrieve.",
         "title": "Topk"
      }
   },
   "$defs": {
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field filter: Optional[RagRetrievalConfigFilter] = None

Optional. Config for filters.

Optional. Config for Hybrid Search.

field ranking: Optional[RagRetrievalConfigRanking] = None

Optional. Config for ranking and reranking.

field top_k: Optional[int] = None (alias 'topK')

Optional. The number of contexts to retrieve.

class genai.types.RagRetrievalConfigDict

Bases: TypedDict

Specifies the context retrieval config.

filter: Optional[RagRetrievalConfigFilterDict]

Optional. Config for filters.

Optional. Config for Hybrid Search.

ranking: Optional[RagRetrievalConfigRankingDict]

Optional. Config for ranking and reranking.

top_k: Optional[int]

Optional. The number of contexts to retrieve.

pydantic model genai.types.RagRetrievalConfigFilter

Bases: BaseModel

Config for filters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RagRetrievalConfigFilter",
   "description": "Config for filters.",
   "type": "object",
   "properties": {
      "metadataFilter": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. String for metadata filtering.",
         "title": "Metadatafilter"
      },
      "vectorDistanceThreshold": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
         "title": "Vectordistancethreshold"
      },
      "vectorSimilarityThreshold": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
         "title": "Vectorsimilaritythreshold"
      }
   },
   "additionalProperties": false
}

Fields:
field metadata_filter: Optional[str] = None (alias 'metadataFilter')

Optional. String for metadata filtering.

field vector_distance_threshold: Optional[float] = None (alias 'vectorDistanceThreshold')

Optional. Only returns contexts with vector distance smaller than the threshold.

field vector_similarity_threshold: Optional[float] = None (alias 'vectorSimilarityThreshold')

Optional. Only returns contexts with vector similarity larger than the threshold.

class genai.types.RagRetrievalConfigFilterDict

Bases: TypedDict

Config for filters.

metadata_filter: Optional[str]

Optional. String for metadata filtering.

vector_distance_threshold: Optional[float]

Optional. Only returns contexts with vector distance smaller than the threshold.

vector_similarity_threshold: Optional[float]

Optional. Only returns contexts with vector similarity larger than the threshold.

pydantic model genai.types.RagRetrievalConfigHybridSearch

Bases: BaseModel

Config for Hybrid Search.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RagRetrievalConfigHybridSearch",
   "description": "Config for Hybrid Search.",
   "type": "object",
   "properties": {
      "alpha": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
         "title": "Alpha"
      }
   },
   "additionalProperties": false
}

Fields:
field alpha: Optional[float] = None

Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.

class genai.types.RagRetrievalConfigHybridSearchDict

Bases: TypedDict

Config for Hybrid Search.

alpha: Optional[float]

Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.

pydantic model genai.types.RagRetrievalConfigRanking

Bases: BaseModel

Config for ranking and reranking.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RagRetrievalConfigRanking",
   "description": "Config for ranking and reranking.",
   "type": "object",
   "properties": {
      "llmRanker": {
         "anyOf": [
            {
               "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Config for LlmRanker."
      },
      "rankService": {
         "anyOf": [
            {
               "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Config for Rank Service."
      }
   },
   "$defs": {
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field llm_ranker: Optional[RagRetrievalConfigRankingLlmRanker] = None (alias 'llmRanker')

Optional. Config for LlmRanker.

field rank_service: Optional[RagRetrievalConfigRankingRankService] = None (alias 'rankService')

Optional. Config for Rank Service.

class genai.types.RagRetrievalConfigRankingDict

Bases: TypedDict

Config for ranking and reranking.

llm_ranker: Optional[RagRetrievalConfigRankingLlmRankerDict]

Optional. Config for LlmRanker.

rank_service: Optional[RagRetrievalConfigRankingRankServiceDict]

Optional. Config for Rank Service.

pydantic model genai.types.RagRetrievalConfigRankingLlmRanker

Bases: BaseModel

Config for LlmRanker.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RagRetrievalConfigRankingLlmRanker",
   "description": "Config for LlmRanker.",
   "type": "object",
   "properties": {
      "modelName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
         "title": "Modelname"
      }
   },
   "additionalProperties": false
}

Fields:
field model_name: Optional[str] = None (alias 'modelName')

Optional. The model name used for ranking. Format: gemini-1.5-pro

class genai.types.RagRetrievalConfigRankingLlmRankerDict

Bases: TypedDict

Config for LlmRanker.

model_name: Optional[str]

gemini-1.5-pro

Type:

Optional. The model name used for ranking. Format

pydantic model genai.types.RagRetrievalConfigRankingRankService

Bases: BaseModel

Config for Rank Service.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RagRetrievalConfigRankingRankService",
   "description": "Config for Rank Service.",
   "type": "object",
   "properties": {
      "modelName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
         "title": "Modelname"
      }
   },
   "additionalProperties": false
}

Fields:
field model_name: Optional[str] = None (alias 'modelName')

Optional. The model name of the rank service. Format: semantic-ranker-512@latest

class genai.types.RagRetrievalConfigRankingRankServiceDict

Bases: TypedDict

Config for Rank Service.

model_name: Optional[str]

semantic-ranker-512@latest

Type:

Optional. The model name of the rank service. Format

pydantic model genai.types.RawReferenceImage

Bases: BaseModel

A raw reference image.

A raw reference image represents the base image to edit, provided by the user. It can optionally be provided in addition to a mask reference image or a style reference image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RawReferenceImage",
   "description": "A raw reference image.\n\nA raw reference image represents the base image to edit, provided by the user.\nIt can optionally be provided in addition to a mask reference image or\na style reference image.",
   "type": "object",
   "properties": {
      "referenceImage": {
         "anyOf": [
            {
               "$ref": "#/$defs/Image"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reference image for the editing operation."
      },
      "referenceId": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The id of the reference image.",
         "title": "Referenceid"
      },
      "referenceType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of the reference image. Only set by the SDK.",
         "title": "Referencetype"
      }
   },
   "$defs": {
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • _validate_mask_image_config » all fields

field reference_id: Optional[int] = None (alias 'referenceId')

The id of the reference image.

Validated by:
  • _validate_mask_image_config

field reference_image: Optional[Image] = None (alias 'referenceImage')

The reference image for the editing operation.

Validated by:
  • _validate_mask_image_config

field reference_type: Optional[str] = None (alias 'referenceType')

The type of the reference image. Only set by the SDK.

Validated by:
  • _validate_mask_image_config

class genai.types.RawReferenceImageDict

Bases: TypedDict

A raw reference image.

A raw reference image represents the base image to edit, provided by the user. It can optionally be provided in addition to a mask reference image or a style reference image.

reference_id: Optional[int]

The id of the reference image.

reference_image: Optional[ImageDict]

The reference image for the editing operation.

reference_type: Optional[str]

The type of the reference image. Only set by the SDK.

pydantic model genai.types.RealtimeInputConfig

Bases: BaseModel

Marks the end of user activity.

This can only be sent if automatic (i.e. server-side) activity detection is disabled.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RealtimeInputConfig",
   "description": "Marks the end of user activity.\n\nThis can only be sent if automatic (i.e. server-side) activity detection is\ndisabled.",
   "type": "object",
   "properties": {
      "automaticActivityDetection": {
         "anyOf": [
            {
               "$ref": "#/$defs/AutomaticActivityDetection"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals."
      },
      "activityHandling": {
         "anyOf": [
            {
               "$ref": "#/$defs/ActivityHandling"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Defines what effect activity has."
      },
      "turnCoverage": {
         "anyOf": [
            {
               "$ref": "#/$defs/TurnCoverage"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Defines which input is included in the user's turn."
      }
   },
   "$defs": {
      "ActivityHandling": {
         "description": "The different ways of handling user activity.",
         "enum": [
            "ACTIVITY_HANDLING_UNSPECIFIED",
            "START_OF_ACTIVITY_INTERRUPTS",
            "NO_INTERRUPTION"
         ],
         "title": "ActivityHandling",
         "type": "string"
      },
      "AutomaticActivityDetection": {
         "additionalProperties": false,
         "description": "Configures automatic detection of activity.",
         "properties": {
            "disabled": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals.",
               "title": "Disabled"
            },
            "startOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/StartSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely speech is to be detected."
            },
            "endOfSpeechSensitivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EndSensitivity"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines how likely detected speech is ended."
            },
            "prefixPaddingMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives.",
               "title": "Prefixpaddingms"
            },
            "silenceDurationMs": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.",
               "title": "Silencedurationms"
            }
         },
         "title": "AutomaticActivityDetection",
         "type": "object"
      },
      "EndSensitivity": {
         "description": "End of speech sensitivity.",
         "enum": [
            "END_SENSITIVITY_UNSPECIFIED",
            "END_SENSITIVITY_HIGH",
            "END_SENSITIVITY_LOW"
         ],
         "title": "EndSensitivity",
         "type": "string"
      },
      "StartSensitivity": {
         "description": "Start of speech sensitivity.",
         "enum": [
            "START_SENSITIVITY_UNSPECIFIED",
            "START_SENSITIVITY_HIGH",
            "START_SENSITIVITY_LOW"
         ],
         "title": "StartSensitivity",
         "type": "string"
      },
      "TurnCoverage": {
         "description": "Options about which input is included in the user's turn.",
         "enum": [
            "TURN_COVERAGE_UNSPECIFIED",
            "TURN_INCLUDES_ONLY_ACTIVITY",
            "TURN_INCLUDES_ALL_INPUT"
         ],
         "title": "TurnCoverage",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field activity_handling: Optional[ActivityHandling] = None (alias 'activityHandling')

Defines what effect activity has.

field automatic_activity_detection: Optional[AutomaticActivityDetection] = None (alias 'automaticActivityDetection')

If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals.

field turn_coverage: Optional[TurnCoverage] = None (alias 'turnCoverage')

Defines which input is included in the user’s turn.

class genai.types.RealtimeInputConfigDict

Bases: TypedDict

Marks the end of user activity.

This can only be sent if automatic (i.e. server-side) activity detection is disabled.

activity_handling: Optional[ActivityHandling]

Defines what effect activity has.

automatic_activity_detection: Optional[AutomaticActivityDetectionDict]

If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals.

turn_coverage: Optional[TurnCoverage]

Defines which input is included in the user’s turn.

pydantic model genai.types.ReplayFile

Bases: BaseModel

Represents a recorded session.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ReplayFile",
   "description": "Represents a recorded session.",
   "type": "object",
   "properties": {
      "replayId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Replayid"
      },
      "interactions": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ReplayInteraction"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Interactions"
      }
   },
   "$defs": {
      "ReplayInteraction": {
         "additionalProperties": false,
         "description": "Represents a single interaction, request and response in a replay.",
         "properties": {
            "request": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ReplayRequest"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": ""
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ReplayResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": ""
            }
         },
         "title": "ReplayInteraction",
         "type": "object"
      },
      "ReplayRequest": {
         "additionalProperties": false,
         "description": "Represents a single request in a replay.",
         "properties": {
            "method": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Method"
            },
            "url": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Url"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Headers"
            },
            "bodySegments": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Bodysegments"
            }
         },
         "title": "ReplayRequest",
         "type": "object"
      },
      "ReplayResponse": {
         "additionalProperties": false,
         "description": "Represents a single response in a replay.",
         "properties": {
            "statusCode": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Statuscode"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Headers"
            },
            "bodySegments": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Bodysegments"
            },
            "sdkResponseSegments": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Sdkresponsesegments"
            }
         },
         "title": "ReplayResponse",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field interactions: Optional[list[ReplayInteraction]] = None
field replay_id: Optional[str] = None (alias 'replayId')
class genai.types.ReplayFileDict

Bases: TypedDict

Represents a recorded session.

interactions: Optional[list[ReplayInteractionDict]]
replay_id: Optional[str]
pydantic model genai.types.ReplayInteraction

Bases: BaseModel

Represents a single interaction, request and response in a replay.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ReplayInteraction",
   "description": "Represents a single interaction, request and response in a replay.",
   "type": "object",
   "properties": {
      "request": {
         "anyOf": [
            {
               "$ref": "#/$defs/ReplayRequest"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": ""
      },
      "response": {
         "anyOf": [
            {
               "$ref": "#/$defs/ReplayResponse"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": ""
      }
   },
   "$defs": {
      "ReplayRequest": {
         "additionalProperties": false,
         "description": "Represents a single request in a replay.",
         "properties": {
            "method": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Method"
            },
            "url": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Url"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Headers"
            },
            "bodySegments": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Bodysegments"
            }
         },
         "title": "ReplayRequest",
         "type": "object"
      },
      "ReplayResponse": {
         "additionalProperties": false,
         "description": "Represents a single response in a replay.",
         "properties": {
            "statusCode": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Statuscode"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Headers"
            },
            "bodySegments": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Bodysegments"
            },
            "sdkResponseSegments": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "",
               "title": "Sdkresponsesegments"
            }
         },
         "title": "ReplayResponse",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field request: Optional[ReplayRequest] = None
field response: Optional[ReplayResponse] = None
class genai.types.ReplayInteractionDict

Bases: TypedDict

Represents a single interaction, request and response in a replay.

request: Optional[ReplayRequestDict]
response: Optional[ReplayResponseDict]
pydantic model genai.types.ReplayRequest

Bases: BaseModel

Represents a single request in a replay.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ReplayRequest",
   "description": "Represents a single request in a replay.",
   "type": "object",
   "properties": {
      "method": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Method"
      },
      "url": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Url"
      },
      "headers": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Headers"
      },
      "bodySegments": {
         "anyOf": [
            {
               "items": {
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Bodysegments"
      }
   },
   "additionalProperties": false
}

Fields:
field body_segments: Optional[list[dict[str, Any]]] = None (alias 'bodySegments')
field headers: Optional[dict[str, str]] = None
field method: Optional[str] = None
field url: Optional[str] = None
class genai.types.ReplayRequestDict

Bases: TypedDict

Represents a single request in a replay.

body_segments: Optional[list[dict[str, Any]]]
headers: Optional[dict[str, str]]
method: Optional[str]
url: Optional[str]
pydantic model genai.types.ReplayResponse

Bases: BaseModel

Represents a single response in a replay.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ReplayResponse",
   "description": "Represents a single response in a replay.",
   "type": "object",
   "properties": {
      "statusCode": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Statuscode"
      },
      "headers": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Headers"
      },
      "bodySegments": {
         "anyOf": [
            {
               "items": {
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Bodysegments"
      },
      "sdkResponseSegments": {
         "anyOf": [
            {
               "items": {
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Sdkresponsesegments"
      }
   },
   "additionalProperties": false
}

Fields:
field body_segments: Optional[list[dict[str, Any]]] = None (alias 'bodySegments')
field headers: Optional[dict[str, str]] = None
field sdk_response_segments: Optional[list[dict[str, Any]]] = None (alias 'sdkResponseSegments')
field status_code: Optional[int] = None (alias 'statusCode')
class genai.types.ReplayResponseDict

Bases: TypedDict

Represents a single response in a replay.

body_segments: Optional[list[dict[str, Any]]]
headers: Optional[dict[str, str]]
sdk_response_segments: Optional[list[dict[str, Any]]]
status_code: Optional[int]
pydantic model genai.types.Retrieval

Bases: BaseModel

Defines a retrieval tool that model can call to access external knowledge.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Retrieval",
   "description": "Defines a retrieval tool that model can call to access external knowledge.",
   "type": "object",
   "properties": {
      "disableAttribution": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Deprecated. This option is no longer supported.",
         "title": "Disableattribution"
      },
      "vertexAiSearch": {
         "anyOf": [
            {
               "$ref": "#/$defs/VertexAISearch"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Set to use data source powered by Vertex AI Search."
      },
      "vertexRagStore": {
         "anyOf": [
            {
               "$ref": "#/$defs/VertexRagStore"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
      }
   },
   "$defs": {
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field disable_attribution: Optional[bool] = None (alias 'disableAttribution')

Optional. Deprecated. This option is no longer supported.

Set to use data source powered by Vertex AI Search.

field vertex_rag_store: Optional[VertexRagStore] = None (alias 'vertexRagStore')

Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.

pydantic model genai.types.RetrievalConfig

Bases: BaseModel

Retrieval config.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RetrievalConfig",
   "description": "Retrieval config.",
   "type": "object",
   "properties": {
      "latLng": {
         "anyOf": [
            {
               "$ref": "#/$defs/LatLng"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The location of the user."
      }
   },
   "$defs": {
      "LatLng": {
         "additionalProperties": false,
         "description": "An object that represents a latitude/longitude pair.\n\nThis is expressed as a pair of doubles to represent degrees latitude and\ndegrees longitude. Unless specified otherwise, this object must conform to the\n<a href=\"https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version\">\nWGS84 standard</a>. Values must be within normalized ranges.",
         "properties": {
            "latitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].",
               "title": "Latitude"
            },
            "longitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]",
               "title": "Longitude"
            }
         },
         "title": "LatLng",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field lat_lng: Optional[LatLng] = None (alias 'latLng')

Optional. The location of the user.

class genai.types.RetrievalConfigDict

Bases: TypedDict

Retrieval config.

lat_lng: Optional[LatLngDict]

Optional. The location of the user.

class genai.types.RetrievalDict

Bases: TypedDict

Defines a retrieval tool that model can call to access external knowledge.

disable_attribution: Optional[bool]

Optional. Deprecated. This option is no longer supported.

Set to use data source powered by Vertex AI Search.

vertex_rag_store: Optional[VertexRagStoreDict]

Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.

pydantic model genai.types.RetrievalMetadata

Bases: BaseModel

Metadata related to retrieval in the grounding flow.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "RetrievalMetadata",
   "description": "Metadata related to retrieval in the grounding flow.",
   "type": "object",
   "properties": {
      "googleSearchDynamicRetrievalScore": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.",
         "title": "Googlesearchdynamicretrievalscore"
      }
   },
   "additionalProperties": false
}

Fields:
field google_search_dynamic_retrieval_score: Optional[float] = None (alias 'googleSearchDynamicRetrievalScore')

Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.

class genai.types.RetrievalMetadataDict

Bases: TypedDict

Metadata related to retrieval in the grounding flow.

google_search_dynamic_retrieval_score: Optional[float]

Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search.

pydantic model genai.types.SafetyAttributes

Bases: BaseModel

Safety attributes of a GeneratedImage or the user-provided prompt.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SafetyAttributes",
   "description": "Safety attributes of a GeneratedImage or the user-provided prompt.",
   "type": "object",
   "properties": {
      "categories": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of RAI categories.\n      ",
         "title": "Categories"
      },
      "scores": {
         "anyOf": [
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of scores of each categories.\n      ",
         "title": "Scores"
      },
      "contentType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Internal use only.\n      ",
         "title": "Contenttype"
      }
   },
   "additionalProperties": false
}

Fields:
field categories: Optional[list[str]] = None

List of RAI categories.

field content_type: Optional[str] = None (alias 'contentType')

Internal use only.

field scores: Optional[list[float]] = None

List of scores of each categories.

class genai.types.SafetyAttributesDict

Bases: TypedDict

Safety attributes of a GeneratedImage or the user-provided prompt.

categories: Optional[list[str]]

List of RAI categories.

content_type: Optional[str]

Internal use only.

scores: Optional[list[float]]

List of scores of each categories.

class genai.types.SafetyFilterLevel(*values)

Bases: CaseInSensitiveEnum

Enum that controls the safety filter level for objectionable content.

BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE'
BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE'
BLOCK_NONE = 'BLOCK_NONE'
BLOCK_ONLY_HIGH = 'BLOCK_ONLY_HIGH'
pydantic model genai.types.SafetyRating

Bases: BaseModel

Safety rating corresponding to the generated content.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SafetyRating",
   "description": "Safety rating corresponding to the generated content.",
   "type": "object",
   "properties": {
      "blocked": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Indicates whether the content was filtered out because of this rating.",
         "title": "Blocked"
      },
      "category": {
         "anyOf": [
            {
               "$ref": "#/$defs/HarmCategory"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Harm category."
      },
      "probability": {
         "anyOf": [
            {
               "$ref": "#/$defs/HarmProbability"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Harm probability levels in the content."
      },
      "probabilityScore": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Harm probability score.",
         "title": "Probabilityscore"
      },
      "severity": {
         "anyOf": [
            {
               "$ref": "#/$defs/HarmSeverity"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Harm severity levels in the content."
      },
      "severityScore": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Harm severity score.",
         "title": "Severityscore"
      }
   },
   "$defs": {
      "HarmCategory": {
         "description": "Required. Harm category.",
         "enum": [
            "HARM_CATEGORY_UNSPECIFIED",
            "HARM_CATEGORY_HATE_SPEECH",
            "HARM_CATEGORY_DANGEROUS_CONTENT",
            "HARM_CATEGORY_HARASSMENT",
            "HARM_CATEGORY_SEXUALLY_EXPLICIT",
            "HARM_CATEGORY_CIVIC_INTEGRITY"
         ],
         "title": "HarmCategory",
         "type": "string"
      },
      "HarmProbability": {
         "description": "Output only. Harm probability levels in the content.",
         "enum": [
            "HARM_PROBABILITY_UNSPECIFIED",
            "NEGLIGIBLE",
            "LOW",
            "MEDIUM",
            "HIGH"
         ],
         "title": "HarmProbability",
         "type": "string"
      },
      "HarmSeverity": {
         "description": "Output only. Harm severity levels in the content.",
         "enum": [
            "HARM_SEVERITY_UNSPECIFIED",
            "HARM_SEVERITY_NEGLIGIBLE",
            "HARM_SEVERITY_LOW",
            "HARM_SEVERITY_MEDIUM",
            "HARM_SEVERITY_HIGH"
         ],
         "title": "HarmSeverity",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field blocked: Optional[bool] = None

Output only. Indicates whether the content was filtered out because of this rating.

field category: Optional[HarmCategory] = None

Output only. Harm category.

field probability: Optional[HarmProbability] = None

Output only. Harm probability levels in the content.

field probability_score: Optional[float] = None (alias 'probabilityScore')

Output only. Harm probability score.

field severity: Optional[HarmSeverity] = None

Output only. Harm severity levels in the content.

field severity_score: Optional[float] = None (alias 'severityScore')

Output only. Harm severity score.

class genai.types.SafetyRatingDict

Bases: TypedDict

Safety rating corresponding to the generated content.

blocked: Optional[bool]

Output only. Indicates whether the content was filtered out because of this rating.

category: Optional[HarmCategory]

Output only. Harm category.

probability: Optional[HarmProbability]

Output only. Harm probability levels in the content.

probability_score: Optional[float]

Output only. Harm probability score.

severity: Optional[HarmSeverity]

Output only. Harm severity levels in the content.

severity_score: Optional[float]

Output only. Harm severity score.

pydantic model genai.types.SafetySetting

Bases: BaseModel

Safety settings.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SafetySetting",
   "description": "Safety settings.",
   "type": "object",
   "properties": {
      "method": {
         "anyOf": [
            {
               "$ref": "#/$defs/HarmBlockMethod"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Determines if the harm block method uses probability or probability\n      and severity scores."
      },
      "category": {
         "anyOf": [
            {
               "$ref": "#/$defs/HarmCategory"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. Harm category."
      },
      "threshold": {
         "anyOf": [
            {
               "$ref": "#/$defs/HarmBlockThreshold"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. The harm block threshold."
      }
   },
   "$defs": {
      "HarmBlockMethod": {
         "description": "Optional.\n\nSpecify if the threshold is used for probability or severity score. If not\nspecified, the threshold is used for probability score.",
         "enum": [
            "HARM_BLOCK_METHOD_UNSPECIFIED",
            "SEVERITY",
            "PROBABILITY"
         ],
         "title": "HarmBlockMethod",
         "type": "string"
      },
      "HarmBlockThreshold": {
         "description": "Required. The harm block threshold.",
         "enum": [
            "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
            "BLOCK_LOW_AND_ABOVE",
            "BLOCK_MEDIUM_AND_ABOVE",
            "BLOCK_ONLY_HIGH",
            "BLOCK_NONE",
            "OFF"
         ],
         "title": "HarmBlockThreshold",
         "type": "string"
      },
      "HarmCategory": {
         "description": "Required. Harm category.",
         "enum": [
            "HARM_CATEGORY_UNSPECIFIED",
            "HARM_CATEGORY_HATE_SPEECH",
            "HARM_CATEGORY_DANGEROUS_CONTENT",
            "HARM_CATEGORY_HARASSMENT",
            "HARM_CATEGORY_SEXUALLY_EXPLICIT",
            "HARM_CATEGORY_CIVIC_INTEGRITY"
         ],
         "title": "HarmCategory",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field category: Optional[HarmCategory] = None

Required. Harm category.

field method: Optional[HarmBlockMethod] = None

Determines if the harm block method uses probability or probability and severity scores.

field threshold: Optional[HarmBlockThreshold] = None

Required. The harm block threshold.

class genai.types.SafetySettingDict

Bases: TypedDict

Safety settings.

category: Optional[HarmCategory]

Required. Harm category.

method: Optional[HarmBlockMethod]

Determines if the harm block method uses probability or probability and severity scores.

threshold: Optional[HarmBlockThreshold]

Required. The harm block threshold.

class genai.types.Scale(*values)

Bases: CaseInSensitiveEnum

Scale of the generated music.

A_FLAT_MAJOR_F_MINOR = 'A_FLAT_MAJOR_F_MINOR'

Ab major or F minor.

A_MAJOR_G_FLAT_MINOR = 'A_MAJOR_G_FLAT_MINOR'

A major or Gb minor.

B_FLAT_MAJOR_G_MINOR = 'B_FLAT_MAJOR_G_MINOR'

Bb major or G minor.

B_MAJOR_A_FLAT_MINOR = 'B_MAJOR_A_FLAT_MINOR'

B major or Ab minor.

C_MAJOR_A_MINOR = 'C_MAJOR_A_MINOR'

C major or A minor.

D_FLAT_MAJOR_B_FLAT_MINOR = 'D_FLAT_MAJOR_B_FLAT_MINOR'

Db major or Bb minor.

D_MAJOR_B_MINOR = 'D_MAJOR_B_MINOR'

D major or B minor.

E_FLAT_MAJOR_C_MINOR = 'E_FLAT_MAJOR_C_MINOR'

Eb major or C minor

E_MAJOR_D_FLAT_MINOR = 'E_MAJOR_D_FLAT_MINOR'

E major or Db minor.

F_MAJOR_D_MINOR = 'F_MAJOR_D_MINOR'

F major or D minor.

G_FLAT_MAJOR_E_FLAT_MINOR = 'G_FLAT_MAJOR_E_FLAT_MINOR'

Gb major or Eb minor.

G_MAJOR_E_MINOR = 'G_MAJOR_E_MINOR'

G major or E minor.

SCALE_UNSPECIFIED = 'SCALE_UNSPECIFIED'

Default value. This value is unused.

pydantic model genai.types.Schema

Bases: BaseModel

Schema is used to define the format of input/output data.

Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "$defs": {
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      }
   },
   "$ref": "#/$defs/Schema"
}

Fields:
field any_of: Optional[list[Schema]] = None (alias 'anyOf')

Optional. The value should be validated against any (one or more) of the subschemas in the list.

field default: Optional[Any] = None

Optional. Default value of the data.

field description: Optional[str] = None

Optional. The description of the data.

field enum: Optional[list[str]] = None

Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[“EAST”, NORTH”, “SOUTH”, “WEST”]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[“101”, “201”, “301”]}

field example: Optional[Any] = None

Optional. Example of the object. Will only populated when the object is the root.

field format: Optional[str] = None

Optional. The format of the data. Supported formats: for NUMBER type: “float”, “double” for INTEGER type: “int32”, “int64” for STRING type: “email”, “byte”, etc

field items: Optional[Schema] = None

Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.

field max_items: Optional[int] = None (alias 'maxItems')

Optional. Maximum number of the elements for Type.ARRAY.

field max_length: Optional[int] = None (alias 'maxLength')

Optional. Maximum length of the Type.STRING

field max_properties: Optional[int] = None (alias 'maxProperties')

Optional. Maximum number of the properties for Type.OBJECT.

field maximum: Optional[float] = None

Optional. Maximum value of the Type.INTEGER and Type.NUMBER

field min_items: Optional[int] = None (alias 'minItems')

Optional. Minimum number of the elements for Type.ARRAY.

field min_length: Optional[int] = None (alias 'minLength')

Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING

field min_properties: Optional[int] = None (alias 'minProperties')

Optional. Minimum number of the properties for Type.OBJECT.

field minimum: Optional[float] = None

Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER

field nullable: Optional[bool] = None

Optional. Indicates if the value may be null.

field pattern: Optional[str] = None

Optional. Pattern of the Type.STRING to restrict a string to a regular expression.

field properties: Optional[dict[str, Schema]] = None

Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.

field property_ordering: Optional[list[str]] = None (alias 'propertyOrdering')

Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.

field required: Optional[list[str]] = None

Optional. Required properties of Type.OBJECT.

field title: Optional[str] = None

Optional. The title of the Schema.

field type: Optional[Type] = None

Optional. The type of the data.

classmethod from_json_schema(*, json_schema, api_option='GEMINI_API', raise_error_on_unsupported_field=False)

Converts a JSONSchema object to a Schema object.

The JSONSchema is compatible with 2020-12 JSON Schema draft, specified by OpenAPI 3.1.

Return type:

Schema

Parameters:
  • json_schema – JSONSchema object to be converted.

  • api_option – API option to be used. If set to ‘VERTEX_AI’, the JSONSchema will be converted to a Schema object that is compatible with Vertex AI API. If set to ‘GEMINI_API’, the JSONSchema will be converted to a Schema object that is compatible with Gemini API. Default is ‘GEMINI_API’.

  • raise_error_on_unsupported_field – If set to True, an error will be raised if the JSONSchema contains any unsupported fields. Default is False.

Returns:

Schema object that is compatible with the specified API option.

Raises:

ValueError – If the JSONSchema contains any unsupported fields and raise_error_on_unsupported_field is set to True. Or if the JSONSchema is not compatible with the specified API option.

property json_schema: JSONSchema

Converts the Schema object to a JSONSchema object, that is compatible with 2020-12 JSON Schema draft.

If a Schema field is not supported by JSONSchema, it will be ignored.

class genai.types.SchemaDict

Bases: TypedDict

Schema is used to define the format of input/output data.

Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed.

any_of: Optional[list[SchemaDict]]

Optional. The value should be validated against any (one or more) of the subschemas in the list.

default: Optional[Any]

Optional. Default value of the data.

description: Optional[str]

Optional. The description of the data.

enum: Optional[list[str]]

{type:STRING, format:enum, enum:[“EAST”, NORTH”, “SOUTH”, “WEST”]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[“101”, “201”, “301”]}

Type:

Optional. Possible values of the element of primitive type with enum format. Examples

Type:
  1. We can define direction as

example: Optional[Any]

Optional. Example of the object. Will only populated when the object is the root.

format: Optional[str]

“float”, “double” for INTEGER type: “int32”, “int64” for STRING type: “email”, “byte”, etc

Type:

Optional. The format of the data. Supported formats

Type:

for NUMBER type

max_items: Optional[int]

Optional. Maximum number of the elements for Type.ARRAY.

max_length: Optional[int]

Optional. Maximum length of the Type.STRING

max_properties: Optional[int]

Optional. Maximum number of the properties for Type.OBJECT.

maximum: Optional[float]

Optional. Maximum value of the Type.INTEGER and Type.NUMBER

min_items: Optional[int]

Optional. Minimum number of the elements for Type.ARRAY.

min_length: Optional[int]

Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING

min_properties: Optional[int]

Optional. Minimum number of the properties for Type.OBJECT.

minimum: Optional[float]

Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER

nullable: Optional[bool]

Optional. Indicates if the value may be null.

pattern: Optional[str]

Optional. Pattern of the Type.STRING to restrict a string to a regular expression.

properties: Optional[dict[str, SchemaDict]]

Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.

property_ordering: Optional[list[str]]

Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.

required: Optional[list[str]]

Optional. Required properties of Type.OBJECT.

title: Optional[str]

Optional. The title of the Schema.

type: Optional[Type]

Optional. The type of the data.

pydantic model genai.types.SearchEntryPoint

Bases: BaseModel

Google search entry point.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SearchEntryPoint",
   "description": "Google search entry point.",
   "type": "object",
   "properties": {
      "renderedContent": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Web content snippet that can be embedded in a web page or an app webview.",
         "title": "Renderedcontent"
      },
      "sdkBlob": {
         "anyOf": [
            {
               "format": "base64url",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Base64 encoded JSON representing array of tuple.",
         "title": "Sdkblob"
      }
   },
   "additionalProperties": false
}

Fields:
field rendered_content: Optional[str] = None (alias 'renderedContent')

Optional. Web content snippet that can be embedded in a web page or an app webview.

field sdk_blob: Optional[bytes] = None (alias 'sdkBlob')

Optional. Base64 encoded JSON representing array of tuple.

class genai.types.SearchEntryPointDict

Bases: TypedDict

Google search entry point.

rendered_content: Optional[str]

Optional. Web content snippet that can be embedded in a web page or an app webview.

sdk_blob: Optional[bytes]

Optional. Base64 encoded JSON representing array of tuple.

pydantic model genai.types.Segment

Bases: BaseModel

Segment of the content.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Segment",
   "description": "Segment of the content.",
   "type": "object",
   "properties": {
      "endIndex": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.",
         "title": "Endindex"
      },
      "partIndex": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The index of a Part object within its parent Content object.",
         "title": "Partindex"
      },
      "startIndex": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.",
         "title": "Startindex"
      },
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The text corresponding to the segment from the response.",
         "title": "Text"
      }
   },
   "additionalProperties": false
}

Fields:
field end_index: Optional[int] = None (alias 'endIndex')

Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.

field part_index: Optional[int] = None (alias 'partIndex')

Output only. The index of a Part object within its parent Content object.

field start_index: Optional[int] = None (alias 'startIndex')

Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.

field text: Optional[str] = None

Output only. The text corresponding to the segment from the response.

class genai.types.SegmentDict

Bases: TypedDict

Segment of the content.

end_index: Optional[int]

Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.

part_index: Optional[int]

Output only. The index of a Part object within its parent Content object.

start_index: Optional[int]

Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.

text: Optional[str]

Output only. The text corresponding to the segment from the response.

pydantic model genai.types.SessionResumptionConfig

Bases: BaseModel

Configuration of session resumption mechanism.

Included in LiveConnectConfig.session_resumption. If included server will send LiveServerSessionResumptionUpdate messages.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SessionResumptionConfig",
   "description": "Configuration of session resumption mechanism.\n\nIncluded in `LiveConnectConfig.session_resumption`. If included server\nwill send `LiveServerSessionResumptionUpdate` messages.",
   "type": "object",
   "properties": {
      "handle": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Session resumption handle of previous session (session to restore).\n\nIf not present new session will be started.",
         "title": "Handle"
      },
      "transparent": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If set the server will send `last_consumed_client_message_index` in the `session_resumption_update` messages to allow for transparent reconnections.",
         "title": "Transparent"
      }
   },
   "additionalProperties": false
}

Fields:
field handle: Optional[str] = None

Session resumption handle of previous session (session to restore).

If not present new session will be started.

field transparent: Optional[bool] = None

If set the server will send last_consumed_client_message_index in the session_resumption_update messages to allow for transparent reconnections.

class genai.types.SessionResumptionConfigDict

Bases: TypedDict

Configuration of session resumption mechanism.

Included in LiveConnectConfig.session_resumption. If included server will send LiveServerSessionResumptionUpdate messages.

handle: Optional[str]

Session resumption handle of previous session (session to restore).

If not present new session will be started.

transparent: Optional[bool]

If set the server will send last_consumed_client_message_index in the session_resumption_update messages to allow for transparent reconnections.

pydantic model genai.types.SlidingWindow

Bases: BaseModel

Context window will be truncated by keeping only suffix of it.

Context window will always be cut at start of USER role turn. System instructions and BidiGenerateContentSetup.prefix_turns will not be subject to the sliding window mechanism, they will always stay at the beginning of context window.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SlidingWindow",
   "description": "Context window will be truncated by keeping only suffix of it.\n\nContext window will always be cut at start of USER role turn. System\ninstructions and `BidiGenerateContentSetup.prefix_turns` will not be\nsubject to the sliding window mechanism, they will always stay at the\nbeginning of context window.",
   "type": "object",
   "properties": {
      "targetTokens": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.",
         "title": "Targettokens"
      }
   },
   "additionalProperties": false
}

Fields:
field target_tokens: Optional[int] = None (alias 'targetTokens')

Session reduction target – how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.

class genai.types.SlidingWindowDict

Bases: TypedDict

Context window will be truncated by keeping only suffix of it.

Context window will always be cut at start of USER role turn. System instructions and BidiGenerateContentSetup.prefix_turns will not be subject to the sliding window mechanism, they will always stay at the beginning of context window.

target_tokens: Optional[int]

Session reduction target – how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.

pydantic model genai.types.SpeakerVoiceConfig

Bases: BaseModel

The configuration for the speaker to use.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SpeakerVoiceConfig",
   "description": "The configuration for the speaker to use.",
   "type": "object",
   "properties": {
      "speaker": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
         "title": "Speaker"
      },
      "voiceConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/VoiceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The configuration for the voice to use."
      }
   },
   "$defs": {
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field speaker: Optional[str] = None

The name of the speaker to use. Should be the same as in the prompt.

field voice_config: Optional[VoiceConfig] = None (alias 'voiceConfig')

The configuration for the voice to use.

class genai.types.SpeakerVoiceConfigDict

Bases: TypedDict

The configuration for the speaker to use.

speaker: Optional[str]

The name of the speaker to use. Should be the same as in the prompt.

voice_config: Optional[VoiceConfigDict]

The configuration for the voice to use.

pydantic model genai.types.SpeechConfig

Bases: BaseModel

The speech generation configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SpeechConfig",
   "description": "The speech generation configuration.",
   "type": "object",
   "properties": {
      "voiceConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/VoiceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The configuration for the speaker to use.\n      "
      },
      "multiSpeakerVoiceConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/MultiSpeakerVoiceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The configuration for the multi-speaker setup.\n          It is mutually exclusive with the voice_config field.\n          "
      },
      "languageCode": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Language code (ISO 639. e.g. en-US) for the speech synthesization.\n      Only available for Live API.\n      ",
         "title": "Languagecode"
      }
   },
   "$defs": {
      "MultiSpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the multi-speaker setup.",
         "properties": {
            "speakerVoiceConfigs": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SpeakerVoiceConfig"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.",
               "title": "Speakervoiceconfigs"
            }
         },
         "title": "MultiSpeakerVoiceConfig",
         "type": "object"
      },
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      },
      "SpeakerVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the speaker to use.",
         "properties": {
            "speaker": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the speaker to use. Should be the same as in the\n          prompt.",
               "title": "Speaker"
            },
            "voiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the voice to use."
            }
         },
         "title": "SpeakerVoiceConfig",
         "type": "object"
      },
      "VoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the voice to use.",
         "properties": {
            "prebuiltVoiceConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PrebuiltVoiceConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The configuration for the speaker to use.\n      "
            }
         },
         "title": "VoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field language_code: Optional[str] = None (alias 'languageCode')

Language code (ISO 639. e.g. en-US) for the speech synthesization. Only available for Live API.

field multi_speaker_voice_config: Optional[MultiSpeakerVoiceConfig] = None (alias 'multiSpeakerVoiceConfig')

The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.

field voice_config: Optional[VoiceConfig] = None (alias 'voiceConfig')

The configuration for the speaker to use.

class genai.types.SpeechConfigDict

Bases: TypedDict

The speech generation configuration.

language_code: Optional[str]

Language code (ISO 639. e.g. en-US) for the speech synthesization. Only available for Live API.

multi_speaker_voice_config: Optional[MultiSpeakerVoiceConfigDict]

The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field.

voice_config: Optional[VoiceConfigDict]

The configuration for the speaker to use.

class genai.types.StartSensitivity(*values)

Bases: CaseInSensitiveEnum

Start of speech sensitivity.

START_SENSITIVITY_HIGH = 'START_SENSITIVITY_HIGH'

Automatic detection will detect the start of speech more often.

START_SENSITIVITY_LOW = 'START_SENSITIVITY_LOW'

Automatic detection will detect the start of speech less often.

START_SENSITIVITY_UNSPECIFIED = 'START_SENSITIVITY_UNSPECIFIED'

The default is START_SENSITIVITY_LOW.

pydantic model genai.types.StyleReferenceConfig

Bases: BaseModel

Configuration for a Style reference image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "StyleReferenceConfig",
   "description": "Configuration for a Style reference image.",
   "type": "object",
   "properties": {
      "styleDescription": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A text description of the style to use for the generated image.",
         "title": "Styledescription"
      }
   },
   "additionalProperties": false
}

Fields:
field style_description: Optional[str] = None (alias 'styleDescription')

A text description of the style to use for the generated image.

class genai.types.StyleReferenceConfigDict

Bases: TypedDict

Configuration for a Style reference image.

style_description: Optional[str]

A text description of the style to use for the generated image.

pydantic model genai.types.StyleReferenceImage

Bases: BaseModel

A style reference image.

This encapsulates a style reference image provided by the user, and additionally optional config parameters for the style reference image.

A raw reference image can also be provided as a destination for the style to be applied to.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "StyleReferenceImage",
   "description": "A style reference image.\n\nThis encapsulates a style reference image provided by the user, and\nadditionally optional config parameters for the style reference image.\n\nA raw reference image can also be provided as a destination for the style to\nbe applied to.",
   "type": "object",
   "properties": {
      "referenceImage": {
         "anyOf": [
            {
               "$ref": "#/$defs/Image"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reference image for the editing operation."
      },
      "referenceId": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The id of the reference image.",
         "title": "Referenceid"
      },
      "referenceType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of the reference image. Only set by the SDK.",
         "title": "Referencetype"
      },
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/StyleReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for the style reference image."
      },
      "styleImageConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/StyleReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": ""
      }
   },
   "$defs": {
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "StyleReferenceConfig": {
         "additionalProperties": false,
         "description": "Configuration for a Style reference image.",
         "properties": {
            "styleDescription": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A text description of the style to use for the generated image.",
               "title": "Styledescription"
            }
         },
         "title": "StyleReferenceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • _validate_mask_image_config » all fields

field config: Optional[StyleReferenceConfig] = None

Re-map config to style_reference_config to send to API.

Configuration for the style reference image.

Validated by:
  • _validate_mask_image_config

field reference_id: Optional[int] = None (alias 'referenceId')

The id of the reference image.

Validated by:
  • _validate_mask_image_config

field reference_image: Optional[Image] = None (alias 'referenceImage')

The reference image for the editing operation.

Validated by:
  • _validate_mask_image_config

field reference_type: Optional[str] = None (alias 'referenceType')

The type of the reference image. Only set by the SDK.

Validated by:
  • _validate_mask_image_config

field style_image_config: Optional[StyleReferenceConfig] = None (alias 'styleImageConfig')
Validated by:
  • _validate_mask_image_config

class genai.types.StyleReferenceImageDict

Bases: TypedDict

A style reference image.

This encapsulates a style reference image provided by the user, and additionally optional config parameters for the style reference image.

A raw reference image can also be provided as a destination for the style to be applied to.

config: Optional[StyleReferenceConfigDict]

Configuration for the style reference image.

reference_id: Optional[int]

The id of the reference image.

reference_image: Optional[ImageDict]

The reference image for the editing operation.

reference_type: Optional[str]

The type of the reference image. Only set by the SDK.

pydantic model genai.types.SubjectReferenceConfig

Bases: BaseModel

Configuration for a Subject reference image.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SubjectReferenceConfig",
   "description": "Configuration for a Subject reference image.",
   "type": "object",
   "properties": {
      "subjectType": {
         "anyOf": [
            {
               "$ref": "#/$defs/SubjectReferenceType"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The subject type of a subject reference image."
      },
      "subjectDescription": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Subject description for the image.",
         "title": "Subjectdescription"
      }
   },
   "$defs": {
      "SubjectReferenceType": {
         "description": "Enum representing the subject type of a subject reference image.",
         "enum": [
            "SUBJECT_TYPE_DEFAULT",
            "SUBJECT_TYPE_PERSON",
            "SUBJECT_TYPE_ANIMAL",
            "SUBJECT_TYPE_PRODUCT"
         ],
         "title": "SubjectReferenceType",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field subject_description: Optional[str] = None (alias 'subjectDescription')

Subject description for the image.

field subject_type: Optional[SubjectReferenceType] = None (alias 'subjectType')

The subject type of a subject reference image.

class genai.types.SubjectReferenceConfigDict

Bases: TypedDict

Configuration for a Subject reference image.

subject_description: Optional[str]

Subject description for the image.

subject_type: Optional[SubjectReferenceType]

The subject type of a subject reference image.

pydantic model genai.types.SubjectReferenceImage

Bases: BaseModel

A subject reference image.

This encapsulates a subject reference image provided by the user, and additionally optional config parameters for the subject reference image.

A raw reference image can also be provided as a destination for the subject to be applied to.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SubjectReferenceImage",
   "description": "A subject reference image.\n\nThis encapsulates a subject reference image provided by the user, and\nadditionally optional config parameters for the subject reference image.\n\nA raw reference image can also be provided as a destination for the subject to\nbe applied to.",
   "type": "object",
   "properties": {
      "referenceImage": {
         "anyOf": [
            {
               "$ref": "#/$defs/Image"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reference image for the editing operation."
      },
      "referenceId": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The id of the reference image.",
         "title": "Referenceid"
      },
      "referenceType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of the reference image. Only set by the SDK.",
         "title": "Referencetype"
      },
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/SubjectReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for the subject reference image."
      },
      "subjectImageConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/SubjectReferenceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": ""
      }
   },
   "$defs": {
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "SubjectReferenceConfig": {
         "additionalProperties": false,
         "description": "Configuration for a Subject reference image.",
         "properties": {
            "subjectType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SubjectReferenceType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The subject type of a subject reference image."
            },
            "subjectDescription": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Subject description for the image.",
               "title": "Subjectdescription"
            }
         },
         "title": "SubjectReferenceConfig",
         "type": "object"
      },
      "SubjectReferenceType": {
         "description": "Enum representing the subject type of a subject reference image.",
         "enum": [
            "SUBJECT_TYPE_DEFAULT",
            "SUBJECT_TYPE_PERSON",
            "SUBJECT_TYPE_ANIMAL",
            "SUBJECT_TYPE_PRODUCT"
         ],
         "title": "SubjectReferenceType",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • _validate_mask_image_config » all fields

field config: Optional[SubjectReferenceConfig] = None

Re-map config to subject_reference_config to send to API.

Configuration for the subject reference image.

Validated by:
  • _validate_mask_image_config

field reference_id: Optional[int] = None (alias 'referenceId')

The id of the reference image.

Validated by:
  • _validate_mask_image_config

field reference_image: Optional[Image] = None (alias 'referenceImage')

The reference image for the editing operation.

Validated by:
  • _validate_mask_image_config

field reference_type: Optional[str] = None (alias 'referenceType')

The type of the reference image. Only set by the SDK.

Validated by:
  • _validate_mask_image_config

field subject_image_config: Optional[SubjectReferenceConfig] = None (alias 'subjectImageConfig')
Validated by:
  • _validate_mask_image_config

class genai.types.SubjectReferenceImageDict

Bases: TypedDict

A subject reference image.

This encapsulates a subject reference image provided by the user, and additionally optional config parameters for the subject reference image.

A raw reference image can also be provided as a destination for the subject to be applied to.

config: Optional[SubjectReferenceConfigDict]

Configuration for the subject reference image.

reference_id: Optional[int]

The id of the reference image.

reference_image: Optional[ImageDict]

The reference image for the editing operation.

reference_type: Optional[str]

The type of the reference image. Only set by the SDK.

class genai.types.SubjectReferenceType(*values)

Bases: CaseInSensitiveEnum

Enum representing the subject type of a subject reference image.

SUBJECT_TYPE_ANIMAL = 'SUBJECT_TYPE_ANIMAL'
SUBJECT_TYPE_DEFAULT = 'SUBJECT_TYPE_DEFAULT'
SUBJECT_TYPE_PERSON = 'SUBJECT_TYPE_PERSON'
SUBJECT_TYPE_PRODUCT = 'SUBJECT_TYPE_PRODUCT'
pydantic model genai.types.SupervisedHyperParameters

Bases: BaseModel

Hyperparameters for SFT.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SupervisedHyperParameters",
   "description": "Hyperparameters for SFT.",
   "type": "object",
   "properties": {
      "adapterSize": {
         "anyOf": [
            {
               "$ref": "#/$defs/AdapterSize"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Adapter size for tuning."
      },
      "epochCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
         "title": "Epochcount"
      },
      "learningRateMultiplier": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Multiplier for adjusting the default learning rate.",
         "title": "Learningratemultiplier"
      }
   },
   "$defs": {
      "AdapterSize": {
         "description": "Optional. Adapter size for tuning.",
         "enum": [
            "ADAPTER_SIZE_UNSPECIFIED",
            "ADAPTER_SIZE_ONE",
            "ADAPTER_SIZE_TWO",
            "ADAPTER_SIZE_FOUR",
            "ADAPTER_SIZE_EIGHT",
            "ADAPTER_SIZE_SIXTEEN",
            "ADAPTER_SIZE_THIRTY_TWO"
         ],
         "title": "AdapterSize",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field adapter_size: Optional[AdapterSize] = None (alias 'adapterSize')

Optional. Adapter size for tuning.

field epoch_count: Optional[int] = None (alias 'epochCount')

Optional. Number of complete passes the model makes over the entire training dataset during training.

field learning_rate_multiplier: Optional[float] = None (alias 'learningRateMultiplier')

Optional. Multiplier for adjusting the default learning rate.

class genai.types.SupervisedHyperParametersDict

Bases: TypedDict

Hyperparameters for SFT.

adapter_size: Optional[AdapterSize]

Optional. Adapter size for tuning.

epoch_count: Optional[int]

Optional. Number of complete passes the model makes over the entire training dataset during training.

learning_rate_multiplier: Optional[float]

Optional. Multiplier for adjusting the default learning rate.

pydantic model genai.types.SupervisedTuningDataStats

Bases: BaseModel

Tuning data statistics for Supervised Tuning.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SupervisedTuningDataStats",
   "description": "Tuning data statistics for Supervised Tuning.",
   "type": "object",
   "properties": {
      "totalBillableCharacterCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of billable characters in the tuning dataset.",
         "title": "Totalbillablecharactercount"
      },
      "totalBillableTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of billable tokens in the tuning dataset.",
         "title": "Totalbillabletokencount"
      },
      "totalTruncatedExampleCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The number of examples in the dataset that have been truncated by any amount.",
         "title": "Totaltruncatedexamplecount"
      },
      "totalTuningCharacterCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of tuning characters in the tuning dataset.",
         "title": "Totaltuningcharactercount"
      },
      "truncatedExampleIndices": {
         "anyOf": [
            {
               "items": {
                  "type": "integer"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A partial sample of the indices (starting from 1) of the truncated examples.",
         "title": "Truncatedexampleindices"
      },
      "tuningDatasetExampleCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of examples in the tuning dataset.",
         "title": "Tuningdatasetexamplecount"
      },
      "tuningStepCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of tuning steps for this Tuning Job.",
         "title": "Tuningstepcount"
      },
      "userDatasetExamples": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Content"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Sample user messages in the training dataset uri.",
         "title": "Userdatasetexamples"
      },
      "userInputTokenDistribution": {
         "anyOf": [
            {
               "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Dataset distributions for the user input tokens."
      },
      "userMessagePerExampleDistribution": {
         "anyOf": [
            {
               "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Dataset distributions for the messages per example."
      },
      "userOutputTokenDistribution": {
         "anyOf": [
            {
               "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Dataset distributions for the user output tokens."
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "SupervisedTuningDatasetDistribution": {
         "additionalProperties": false,
         "description": "Dataset distribution for Supervised Tuning.",
         "properties": {
            "billableSum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values that are billable.",
               "title": "Billablesum"
            },
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SupervisedTuningDatasetDistributionDatasetBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "SupervisedTuningDatasetDistribution",
         "type": "object"
      },
      "SupervisedTuningDatasetDistributionDatasetBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "SupervisedTuningDatasetDistributionDatasetBucket",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field total_billable_character_count: Optional[int] = None (alias 'totalBillableCharacterCount')

Output only. Number of billable characters in the tuning dataset.

field total_billable_token_count: Optional[int] = None (alias 'totalBillableTokenCount')

Output only. Number of billable tokens in the tuning dataset.

field total_truncated_example_count: Optional[int] = None (alias 'totalTruncatedExampleCount')

The number of examples in the dataset that have been truncated by any amount.

field total_tuning_character_count: Optional[int] = None (alias 'totalTuningCharacterCount')

Output only. Number of tuning characters in the tuning dataset.

field truncated_example_indices: Optional[list[int]] = None (alias 'truncatedExampleIndices')

A partial sample of the indices (starting from 1) of the truncated examples.

field tuning_dataset_example_count: Optional[int] = None (alias 'tuningDatasetExampleCount')

Output only. Number of examples in the tuning dataset.

field tuning_step_count: Optional[int] = None (alias 'tuningStepCount')

Output only. Number of tuning steps for this Tuning Job.

field user_dataset_examples: Optional[list[Content]] = None (alias 'userDatasetExamples')

Output only. Sample user messages in the training dataset uri.

field user_input_token_distribution: Optional[SupervisedTuningDatasetDistribution] = None (alias 'userInputTokenDistribution')

Output only. Dataset distributions for the user input tokens.

field user_message_per_example_distribution: Optional[SupervisedTuningDatasetDistribution] = None (alias 'userMessagePerExampleDistribution')

Output only. Dataset distributions for the messages per example.

field user_output_token_distribution: Optional[SupervisedTuningDatasetDistribution] = None (alias 'userOutputTokenDistribution')

Output only. Dataset distributions for the user output tokens.

class genai.types.SupervisedTuningDataStatsDict

Bases: TypedDict

Tuning data statistics for Supervised Tuning.

total_billable_character_count: Optional[int]

Output only. Number of billable characters in the tuning dataset.

total_billable_token_count: Optional[int]

Output only. Number of billable tokens in the tuning dataset.

total_truncated_example_count: Optional[int]

The number of examples in the dataset that have been truncated by any amount.

total_tuning_character_count: Optional[int]

Output only. Number of tuning characters in the tuning dataset.

truncated_example_indices: Optional[list[int]]

A partial sample of the indices (starting from 1) of the truncated examples.

tuning_dataset_example_count: Optional[int]

Output only. Number of examples in the tuning dataset.

tuning_step_count: Optional[int]

Output only. Number of tuning steps for this Tuning Job.

user_dataset_examples: Optional[list[ContentDict]]

Output only. Sample user messages in the training dataset uri.

user_input_token_distribution: Optional[SupervisedTuningDatasetDistributionDict]

Output only. Dataset distributions for the user input tokens.

user_message_per_example_distribution: Optional[SupervisedTuningDatasetDistributionDict]

Output only. Dataset distributions for the messages per example.

user_output_token_distribution: Optional[SupervisedTuningDatasetDistributionDict]

Output only. Dataset distributions for the user output tokens.

pydantic model genai.types.SupervisedTuningDatasetDistribution

Bases: BaseModel

Dataset distribution for Supervised Tuning.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SupervisedTuningDatasetDistribution",
   "description": "Dataset distribution for Supervised Tuning.",
   "type": "object",
   "properties": {
      "billableSum": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Sum of a given population of values that are billable.",
         "title": "Billablesum"
      },
      "buckets": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/SupervisedTuningDatasetDistributionDatasetBucket"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Defines the histogram bucket.",
         "title": "Buckets"
      },
      "max": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The maximum of the population values.",
         "title": "Max"
      },
      "mean": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The arithmetic mean of the values in the population.",
         "title": "Mean"
      },
      "median": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The median of the values in the population.",
         "title": "Median"
      },
      "min": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The minimum of the population values.",
         "title": "Min"
      },
      "p5": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The 5th percentile of the values in the population.",
         "title": "P5"
      },
      "p95": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The 95th percentile of the values in the population.",
         "title": "P95"
      },
      "sum": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Sum of a given population of values.",
         "title": "Sum"
      }
   },
   "$defs": {
      "SupervisedTuningDatasetDistributionDatasetBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "SupervisedTuningDatasetDistributionDatasetBucket",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field billable_sum: Optional[int] = None (alias 'billableSum')

Output only. Sum of a given population of values that are billable.

field buckets: Optional[list[SupervisedTuningDatasetDistributionDatasetBucket]] = None

Output only. Defines the histogram bucket.

field max: Optional[float] = None

Output only. The maximum of the population values.

field mean: Optional[float] = None

Output only. The arithmetic mean of the values in the population.

field median: Optional[float] = None

Output only. The median of the values in the population.

field min: Optional[float] = None

Output only. The minimum of the population values.

field p5: Optional[float] = None

Output only. The 5th percentile of the values in the population.

field p95: Optional[float] = None

Output only. The 95th percentile of the values in the population.

field sum: Optional[int] = None

Output only. Sum of a given population of values.

pydantic model genai.types.SupervisedTuningDatasetDistributionDatasetBucket

Bases: BaseModel

Dataset bucket used to create a histogram for the distribution given a population of values.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SupervisedTuningDatasetDistributionDatasetBucket",
   "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
   "type": "object",
   "properties": {
      "count": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Number of values in the bucket.",
         "title": "Count"
      },
      "left": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Left bound of the bucket.",
         "title": "Left"
      },
      "right": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Right bound of the bucket.",
         "title": "Right"
      }
   },
   "additionalProperties": false
}

Fields:
field count: Optional[float] = None

Output only. Number of values in the bucket.

field left: Optional[float] = None

Output only. Left bound of the bucket.

field right: Optional[float] = None

Output only. Right bound of the bucket.

class genai.types.SupervisedTuningDatasetDistributionDatasetBucketDict

Bases: TypedDict

Dataset bucket used to create a histogram for the distribution given a population of values.

count: Optional[float]

Output only. Number of values in the bucket.

left: Optional[float]

Output only. Left bound of the bucket.

right: Optional[float]

Output only. Right bound of the bucket.

class genai.types.SupervisedTuningDatasetDistributionDict

Bases: TypedDict

Dataset distribution for Supervised Tuning.

billable_sum: Optional[int]

Output only. Sum of a given population of values that are billable.

buckets: Optional[list[SupervisedTuningDatasetDistributionDatasetBucketDict]]

Output only. Defines the histogram bucket.

max: Optional[float]

Output only. The maximum of the population values.

mean: Optional[float]

Output only. The arithmetic mean of the values in the population.

median: Optional[float]

Output only. The median of the values in the population.

min: Optional[float]

Output only. The minimum of the population values.

p5: Optional[float]

Output only. The 5th percentile of the values in the population.

p95: Optional[float]

Output only. The 95th percentile of the values in the population.

sum: Optional[int]

Output only. Sum of a given population of values.

pydantic model genai.types.SupervisedTuningSpec

Bases: BaseModel

Tuning Spec for Supervised Tuning for first party models.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "SupervisedTuningSpec",
   "description": "Tuning Spec for Supervised Tuning for first party models.",
   "type": "object",
   "properties": {
      "hyperParameters": {
         "anyOf": [
            {
               "$ref": "#/$defs/SupervisedHyperParameters"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Hyperparameters for SFT."
      },
      "trainingDatasetUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
         "title": "Trainingdataseturi"
      },
      "validationDatasetUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
         "title": "Validationdataseturi"
      },
      "exportLastCheckpointOnly": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported.",
         "title": "Exportlastcheckpointonly"
      }
   },
   "$defs": {
      "AdapterSize": {
         "description": "Optional. Adapter size for tuning.",
         "enum": [
            "ADAPTER_SIZE_UNSPECIFIED",
            "ADAPTER_SIZE_ONE",
            "ADAPTER_SIZE_TWO",
            "ADAPTER_SIZE_FOUR",
            "ADAPTER_SIZE_EIGHT",
            "ADAPTER_SIZE_SIXTEEN",
            "ADAPTER_SIZE_THIRTY_TWO"
         ],
         "title": "AdapterSize",
         "type": "string"
      },
      "SupervisedHyperParameters": {
         "additionalProperties": false,
         "description": "Hyperparameters for SFT.",
         "properties": {
            "adapterSize": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AdapterSize"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Adapter size for tuning."
            },
            "epochCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
               "title": "Epochcount"
            },
            "learningRateMultiplier": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Multiplier for adjusting the default learning rate.",
               "title": "Learningratemultiplier"
            }
         },
         "title": "SupervisedHyperParameters",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field export_last_checkpoint_only: Optional[bool] = None (alias 'exportLastCheckpointOnly')

Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported.

field hyper_parameters: Optional[SupervisedHyperParameters] = None (alias 'hyperParameters')

Optional. Hyperparameters for SFT.

field training_dataset_uri: Optional[str] = None (alias 'trainingDatasetUri')

Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

field validation_dataset_uri: Optional[str] = None (alias 'validationDatasetUri')

Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.

class genai.types.SupervisedTuningSpecDict

Bases: TypedDict

Tuning Spec for Supervised Tuning for first party models.

export_last_checkpoint_only: Optional[bool]

Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported.

hyper_parameters: Optional[SupervisedHyperParametersDict]

Optional. Hyperparameters for SFT.

training_dataset_uri: Optional[str]

Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

validation_dataset_uri: Optional[str]

Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.

pydantic model genai.types.TestTableFile

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TestTableFile",
   "type": "object",
   "properties": {
      "comment": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Comment"
      },
      "testMethod": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Testmethod"
      },
      "parameterNames": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Parameternames"
      },
      "testTable": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/TestTableItem"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Testtable"
      }
   },
   "$defs": {
      "TestTableItem": {
         "additionalProperties": false,
         "properties": {
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the test. This is used to derive the replay id.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parameters to the test. Use pydantic models.",
               "title": "Parameters"
            },
            "exceptionIfMldev": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Expects an exception for MLDev matching the string.",
               "title": "Exceptionifmldev"
            },
            "exceptionIfVertex": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Expects an exception for Vertex matching the string.",
               "title": "Exceptionifvertex"
            },
            "overrideReplayId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Use if you don't want to use the default replay id which is derived from the test name.",
               "title": "Overridereplayid"
            },
            "hasUnion": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "True if the parameters contain an unsupported union type. This test  will be skipped for languages that do not support the union type.",
               "title": "Hasunion"
            },
            "skipInApiMode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "When set to a reason string, this test will be skipped in the API mode. Use this flag for tests that can not be reproduced with the real API. E.g. a test that deletes a resource.",
               "title": "Skipinapimode"
            },
            "ignoreKeys": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Keys to ignore when comparing the request and response. This is useful for tests that are not deterministic.",
               "title": "Ignorekeys"
            }
         },
         "title": "TestTableItem",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field comment: Optional[str] = None
field parameter_names: Optional[list[str]] = None (alias 'parameterNames')
field test_method: Optional[str] = None (alias 'testMethod')
field test_table: Optional[list[TestTableItem]] = None (alias 'testTable')
class genai.types.TestTableFileDict

Bases: TypedDict

comment: Optional[str]
parameter_names: Optional[list[str]]
test_method: Optional[str]
test_table: Optional[list[TestTableItemDict]]
pydantic model genai.types.TestTableItem

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TestTableItem",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the test. This is used to derive the replay id.",
         "title": "Name"
      },
      "parameters": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The parameters to the test. Use pydantic models.",
         "title": "Parameters"
      },
      "exceptionIfMldev": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Expects an exception for MLDev matching the string.",
         "title": "Exceptionifmldev"
      },
      "exceptionIfVertex": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Expects an exception for Vertex matching the string.",
         "title": "Exceptionifvertex"
      },
      "overrideReplayId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Use if you don't want to use the default replay id which is derived from the test name.",
         "title": "Overridereplayid"
      },
      "hasUnion": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "True if the parameters contain an unsupported union type. This test  will be skipped for languages that do not support the union type.",
         "title": "Hasunion"
      },
      "skipInApiMode": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "When set to a reason string, this test will be skipped in the API mode. Use this flag for tests that can not be reproduced with the real API. E.g. a test that deletes a resource.",
         "title": "Skipinapimode"
      },
      "ignoreKeys": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Keys to ignore when comparing the request and response. This is useful for tests that are not deterministic.",
         "title": "Ignorekeys"
      }
   },
   "additionalProperties": false
}

Fields:
field exception_if_mldev: Optional[str] = None (alias 'exceptionIfMldev')

Expects an exception for MLDev matching the string.

field exception_if_vertex: Optional[str] = None (alias 'exceptionIfVertex')

Expects an exception for Vertex matching the string.

field has_union: Optional[bool] = None (alias 'hasUnion')

True if the parameters contain an unsupported union type. This test will be skipped for languages that do not support the union type.

field ignore_keys: Optional[list[str]] = None (alias 'ignoreKeys')

Keys to ignore when comparing the request and response. This is useful for tests that are not deterministic.

field name: Optional[str] = None

The name of the test. This is used to derive the replay id.

field override_replay_id: Optional[str] = None (alias 'overrideReplayId')

Use if you don’t want to use the default replay id which is derived from the test name.

field parameters: Optional[dict[str, Any]] = None

The parameters to the test. Use pydantic models.

field skip_in_api_mode: Optional[str] = None (alias 'skipInApiMode')

When set to a reason string, this test will be skipped in the API mode. Use this flag for tests that can not be reproduced with the real API. E.g. a test that deletes a resource.

class genai.types.TestTableItemDict

Bases: TypedDict

exception_if_mldev: Optional[str]

Expects an exception for MLDev matching the string.

exception_if_vertex: Optional[str]

Expects an exception for Vertex matching the string.

has_union: Optional[bool]

True if the parameters contain an unsupported union type. This test will be skipped for languages that do not support the union type.

ignore_keys: Optional[list[str]]

Keys to ignore when comparing the request and response. This is useful for tests that are not deterministic.

name: Optional[str]

The name of the test. This is used to derive the replay id.

override_replay_id: Optional[str]

Use if you don’t want to use the default replay id which is derived from the test name.

parameters: Optional[dict[str, Any]]

The parameters to the test. Use pydantic models.

skip_in_api_mode: Optional[str]

When set to a reason string, this test will be skipped in the API mode. Use this flag for tests that can not be reproduced with the real API. E.g. a test that deletes a resource.

pydantic model genai.types.ThinkingConfig

Bases: BaseModel

The thinking features configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ThinkingConfig",
   "description": "The thinking features configuration.",
   "type": "object",
   "properties": {
      "includeThoughts": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.\n      ",
         "title": "Includethoughts"
      },
      "thinkingBudget": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates the thinking budget in tokens.\n      ",
         "title": "Thinkingbudget"
      }
   },
   "additionalProperties": false
}

Fields:
field include_thoughts: Optional[bool] = None (alias 'includeThoughts')

Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.

field thinking_budget: Optional[int] = None (alias 'thinkingBudget')

Indicates the thinking budget in tokens.

class genai.types.ThinkingConfigDict

Bases: TypedDict

The thinking features configuration.

include_thoughts: Optional[bool]

Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.

thinking_budget: Optional[int]

Indicates the thinking budget in tokens.

pydantic model genai.types.TokensInfo

Bases: BaseModel

Tokens info with a list of tokens and the corresponding list of token ids.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TokensInfo",
   "description": "Tokens info with a list of tokens and the corresponding list of token ids.",
   "type": "object",
   "properties": {
      "role": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Optional fields for the role from the corresponding Content.",
         "title": "Role"
      },
      "tokenIds": {
         "anyOf": [
            {
               "items": {
                  "type": "integer"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of token ids from the input.",
         "title": "Tokenids"
      },
      "tokens": {
         "anyOf": [
            {
               "items": {
                  "format": "base64url",
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of tokens from the input.",
         "title": "Tokens"
      }
   },
   "additionalProperties": false
}

Fields:
field role: Optional[str] = None

Optional. Optional fields for the role from the corresponding Content.

field token_ids: Optional[list[int]] = None (alias 'tokenIds')

A list of token ids from the input.

field tokens: Optional[list[bytes]] = None

A list of tokens from the input.

class genai.types.TokensInfoDict

Bases: TypedDict

Tokens info with a list of tokens and the corresponding list of token ids.

role: Optional[str]

Optional. Optional fields for the role from the corresponding Content.

token_ids: Optional[list[int]]

A list of token ids from the input.

tokens: Optional[list[bytes]]

A list of tokens from the input.

pydantic model genai.types.Tool

Bases: BaseModel

Tool details of a tool that the model may use to generate a response.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Tool",
   "description": "Tool details of a tool that the model may use to generate a response.",
   "type": "object",
   "properties": {
      "functionDeclarations": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/FunctionDeclaration"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of function declarations that the tool supports.",
         "title": "Functiondeclarations"
      },
      "retrieval": {
         "anyOf": [
            {
               "$ref": "#/$defs/Retrieval"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."
      },
      "googleSearch": {
         "anyOf": [
            {
               "$ref": "#/$defs/GoogleSearch"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Google Search tool type. Specialized retrieval tool\n      that is powered by Google Search."
      },
      "googleSearchRetrieval": {
         "anyOf": [
            {
               "$ref": "#/$defs/GoogleSearchRetrieval"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."
      },
      "enterpriseWebSearch": {
         "anyOf": [
            {
               "$ref": "#/$defs/EnterpriseWebSearch"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Enterprise web search tool type. Specialized retrieval\n      tool that is powered by Vertex AI Search and Sec4 compliance."
      },
      "googleMaps": {
         "anyOf": [
            {
               "$ref": "#/$defs/GoogleMaps"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Google Maps tool type. Specialized retrieval tool\n      that is powered by Google Maps."
      },
      "urlContext": {
         "anyOf": [
            {
               "$ref": "#/$defs/UrlContext"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Tool to support URL context retrieval."
      },
      "codeExecution": {
         "anyOf": [
            {
               "$ref": "#/$defs/ToolCodeExecution"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services."
      }
   },
   "$defs": {
      "ApiKeyConfig": {
         "additionalProperties": false,
         "description": "Config for authentication with API key.",
         "properties": {
            "apiKeyString": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The API key to be used in the request directly.",
               "title": "Apikeystring"
            }
         },
         "title": "ApiKeyConfig",
         "type": "object"
      },
      "AuthConfig": {
         "additionalProperties": false,
         "description": "Auth configuration to run the extension.",
         "properties": {
            "apiKeyConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ApiKeyConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for API key auth."
            },
            "authType": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthType"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of auth scheme."
            },
            "googleServiceAccountConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigGoogleServiceAccountConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for Google Service Account auth."
            },
            "httpBasicAuthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigHttpBasicAuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for HTTP Basic auth."
            },
            "oauthConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOauthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user oauth."
            },
            "oidcConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfigOidcConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Config for user OIDC auth."
            }
         },
         "title": "AuthConfig",
         "type": "object"
      },
      "AuthConfigGoogleServiceAccountConfig": {
         "additionalProperties": false,
         "description": "Config for Google Service Account Authentication.",
         "properties": {
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigGoogleServiceAccountConfig",
         "type": "object"
      },
      "AuthConfigHttpBasicAuthConfig": {
         "additionalProperties": false,
         "description": "Config for HTTP Basic Authentication.",
         "properties": {
            "credentialSecret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.",
               "title": "Credentialsecret"
            }
         },
         "title": "AuthConfigHttpBasicAuthConfig",
         "type": "object"
      },
      "AuthConfigOauthConfig": {
         "additionalProperties": false,
         "description": "Config for user oauth.",
         "properties": {
            "accessToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Accesstoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOauthConfig",
         "type": "object"
      },
      "AuthConfigOidcConfig": {
         "additionalProperties": false,
         "description": "Config for user OIDC auth.",
         "properties": {
            "idToken": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.",
               "title": "Idtoken"
            },
            "serviceAccount": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).",
               "title": "Serviceaccount"
            }
         },
         "title": "AuthConfigOidcConfig",
         "type": "object"
      },
      "AuthType": {
         "description": "Type of auth scheme.",
         "enum": [
            "AUTH_TYPE_UNSPECIFIED",
            "NO_AUTH",
            "API_KEY_AUTH",
            "HTTP_BASIC_AUTH",
            "GOOGLE_SERVICE_ACCOUNT_AUTH",
            "OAUTH",
            "OIDC_AUTH"
         ],
         "title": "AuthType",
         "type": "string"
      },
      "Behavior": {
         "description": "Defines the function behavior. Defaults to `BLOCKING`.",
         "enum": [
            "UNSPECIFIED",
            "BLOCKING",
            "NON_BLOCKING"
         ],
         "title": "Behavior",
         "type": "string"
      },
      "DynamicRetrievalConfig": {
         "additionalProperties": false,
         "description": "Describes the options to customize dynamic retrieval.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The mode of the predictor to be used in dynamic retrieval."
            },
            "dynamicThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.",
               "title": "Dynamicthreshold"
            }
         },
         "title": "DynamicRetrievalConfig",
         "type": "object"
      },
      "DynamicRetrievalConfigMode": {
         "description": "Config for the dynamic retrieval config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "MODE_DYNAMIC"
         ],
         "title": "DynamicRetrievalConfigMode",
         "type": "string"
      },
      "EnterpriseWebSearch": {
         "additionalProperties": false,
         "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.",
         "properties": {},
         "title": "EnterpriseWebSearch",
         "type": "object"
      },
      "FunctionDeclaration": {
         "additionalProperties": false,
         "description": "Defines a function that the model can generate JSON inputs for.\n\nThe inputs are based on `OpenAPI 3.0 specifications\n<https://spec.openapis.org/oas/v3.0.3>`_.",
         "properties": {
            "behavior": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Behavior"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the function behavior."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.",
               "title": "Description"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.",
               "title": "Name"
            },
            "parameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1"
            },
            "response": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function."
            }
         },
         "title": "FunctionDeclaration",
         "type": "object"
      },
      "GoogleMaps": {
         "additionalProperties": false,
         "description": "Tool to support Google Maps in Model.",
         "properties": {
            "authConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Auth config for the Google Maps tool."
            }
         },
         "title": "GoogleMaps",
         "type": "object"
      },
      "GoogleSearch": {
         "additionalProperties": false,
         "description": "Tool to support Google Search in Model. Powered by Google.",
         "properties": {
            "timeRangeFilter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Interval"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Filter search results to a specific time range.\n      If customers set a start time, they must set an end time (and vice versa).\n      "
            }
         },
         "title": "GoogleSearch",
         "type": "object"
      },
      "GoogleSearchRetrieval": {
         "additionalProperties": false,
         "description": "Tool to retrieve public web data for grounding, powered by Google.",
         "properties": {
            "dynamicRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DynamicRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the dynamic retrieval configuration for the given source."
            }
         },
         "title": "GoogleSearchRetrieval",
         "type": "object"
      },
      "Interval": {
         "additionalProperties": false,
         "description": "Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).\n\nThe start time must be less than or equal to the end time.\nWhen the start equals the end time, the interval is an empty interval.\n(matches no time)\nWhen both start and end are unspecified, the interval matches any time.",
         "properties": {
            "startTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start time of the interval.",
               "title": "Starttime"
            },
            "endTime": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end time of the interval.",
               "title": "Endtime"
            }
         },
         "title": "Interval",
         "type": "object"
      },
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "Retrieval": {
         "additionalProperties": false,
         "description": "Defines a retrieval tool that model can call to access external knowledge.",
         "properties": {
            "disableAttribution": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. This option is no longer supported.",
               "title": "Disableattribution"
            },
            "vertexAiSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexAISearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex AI Search."
            },
            "vertexRagStore": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VertexRagStore"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService."
            }
         },
         "title": "Retrieval",
         "type": "object"
      },
      "Schema": {
         "additionalProperties": false,
         "description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
         "properties": {
            "anyOf": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The value should be validated against any (one or more) of the subschemas in the list.",
               "title": "Anyof"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Default value of the data.",
               "title": "Default"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The description of the data.",
               "title": "Description"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}",
               "title": "Enum"
            },
            "example": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Example of the object. Will only populated when the object is the root.",
               "title": "Example"
            },
            "format": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The format of the data. Supported formats: for NUMBER type: \"float\", \"double\" for INTEGER type: \"int32\", \"int64\" for STRING type: \"email\", \"byte\", etc",
               "title": "Format"
            },
            "items": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY."
            },
            "maxItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the elements for Type.ARRAY.",
               "title": "Maxitems"
            },
            "maxLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum length of the Type.STRING",
               "title": "Maxlength"
            },
            "maxProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum number of the properties for Type.OBJECT.",
               "title": "Maxproperties"
            },
            "maximum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Maximum value of the Type.INTEGER and Type.NUMBER",
               "title": "Maximum"
            },
            "minItems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the elements for Type.ARRAY.",
               "title": "Minitems"
            },
            "minLength": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING",
               "title": "Minlength"
            },
            "minProperties": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Minimum number of the properties for Type.OBJECT.",
               "title": "Minproperties"
            },
            "minimum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER",
               "title": "Minimum"
            },
            "nullable": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Indicates if the value may be null.",
               "title": "Nullable"
            },
            "pattern": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Pattern of the Type.STRING to restrict a string to a regular expression.",
               "title": "Pattern"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Schema"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.",
               "title": "Properties"
            },
            "propertyOrdering": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.",
               "title": "Propertyordering"
            },
            "required": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required properties of Type.OBJECT.",
               "title": "Required"
            },
            "title": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The title of the Schema.",
               "title": "Title"
            },
            "type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Type"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The type of the data."
            }
         },
         "title": "Schema",
         "type": "object"
      },
      "ToolCodeExecution": {
         "additionalProperties": false,
         "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
         "properties": {},
         "title": "ToolCodeExecution",
         "type": "object"
      },
      "Type": {
         "description": "Optional. The type of the data.",
         "enum": [
            "TYPE_UNSPECIFIED",
            "STRING",
            "NUMBER",
            "INTEGER",
            "BOOLEAN",
            "ARRAY",
            "OBJECT"
         ],
         "title": "Type",
         "type": "string"
      },
      "UrlContext": {
         "additionalProperties": false,
         "description": "Tool to support URL context retrieval.",
         "properties": {},
         "title": "UrlContext",
         "type": "object"
      },
      "VertexAISearch": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
         "properties": {
            "datastore": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
               "title": "Datastore"
            },
            "engine": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
               "title": "Engine"
            }
         },
         "title": "VertexAISearch",
         "type": "object"
      },
      "VertexRagStore": {
         "additionalProperties": false,
         "description": "Retrieve from Vertex RAG Store for grounding.",
         "properties": {
            "ragCorpora": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Deprecated. Please use rag_resources instead.",
               "title": "Ragcorpora"
            },
            "ragResources": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/VertexRagStoreRagResource"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
               "title": "Ragresources"
            },
            "ragRetrievalConfig": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The retrieval config for the Rag query."
            },
            "similarityTopK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of top k results to return from the selected corpora.",
               "title": "Similaritytopk"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only return results with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            }
         },
         "title": "VertexRagStore",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field code_execution: Optional[ToolCodeExecution] = None (alias 'codeExecution')

Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services.

Optional. Enterprise web search tool type. Specialized retrieval tool that is powered by Vertex AI Search and Sec4 compliance.

field function_declarations: Optional[list[FunctionDeclaration]] = None (alias 'functionDeclarations')

List of function declarations that the tool supports.

field google_maps: Optional[GoogleMaps] = None (alias 'googleMaps')

Optional. Google Maps tool type. Specialized retrieval tool that is powered by Google Maps.

Optional. Google Search tool type. Specialized retrieval tool that is powered by Google Search.

field google_search_retrieval: Optional[GoogleSearchRetrieval] = None (alias 'googleSearchRetrieval')

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

field retrieval: Optional[Retrieval] = None

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

field url_context: Optional[UrlContext] = None (alias 'urlContext')

Optional. Tool to support URL context retrieval.

pydantic model genai.types.ToolCodeExecution

Bases: BaseModel

Tool that executes code generated by the model, and automatically returns the result to the model.

See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ToolCodeExecution",
   "description": "Tool that executes code generated by the model, and automatically returns the result to the model.\n\nSee also [ExecutableCode]and [CodeExecutionResult] which are input and output\nto this tool.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.ToolCodeExecutionDict

Bases: TypedDict

Tool that executes code generated by the model, and automatically returns the result to the model.

See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool.

pydantic model genai.types.ToolConfig

Bases: BaseModel

Tool config.

This config is shared for all tools provided in the request.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "ToolConfig",
   "description": "Tool config.\n\nThis config is shared for all tools provided in the request.",
   "type": "object",
   "properties": {
      "functionCallingConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/FunctionCallingConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Function calling config."
      },
      "retrievalConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/RetrievalConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Retrieval config."
      }
   },
   "$defs": {
      "FunctionCallingConfig": {
         "additionalProperties": false,
         "description": "Function calling config.",
         "properties": {
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCallingConfigMode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function calling mode."
            },
            "allowedFunctionNames": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.",
               "title": "Allowedfunctionnames"
            }
         },
         "title": "FunctionCallingConfig",
         "type": "object"
      },
      "FunctionCallingConfigMode": {
         "description": "Config for the function calling config mode.",
         "enum": [
            "MODE_UNSPECIFIED",
            "AUTO",
            "ANY",
            "NONE"
         ],
         "title": "FunctionCallingConfigMode",
         "type": "string"
      },
      "LatLng": {
         "additionalProperties": false,
         "description": "An object that represents a latitude/longitude pair.\n\nThis is expressed as a pair of doubles to represent degrees latitude and\ndegrees longitude. Unless specified otherwise, this object must conform to the\n<a href=\"https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version\">\nWGS84 standard</a>. Values must be within normalized ranges.",
         "properties": {
            "latitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].",
               "title": "Latitude"
            },
            "longitude": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]",
               "title": "Longitude"
            }
         },
         "title": "LatLng",
         "type": "object"
      },
      "RetrievalConfig": {
         "additionalProperties": false,
         "description": "Retrieval config.",
         "properties": {
            "latLng": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LatLng"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The location of the user."
            }
         },
         "title": "RetrievalConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field function_calling_config: Optional[FunctionCallingConfig] = None (alias 'functionCallingConfig')

Optional. Function calling config.

field retrieval_config: Optional[RetrievalConfig] = None (alias 'retrievalConfig')

Optional. Retrieval config.

class genai.types.ToolConfigDict

Bases: TypedDict

Tool config.

This config is shared for all tools provided in the request.

function_calling_config: Optional[FunctionCallingConfigDict]

Optional. Function calling config.

retrieval_config: Optional[RetrievalConfigDict]

Optional. Retrieval config.

class genai.types.ToolDict

Bases: TypedDict

Tool details of a tool that the model may use to generate a response.

code_execution: Optional[ToolCodeExecutionDict]

Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services.

Optional. Enterprise web search tool type. Specialized retrieval tool that is powered by Vertex AI Search and Sec4 compliance.

function_declarations: Optional[list[FunctionDeclarationDict]]

List of function declarations that the tool supports.

google_maps: Optional[GoogleMapsDict]

Optional. Google Maps tool type. Specialized retrieval tool that is powered by Google Maps.

Optional. Google Search tool type. Specialized retrieval tool that is powered by Google Search.

google_search_retrieval: Optional[GoogleSearchRetrievalDict]

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

retrieval: Optional[RetrievalDict]

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

url_context: Optional[UrlContextDict]

Optional. Tool to support URL context retrieval.

class genai.types.TrafficType(*values)

Bases: CaseInSensitiveEnum

Output only.

Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota.

ON_DEMAND = 'ON_DEMAND'

Type for Pay-As-You-Go traffic.

PROVISIONED_THROUGHPUT = 'PROVISIONED_THROUGHPUT'

Type for Provisioned Throughput traffic.

TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'

Unspecified request traffic type.

pydantic model genai.types.Transcription

Bases: BaseModel

Audio transcription in Server Conent.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Transcription",
   "description": "Audio transcription in Server Conent.",
   "type": "object",
   "properties": {
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Transcription text.\n      ",
         "title": "Text"
      },
      "finished": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The bool indicates the end of the transcription.\n      ",
         "title": "Finished"
      }
   },
   "additionalProperties": false
}

Fields:
field finished: Optional[bool] = None

The bool indicates the end of the transcription.

field text: Optional[str] = None

Transcription text.

class genai.types.TranscriptionDict

Bases: TypedDict

Audio transcription in Server Conent.

finished: Optional[bool]

The bool indicates the end of the transcription.

text: Optional[str]

Transcription text.

pydantic model genai.types.TunedModel

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TunedModel",
   "type": "object",
   "properties": {
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.",
         "title": "Model"
      },
      "endpoint": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.",
         "title": "Endpoint"
      },
      "checkpoints": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/TunedModelCheckpoint"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The checkpoints associated with this TunedModel.\n      This field is only populated for tuning jobs that enable intermediate\n      checkpoints.",
         "title": "Checkpoints"
      }
   },
   "$defs": {
      "TunedModelCheckpoint": {
         "additionalProperties": false,
         "description": "TunedModelCheckpoint for the Tuned Model of a Tuning Job.",
         "properties": {
            "checkpointId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the checkpoint.\n      ",
               "title": "Checkpointid"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The epoch of the checkpoint.\n      ",
               "title": "Epoch"
            },
            "step": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The step of the checkpoint.\n      ",
               "title": "Step"
            },
            "endpoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Endpoint resource name that the checkpoint is deployed to.\n      Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.\n      ",
               "title": "Endpoint"
            }
         },
         "title": "TunedModelCheckpoint",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field checkpoints: Optional[list[TunedModelCheckpoint]] = None

The checkpoints associated with this TunedModel. This field is only populated for tuning jobs that enable intermediate checkpoints.

field endpoint: Optional[str] = None

Output only. A resource name of an Endpoint. Format: projects/{project}/locations/{location}/endpoints/{endpoint}.

field model: Optional[str] = None

Output only. The resource name of the TunedModel. Format: projects/{project}/locations/{location}/models/{model}.

pydantic model genai.types.TunedModelCheckpoint

Bases: BaseModel

TunedModelCheckpoint for the Tuned Model of a Tuning Job.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TunedModelCheckpoint",
   "description": "TunedModelCheckpoint for the Tuned Model of a Tuning Job.",
   "type": "object",
   "properties": {
      "checkpointId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The ID of the checkpoint.\n      ",
         "title": "Checkpointid"
      },
      "epoch": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The epoch of the checkpoint.\n      ",
         "title": "Epoch"
      },
      "step": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The step of the checkpoint.\n      ",
         "title": "Step"
      },
      "endpoint": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The Endpoint resource name that the checkpoint is deployed to.\n      Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.\n      ",
         "title": "Endpoint"
      }
   },
   "additionalProperties": false
}

Fields:
field checkpoint_id: Optional[str] = None (alias 'checkpointId')

The ID of the checkpoint.

field endpoint: Optional[str] = None

The Endpoint resource name that the checkpoint is deployed to. Format: projects/{project}/locations/{location}/endpoints/{endpoint}.

field epoch: Optional[int] = None

The epoch of the checkpoint.

field step: Optional[int] = None

The step of the checkpoint.

class genai.types.TunedModelCheckpointDict

Bases: TypedDict

TunedModelCheckpoint for the Tuned Model of a Tuning Job.

checkpoint_id: Optional[str]

The ID of the checkpoint.

endpoint: Optional[str]

The Endpoint resource name that the checkpoint is deployed to. Format: projects/{project}/locations/{location}/endpoints/{endpoint}.

epoch: Optional[int]

The epoch of the checkpoint.

step: Optional[int]

The step of the checkpoint.

class genai.types.TunedModelDict

Bases: TypedDict

checkpoints: Optional[list[TunedModelCheckpointDict]]

The checkpoints associated with this TunedModel. This field is only populated for tuning jobs that enable intermediate checkpoints.

endpoint: Optional[str]

projects/{project}/locations/{location}/endpoints/{endpoint}.

Type:

Output only. A resource name of an Endpoint. Format

model: Optional[str]

projects/{project}/locations/{location}/models/{model}.

Type:

Output only. The resource name of the TunedModel. Format

pydantic model genai.types.TunedModelInfo

Bases: BaseModel

A tuned machine learning model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TunedModelInfo",
   "description": "A tuned machine learning model.",
   "type": "object",
   "properties": {
      "baseModel": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "ID of the base model that you want to tune.",
         "title": "Basemodel"
      },
      "createTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Date and time when the base model was created.",
         "title": "Createtime"
      },
      "updateTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Date and time when the base model was last updated.",
         "title": "Updatetime"
      }
   },
   "additionalProperties": false
}

Fields:
field base_model: Optional[str] = None (alias 'baseModel')

ID of the base model that you want to tune.

field create_time: Optional[datetime] = None (alias 'createTime')

Date and time when the base model was created.

field update_time: Optional[datetime] = None (alias 'updateTime')

Date and time when the base model was last updated.

class genai.types.TunedModelInfoDict

Bases: TypedDict

A tuned machine learning model.

base_model: Optional[str]

ID of the base model that you want to tune.

create_time: Optional[datetime]

Date and time when the base model was created.

update_time: Optional[datetime]

Date and time when the base model was last updated.

pydantic model genai.types.TuningDataStats

Bases: BaseModel

The tuning data statistic values for TuningJob.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TuningDataStats",
   "description": "The tuning data statistic values for TuningJob.",
   "type": "object",
   "properties": {
      "distillationDataStats": {
         "anyOf": [
            {
               "$ref": "#/$defs/DistillationDataStats"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Statistics for distillation."
      },
      "supervisedTuningDataStats": {
         "anyOf": [
            {
               "$ref": "#/$defs/SupervisedTuningDataStats"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The SFT Tuning data stats."
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DatasetDistribution": {
         "additionalProperties": false,
         "description": "Distribution computed over a tuning dataset.",
         "properties": {
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/DatasetDistributionDistributionBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "DatasetDistribution",
         "type": "object"
      },
      "DatasetDistributionDistributionBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "DatasetDistributionDistributionBucket",
         "type": "object"
      },
      "DatasetStats": {
         "additionalProperties": false,
         "description": "Statistics computed over a tuning dataset.",
         "properties": {
            "totalBillableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable characters in the tuning dataset.",
               "title": "Totalbillablecharactercount"
            },
            "totalTuningCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning characters in the tuning dataset.",
               "title": "Totaltuningcharactercount"
            },
            "tuningDatasetExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of examples in the tuning dataset.",
               "title": "Tuningdatasetexamplecount"
            },
            "tuningStepCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning steps for this Tuning Job.",
               "title": "Tuningstepcount"
            },
            "userDatasetExamples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sample user messages in the training dataset uri.",
               "title": "Userdatasetexamples"
            },
            "userInputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user input tokens."
            },
            "userMessagePerExampleDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the messages per example."
            },
            "userOutputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user output tokens."
            }
         },
         "title": "DatasetStats",
         "type": "object"
      },
      "DistillationDataStats": {
         "additionalProperties": false,
         "description": "Statistics computed for datasets used for distillation.",
         "properties": {
            "trainingDatasetStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Statistics computed for the training dataset."
            }
         },
         "title": "DistillationDataStats",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "SupervisedTuningDataStats": {
         "additionalProperties": false,
         "description": "Tuning data statistics for Supervised Tuning.",
         "properties": {
            "totalBillableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable characters in the tuning dataset.",
               "title": "Totalbillablecharactercount"
            },
            "totalBillableTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable tokens in the tuning dataset.",
               "title": "Totalbillabletokencount"
            },
            "totalTruncatedExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The number of examples in the dataset that have been truncated by any amount.",
               "title": "Totaltruncatedexamplecount"
            },
            "totalTuningCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning characters in the tuning dataset.",
               "title": "Totaltuningcharactercount"
            },
            "truncatedExampleIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A partial sample of the indices (starting from 1) of the truncated examples.",
               "title": "Truncatedexampleindices"
            },
            "tuningDatasetExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of examples in the tuning dataset.",
               "title": "Tuningdatasetexamplecount"
            },
            "tuningStepCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning steps for this Tuning Job.",
               "title": "Tuningstepcount"
            },
            "userDatasetExamples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sample user messages in the training dataset uri.",
               "title": "Userdatasetexamples"
            },
            "userInputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user input tokens."
            },
            "userMessagePerExampleDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the messages per example."
            },
            "userOutputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user output tokens."
            }
         },
         "title": "SupervisedTuningDataStats",
         "type": "object"
      },
      "SupervisedTuningDatasetDistribution": {
         "additionalProperties": false,
         "description": "Dataset distribution for Supervised Tuning.",
         "properties": {
            "billableSum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values that are billable.",
               "title": "Billablesum"
            },
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SupervisedTuningDatasetDistributionDatasetBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "SupervisedTuningDatasetDistribution",
         "type": "object"
      },
      "SupervisedTuningDatasetDistributionDatasetBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "SupervisedTuningDatasetDistributionDatasetBucket",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field distillation_data_stats: Optional[DistillationDataStats] = None (alias 'distillationDataStats')

Output only. Statistics for distillation.

field supervised_tuning_data_stats: Optional[SupervisedTuningDataStats] = None (alias 'supervisedTuningDataStats')

The SFT Tuning data stats.

class genai.types.TuningDataStatsDict

Bases: TypedDict

The tuning data statistic values for TuningJob.

distillation_data_stats: Optional[DistillationDataStatsDict]

Output only. Statistics for distillation.

supervised_tuning_data_stats: Optional[SupervisedTuningDataStatsDict]

The SFT Tuning data stats.

pydantic model genai.types.TuningDataset

Bases: BaseModel

Supervised fine-tuning training dataset.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TuningDataset",
   "description": "Supervised fine-tuning training dataset.",
   "type": "object",
   "properties": {
      "gcsUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "GCS URI of the file containing training dataset in JSONL format.",
         "title": "Gcsuri"
      },
      "examples": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/TuningExample"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Inline examples with simple input/output text.",
         "title": "Examples"
      }
   },
   "$defs": {
      "TuningExample": {
         "additionalProperties": false,
         "properties": {
            "textInput": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Text model input.",
               "title": "Textinput"
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The expected model output.",
               "title": "Output"
            }
         },
         "title": "TuningExample",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field examples: Optional[list[TuningExample]] = None

Inline examples with simple input/output text.

field gcs_uri: Optional[str] = None (alias 'gcsUri')

GCS URI of the file containing training dataset in JSONL format.

class genai.types.TuningDatasetDict

Bases: TypedDict

Supervised fine-tuning training dataset.

examples: Optional[list[TuningExampleDict]]

Inline examples with simple input/output text.

gcs_uri: Optional[str]

GCS URI of the file containing training dataset in JSONL format.

pydantic model genai.types.TuningExample

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TuningExample",
   "type": "object",
   "properties": {
      "textInput": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Text model input.",
         "title": "Textinput"
      },
      "output": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The expected model output.",
         "title": "Output"
      }
   },
   "additionalProperties": false
}

Fields:
field output: Optional[str] = None

The expected model output.

field text_input: Optional[str] = None (alias 'textInput')

Text model input.

class genai.types.TuningExampleDict

Bases: TypedDict

output: Optional[str]

The expected model output.

text_input: Optional[str]

Text model input.

pydantic model genai.types.TuningJob

Bases: BaseModel

A tuning job.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TuningJob",
   "description": "A tuning job.",
   "type": "object",
   "properties": {
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`",
         "title": "Name"
      },
      "state": {
         "anyOf": [
            {
               "$ref": "#/$defs/JobState"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The detailed state of the job."
      },
      "createTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the TuningJob was created.",
         "title": "Createtime"
      },
      "startTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.",
         "title": "Starttime"
      },
      "endTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.",
         "title": "Endtime"
      },
      "updateTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Time when the TuningJob was most recently updated.",
         "title": "Updatetime"
      },
      "error": {
         "anyOf": [
            {
               "$ref": "#/$defs/GoogleRpcStatus"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`."
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The description of the TuningJob.",
         "title": "Description"
      },
      "baseModel": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The base model that is being tuned, e.g., \"gemini-1.0-pro-002\". .",
         "title": "Basemodel"
      },
      "tunedModel": {
         "anyOf": [
            {
               "$ref": "#/$defs/TunedModel"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The tuned model resources associated with this TuningJob."
      },
      "supervisedTuningSpec": {
         "anyOf": [
            {
               "$ref": "#/$defs/SupervisedTuningSpec"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Tuning Spec for Supervised Fine Tuning."
      },
      "tuningDataStats": {
         "anyOf": [
            {
               "$ref": "#/$defs/TuningDataStats"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The tuning data statistics associated with this TuningJob."
      },
      "encryptionSpec": {
         "anyOf": [
            {
               "$ref": "#/$defs/EncryptionSpec"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key."
      },
      "partnerModelTuningSpec": {
         "anyOf": [
            {
               "$ref": "#/$defs/PartnerModelTuningSpec"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Tuning Spec for open sourced and third party Partner models."
      },
      "distillationSpec": {
         "anyOf": [
            {
               "$ref": "#/$defs/DistillationSpec"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Tuning Spec for Distillation."
      },
      "experiment": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The Experiment associated with this TuningJob.",
         "title": "Experiment"
      },
      "labels": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.",
         "title": "Labels"
      },
      "pipelineJob": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.",
         "title": "Pipelinejob"
      },
      "tunedModelDisplayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.",
         "title": "Tunedmodeldisplayname"
      }
   },
   "$defs": {
      "AdapterSize": {
         "description": "Optional. Adapter size for tuning.",
         "enum": [
            "ADAPTER_SIZE_UNSPECIFIED",
            "ADAPTER_SIZE_ONE",
            "ADAPTER_SIZE_TWO",
            "ADAPTER_SIZE_FOUR",
            "ADAPTER_SIZE_EIGHT",
            "ADAPTER_SIZE_SIXTEEN",
            "ADAPTER_SIZE_THIRTY_TWO"
         ],
         "title": "AdapterSize",
         "type": "string"
      },
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "Content": {
         "additionalProperties": false,
         "description": "Contains the multi-part content of a message.",
         "properties": {
            "parts": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Part"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of parts that constitute a single message. Each part may have\n      a different IANA MIME type.",
               "title": "Parts"
            },
            "role": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The producer of the content. Must be either 'user' or\n      'model'. Useful to set for multi-turn conversations, otherwise can be\n      empty. If role is not specified, SDK will determine the role.",
               "title": "Role"
            }
         },
         "title": "Content",
         "type": "object"
      },
      "DatasetDistribution": {
         "additionalProperties": false,
         "description": "Distribution computed over a tuning dataset.",
         "properties": {
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/DatasetDistributionDistributionBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "DatasetDistribution",
         "type": "object"
      },
      "DatasetDistributionDistributionBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "DatasetDistributionDistributionBucket",
         "type": "object"
      },
      "DatasetStats": {
         "additionalProperties": false,
         "description": "Statistics computed over a tuning dataset.",
         "properties": {
            "totalBillableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable characters in the tuning dataset.",
               "title": "Totalbillablecharactercount"
            },
            "totalTuningCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning characters in the tuning dataset.",
               "title": "Totaltuningcharactercount"
            },
            "tuningDatasetExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of examples in the tuning dataset.",
               "title": "Tuningdatasetexamplecount"
            },
            "tuningStepCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning steps for this Tuning Job.",
               "title": "Tuningstepcount"
            },
            "userDatasetExamples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sample user messages in the training dataset uri.",
               "title": "Userdatasetexamples"
            },
            "userInputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user input tokens."
            },
            "userMessagePerExampleDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the messages per example."
            },
            "userOutputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user output tokens."
            }
         },
         "title": "DatasetStats",
         "type": "object"
      },
      "DistillationDataStats": {
         "additionalProperties": false,
         "description": "Statistics computed for datasets used for distillation.",
         "properties": {
            "trainingDatasetStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Statistics computed for the training dataset."
            }
         },
         "title": "DistillationDataStats",
         "type": "object"
      },
      "DistillationHyperParameters": {
         "additionalProperties": false,
         "description": "Hyperparameters for Distillation.",
         "properties": {
            "adapterSize": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AdapterSize"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Adapter size for distillation."
            },
            "epochCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
               "title": "Epochcount"
            },
            "learningRateMultiplier": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Multiplier for adjusting the default learning rate.",
               "title": "Learningratemultiplier"
            }
         },
         "title": "DistillationHyperParameters",
         "type": "object"
      },
      "DistillationSpec": {
         "additionalProperties": false,
         "description": "Tuning Spec for Distillation.",
         "properties": {
            "baseTeacherModel": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base teacher model that is being distilled, e.g., \"gemini-1.0-pro-002\".",
               "title": "Baseteachermodel"
            },
            "hyperParameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DistillationHyperParameters"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Hyperparameters for Distillation."
            },
            "pipelineRootDirectory": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts.",
               "title": "Pipelinerootdirectory"
            },
            "studentModel": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The student model that is being tuned, e.g., \"google/gemma-2b-1.1-it\".",
               "title": "Studentmodel"
            },
            "trainingDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Trainingdataseturi"
            },
            "tunedTeacherModelSource": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`.",
               "title": "Tunedteachermodelsource"
            },
            "validationDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Validationdataseturi"
            }
         },
         "title": "DistillationSpec",
         "type": "object"
      },
      "EncryptionSpec": {
         "additionalProperties": false,
         "description": "Represents a customer-managed encryption key spec that can be applied to a top-level resource.",
         "properties": {
            "kmsKeyName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.",
               "title": "Kmskeyname"
            }
         },
         "title": "EncryptionSpec",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "GoogleRpcStatus": {
         "additionalProperties": false,
         "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs.\n\nIt is used by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details. You can\nfind out more about this error model and how to work with it in the [API\nDesign Guide](https://cloud.google.com/apis/design/errors).",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The status code, which should be an enum value of google.rpc.Code.",
               "title": "Code"
            },
            "details": {
               "anyOf": [
                  {
                     "items": {
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
               "title": "Details"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
               "title": "Message"
            }
         },
         "title": "GoogleRpcStatus",
         "type": "object"
      },
      "JobState": {
         "description": "Job state.",
         "enum": [
            "JOB_STATE_UNSPECIFIED",
            "JOB_STATE_QUEUED",
            "JOB_STATE_PENDING",
            "JOB_STATE_RUNNING",
            "JOB_STATE_SUCCEEDED",
            "JOB_STATE_FAILED",
            "JOB_STATE_CANCELLING",
            "JOB_STATE_CANCELLED",
            "JOB_STATE_PAUSED",
            "JOB_STATE_EXPIRED",
            "JOB_STATE_UPDATING",
            "JOB_STATE_PARTIALLY_SUCCEEDED"
         ],
         "title": "JobState",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "PartnerModelTuningSpec": {
         "additionalProperties": false,
         "description": "Tuning spec for Partner models.",
         "properties": {
            "hyperParameters": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model.",
               "title": "Hyperparameters"
            },
            "trainingDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Trainingdataseturi"
            },
            "validationDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Validationdataseturi"
            }
         },
         "title": "PartnerModelTuningSpec",
         "type": "object"
      },
      "SupervisedHyperParameters": {
         "additionalProperties": false,
         "description": "Hyperparameters for SFT.",
         "properties": {
            "adapterSize": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AdapterSize"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Adapter size for tuning."
            },
            "epochCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.",
               "title": "Epochcount"
            },
            "learningRateMultiplier": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Multiplier for adjusting the default learning rate.",
               "title": "Learningratemultiplier"
            }
         },
         "title": "SupervisedHyperParameters",
         "type": "object"
      },
      "SupervisedTuningDataStats": {
         "additionalProperties": false,
         "description": "Tuning data statistics for Supervised Tuning.",
         "properties": {
            "totalBillableCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable characters in the tuning dataset.",
               "title": "Totalbillablecharactercount"
            },
            "totalBillableTokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of billable tokens in the tuning dataset.",
               "title": "Totalbillabletokencount"
            },
            "totalTruncatedExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The number of examples in the dataset that have been truncated by any amount.",
               "title": "Totaltruncatedexamplecount"
            },
            "totalTuningCharacterCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning characters in the tuning dataset.",
               "title": "Totaltuningcharactercount"
            },
            "truncatedExampleIndices": {
               "anyOf": [
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A partial sample of the indices (starting from 1) of the truncated examples.",
               "title": "Truncatedexampleindices"
            },
            "tuningDatasetExampleCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of examples in the tuning dataset.",
               "title": "Tuningdatasetexamplecount"
            },
            "tuningStepCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of tuning steps for this Tuning Job.",
               "title": "Tuningstepcount"
            },
            "userDatasetExamples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sample user messages in the training dataset uri.",
               "title": "Userdatasetexamples"
            },
            "userInputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user input tokens."
            },
            "userMessagePerExampleDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the messages per example."
            },
            "userOutputTokenDistribution": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDatasetDistribution"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Dataset distributions for the user output tokens."
            }
         },
         "title": "SupervisedTuningDataStats",
         "type": "object"
      },
      "SupervisedTuningDatasetDistribution": {
         "additionalProperties": false,
         "description": "Dataset distribution for Supervised Tuning.",
         "properties": {
            "billableSum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values that are billable.",
               "title": "Billablesum"
            },
            "buckets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/SupervisedTuningDatasetDistributionDatasetBucket"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Defines the histogram bucket.",
               "title": "Buckets"
            },
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The maximum of the population values.",
               "title": "Max"
            },
            "mean": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The arithmetic mean of the values in the population.",
               "title": "Mean"
            },
            "median": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The median of the values in the population.",
               "title": "Median"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The minimum of the population values.",
               "title": "Min"
            },
            "p5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 5th percentile of the values in the population.",
               "title": "P5"
            },
            "p95": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The 95th percentile of the values in the population.",
               "title": "P95"
            },
            "sum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Sum of a given population of values.",
               "title": "Sum"
            }
         },
         "title": "SupervisedTuningDatasetDistribution",
         "type": "object"
      },
      "SupervisedTuningDatasetDistributionDatasetBucket": {
         "additionalProperties": false,
         "description": "Dataset bucket used to create a histogram for the distribution given a population of values.",
         "properties": {
            "count": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Number of values in the bucket.",
               "title": "Count"
            },
            "left": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Left bound of the bucket.",
               "title": "Left"
            },
            "right": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Right bound of the bucket.",
               "title": "Right"
            }
         },
         "title": "SupervisedTuningDatasetDistributionDatasetBucket",
         "type": "object"
      },
      "SupervisedTuningSpec": {
         "additionalProperties": false,
         "description": "Tuning Spec for Supervised Tuning for first party models.",
         "properties": {
            "hyperParameters": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedHyperParameters"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Hyperparameters for SFT."
            },
            "trainingDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Trainingdataseturi"
            },
            "validationDatasetUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.",
               "title": "Validationdataseturi"
            },
            "exportLastCheckpointOnly": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported.",
               "title": "Exportlastcheckpointonly"
            }
         },
         "title": "SupervisedTuningSpec",
         "type": "object"
      },
      "TunedModel": {
         "additionalProperties": false,
         "properties": {
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.",
               "title": "Model"
            },
            "endpoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.",
               "title": "Endpoint"
            },
            "checkpoints": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/TunedModelCheckpoint"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The checkpoints associated with this TunedModel.\n      This field is only populated for tuning jobs that enable intermediate\n      checkpoints.",
               "title": "Checkpoints"
            }
         },
         "title": "TunedModel",
         "type": "object"
      },
      "TunedModelCheckpoint": {
         "additionalProperties": false,
         "description": "TunedModelCheckpoint for the Tuned Model of a Tuning Job.",
         "properties": {
            "checkpointId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The ID of the checkpoint.\n      ",
               "title": "Checkpointid"
            },
            "epoch": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The epoch of the checkpoint.\n      ",
               "title": "Epoch"
            },
            "step": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The step of the checkpoint.\n      ",
               "title": "Step"
            },
            "endpoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Endpoint resource name that the checkpoint is deployed to.\n      Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.\n      ",
               "title": "Endpoint"
            }
         },
         "title": "TunedModelCheckpoint",
         "type": "object"
      },
      "TuningDataStats": {
         "additionalProperties": false,
         "description": "The tuning data statistic values for TuningJob.",
         "properties": {
            "distillationDataStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DistillationDataStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output only. Statistics for distillation."
            },
            "supervisedTuningDataStats": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SupervisedTuningDataStats"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The SFT Tuning data stats."
            }
         },
         "title": "TuningDataStats",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field base_model: Optional[str] = None (alias 'baseModel')

The base model that is being tuned, e.g., “gemini-1.0-pro-002”. .

field create_time: Optional[datetime] = None (alias 'createTime')

Output only. Time when the TuningJob was created.

field description: Optional[str] = None

Optional. The description of the TuningJob.

field distillation_spec: Optional[DistillationSpec] = None (alias 'distillationSpec')

Tuning Spec for Distillation.

field encryption_spec: Optional[EncryptionSpec] = None (alias 'encryptionSpec')

Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.

field end_time: Optional[datetime] = None (alias 'endTime')

Output only. Time when the TuningJob entered any of the following JobStates: JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED, JOB_STATE_EXPIRED.

field error: Optional[GoogleRpcStatus] = None

Output only. Only populated when job’s state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.

field experiment: Optional[str] = None

Output only. The Experiment associated with this TuningJob.

field labels: Optional[dict[str, str]] = None

Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.

field name: Optional[str] = None

Output only. Identifier. Resource name of a TuningJob. Format: projects/{project}/locations/{location}/tuningJobs/{tuning_job}

field partner_model_tuning_spec: Optional[PartnerModelTuningSpec] = None (alias 'partnerModelTuningSpec')

Tuning Spec for open sourced and third party Partner models.

field pipeline_job: Optional[str] = None (alias 'pipelineJob')

Output only. The resource name of the PipelineJob associated with the TuningJob. Format: projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}.

field start_time: Optional[datetime] = None (alias 'startTime')

Output only. Time when the TuningJob for the first time entered the JOB_STATE_RUNNING state.

field state: Optional[JobState] = None

Output only. The detailed state of the job.

field supervised_tuning_spec: Optional[SupervisedTuningSpec] = None (alias 'supervisedTuningSpec')

Tuning Spec for Supervised Fine Tuning.

field tuned_model: Optional[TunedModel] = None (alias 'tunedModel')

Output only. The tuned model resources associated with this TuningJob.

field tuned_model_display_name: Optional[str] = None (alias 'tunedModelDisplayName')

Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.

field tuning_data_stats: Optional[TuningDataStats] = None (alias 'tuningDataStats')

Output only. The tuning data statistics associated with this TuningJob.

field update_time: Optional[datetime] = None (alias 'updateTime')

Output only. Time when the TuningJob was most recently updated.

property has_ended: bool

Whether the tuning job has ended.

property has_succeeded: bool

Whether the tuning job has succeeded.

class genai.types.TuningJobDict

Bases: TypedDict

A tuning job.

base_model: Optional[str]

The base model that is being tuned, e.g., “gemini-1.0-pro-002”. .

create_time: Optional[datetime]

Output only. Time when the TuningJob was created.

description: Optional[str]

Optional. The description of the TuningJob.

distillation_spec: Optional[DistillationSpecDict]

Tuning Spec for Distillation.

encryption_spec: Optional[EncryptionSpecDict]

Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.

end_time: Optional[datetime]

JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED, JOB_STATE_EXPIRED.

Type:

Output only. Time when the TuningJob entered any of the following JobStates

error: Optional[GoogleRpcStatusDict]

Output only. Only populated when job’s state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.

experiment: Optional[str]

Output only. The Experiment associated with this TuningJob.

labels: Optional[dict[str, str]]

//goo.gl/xmQnxf for more information and examples of labels.

Type:

Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https

name: Optional[str]

projects/{project}/locations/{location}/tuningJobs/{tuning_job}

Type:

Output only. Identifier. Resource name of a TuningJob. Format

partner_model_tuning_spec: Optional[PartnerModelTuningSpecDict]

Tuning Spec for open sourced and third party Partner models.

pipeline_job: Optional[str]

projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}.

Type:

Output only. The resource name of the PipelineJob associated with the TuningJob. Format

start_time: Optional[datetime]

Output only. Time when the TuningJob for the first time entered the JOB_STATE_RUNNING state.

state: Optional[JobState]

Output only. The detailed state of the job.

supervised_tuning_spec: Optional[SupervisedTuningSpecDict]

Tuning Spec for Supervised Fine Tuning.

tuned_model: Optional[TunedModelDict]

Output only. The tuned model resources associated with this TuningJob.

tuned_model_display_name: Optional[str]

Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.

tuning_data_stats: Optional[TuningDataStatsDict]

Output only. The tuning data statistics associated with this TuningJob.

update_time: Optional[datetime]

Output only. Time when the TuningJob was most recently updated.

pydantic model genai.types.TuningValidationDataset

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "TuningValidationDataset",
   "type": "object",
   "properties": {
      "gcsUri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "GCS URI of the file containing validation dataset in JSONL format.",
         "title": "Gcsuri"
      }
   },
   "additionalProperties": false
}

Fields:
field gcs_uri: Optional[str] = None (alias 'gcsUri')

GCS URI of the file containing validation dataset in JSONL format.

class genai.types.TuningValidationDatasetDict

Bases: TypedDict

gcs_uri: Optional[str]

GCS URI of the file containing validation dataset in JSONL format.

class genai.types.TurnCoverage(*values)

Bases: CaseInSensitiveEnum

Options about which input is included in the user’s turn.

TURN_COVERAGE_UNSPECIFIED = 'TURN_COVERAGE_UNSPECIFIED'

If unspecified, the default behavior is TURN_INCLUDES_ONLY_ACTIVITY.

TURN_INCLUDES_ALL_INPUT = 'TURN_INCLUDES_ALL_INPUT'

The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).

TURN_INCLUDES_ONLY_ACTIVITY = 'TURN_INCLUDES_ONLY_ACTIVITY'

The users turn only includes activity since the last turn, excluding inactivity (e.g. silence on the audio stream). This is the default behavior.

class genai.types.Type(*values)

Bases: CaseInSensitiveEnum

Optional. The type of the data.

ARRAY = 'ARRAY'

OpenAPI array type

BOOLEAN = 'BOOLEAN'

OpenAPI boolean type

INTEGER = 'INTEGER'

OpenAPI integer type

NUMBER = 'NUMBER'

OpenAPI number type

OBJECT = 'OBJECT'

OpenAPI object type

STRING = 'STRING'

OpenAPI string type

TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED'

Not specified, should not be used.

pydantic model genai.types.UpdateCachedContentConfig

Bases: BaseModel

Optional parameters for caches.update method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UpdateCachedContentConfig",
   "description": "Optional parameters for caches.update method.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "ttl": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: \"3.5s\".",
         "title": "Ttl"
      },
      "expireTime": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.",
         "title": "Expiretime"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field expire_time: Optional[datetime] = None (alias 'expireTime')

Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field ttl: Optional[str] = None

The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by ‘s’. Example: “3.5s”.

class genai.types.UpdateCachedContentConfigDict

Bases: TypedDict

Optional parameters for caches.update method.

expire_time: Optional[datetime]

01:23Z.

Type:

Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example

Type:

2014-10-02T15

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

ttl: Optional[str]

“3.5s”.

Type:

The TTL for this resource. The expiration time is computed

Type:

now + TTL. It is a duration string, with up to nine fractional digits, terminated by ‘s’. Example

pydantic model genai.types.UpdateModelConfig

Bases: BaseModel

Configuration for updating a tuned model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UpdateModelConfig",
   "description": "Configuration for updating a tuned model.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Displayname"
      },
      "description": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Description"
      },
      "defaultCheckpointId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "",
         "title": "Defaultcheckpointid"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field default_checkpoint_id: Optional[str] = None (alias 'defaultCheckpointId')
field description: Optional[str] = None
field display_name: Optional[str] = None (alias 'displayName')
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

class genai.types.UpdateModelConfigDict

Bases: TypedDict

Configuration for updating a tuned model.

default_checkpoint_id: Optional[str]
description: Optional[str]
display_name: Optional[str]
http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

pydantic model genai.types.UploadFileConfig

Bases: BaseModel

Used to override the default configuration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UploadFileConfig",
   "description": "Used to override the default configuration.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The name of the file in the destination (e.g., 'files/sample-image'. If not provided one will be generated.",
         "title": "Name"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "mime_type: The MIME type of the file. If not provided, it will be inferred from the file extension.",
         "title": "Mimetype"
      },
      "displayName": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional display name of the file.",
         "title": "Displayname"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field display_name: Optional[str] = None (alias 'displayName')

Optional display name of the file.

field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field mime_type: Optional[str] = None (alias 'mimeType')

mime_type: The MIME type of the file. If not provided, it will be inferred from the file extension.

field name: Optional[str] = None

The name of the file in the destination (e.g., ‘files/sample-image’. If not provided one will be generated.

class genai.types.UploadFileConfigDict

Bases: TypedDict

Used to override the default configuration.

display_name: Optional[str]

Optional display name of the file.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

mime_type: Optional[str]

The MIME type of the file. If not provided, it will be inferred from the file extension.

Type:

mime_type

name: Optional[str]

The name of the file in the destination (e.g., ‘files/sample-image’. If not provided one will be generated.

pydantic model genai.types.UpscaleImageConfig

Bases: BaseModel

Configuration for upscaling an image.

For more information on this configuration, refer to the Imagen API reference documentation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UpscaleImageConfig",
   "description": "Configuration for upscaling an image.\n\nFor more information on this configuration, refer to\nthe `Imagen API reference documentation\n<https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api>`_.",
   "type": "object",
   "properties": {
      "httpOptions": {
         "anyOf": [
            {
               "$ref": "#/$defs/HttpOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Used to override HTTP request options."
      },
      "includeRaiReason": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Whether to include a reason for filtered-out images in the\n      response.",
         "title": "Includeraireason"
      },
      "outputMimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The image format that the output should be saved as.",
         "title": "Outputmimetype"
      },
      "outputCompressionQuality": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The level of compression if the ``output_mime_type`` is\n      ``image/jpeg``.",
         "title": "Outputcompressionquality"
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field http_options: Optional[HttpOptions] = None (alias 'httpOptions')

Used to override HTTP request options.

field include_rai_reason: Optional[bool] = None (alias 'includeRaiReason')

Whether to include a reason for filtered-out images in the response.

field output_compression_quality: Optional[int] = None (alias 'outputCompressionQuality')

The level of compression if the output_mime_type is image/jpeg.

field output_mime_type: Optional[str] = None (alias 'outputMimeType')

The image format that the output should be saved as.

class genai.types.UpscaleImageConfigDict

Bases: TypedDict

Configuration for upscaling an image.

For more information on this configuration, refer to the Imagen API reference documentation.

http_options: Optional[HttpOptionsDict]

Used to override HTTP request options.

include_rai_reason: Optional[bool]

Whether to include a reason for filtered-out images in the response.

output_compression_quality: Optional[int]

The level of compression if the output_mime_type is image/jpeg.

output_mime_type: Optional[str]

The image format that the output should be saved as.

pydantic model genai.types.UpscaleImageParameters

Bases: BaseModel

User-facing config UpscaleImageParameters.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UpscaleImageParameters",
   "description": "User-facing config UpscaleImageParameters.",
   "type": "object",
   "properties": {
      "model": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The model to use.",
         "title": "Model"
      },
      "image": {
         "anyOf": [
            {
               "$ref": "#/$defs/Image"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The input image to upscale."
      },
      "upscaleFactor": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The factor to upscale the image (x2 or x4).",
         "title": "Upscalefactor"
      },
      "config": {
         "anyOf": [
            {
               "$ref": "#/$defs/UpscaleImageConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Configuration for upscaling."
      }
   },
   "$defs": {
      "HttpOptions": {
         "additionalProperties": false,
         "description": "HTTP options to be used in each of the requests.",
         "properties": {
            "baseUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The base URL for the AI platform service endpoint.",
               "title": "Baseurl"
            },
            "apiVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies the version of the API to use.",
               "title": "Apiversion"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Additional HTTP headers to be sent with the request.",
               "title": "Headers"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Timeout for the request in milliseconds.",
               "title": "Timeout"
            },
            "clientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the HTTP client.",
               "title": "Clientargs"
            },
            "asyncClientArgs": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Args passed to the async HTTP client.",
               "title": "Asyncclientargs"
            }
         },
         "title": "HttpOptions",
         "type": "object"
      },
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "UpscaleImageConfig": {
         "additionalProperties": false,
         "description": "Configuration for upscaling an image.\n\nFor more information on this configuration, refer to\nthe `Imagen API reference documentation\n<https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api>`_.",
         "properties": {
            "httpOptions": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HttpOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Used to override HTTP request options."
            },
            "includeRaiReason": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Whether to include a reason for filtered-out images in the\n      response.",
               "title": "Includeraireason"
            },
            "outputMimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image format that the output should be saved as.",
               "title": "Outputmimetype"
            },
            "outputCompressionQuality": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The level of compression if the ``output_mime_type`` is\n      ``image/jpeg``.",
               "title": "Outputcompressionquality"
            }
         },
         "title": "UpscaleImageConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field config: Optional[UpscaleImageConfig] = None

Configuration for upscaling.

field image: Optional[Image] = None

The input image to upscale.

field model: Optional[str] = None

The model to use.

field upscale_factor: Optional[str] = None (alias 'upscaleFactor')

The factor to upscale the image (x2 or x4).

class genai.types.UpscaleImageParametersDict

Bases: TypedDict

User-facing config UpscaleImageParameters.

config: Optional[UpscaleImageConfigDict]

Configuration for upscaling.

image: Optional[ImageDict]

The input image to upscale.

model: Optional[str]

The model to use.

upscale_factor: Optional[str]

The factor to upscale the image (x2 or x4).

pydantic model genai.types.UpscaleImageResponse

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UpscaleImageResponse",
   "type": "object",
   "properties": {
      "generatedImages": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/GeneratedImage"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Generated images.",
         "title": "Generatedimages"
      }
   },
   "$defs": {
      "GeneratedImage": {
         "additionalProperties": false,
         "description": "An output image.",
         "properties": {
            "image": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Image"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The output image data.\n      "
            },
            "raiFilteredReason": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Responsible AI filter reason if the image is filtered out of the\n      response.\n      ",
               "title": "Raifilteredreason"
            },
            "safetyAttributes": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SafetyAttributes"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Safety attributes of the image. Lists of RAI categories and their\n      scores of each content.\n      "
            },
            "enhancedPrompt": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The rewritten prompt used for the image generation if the prompt\n      enhancer is enabled.\n      ",
               "title": "Enhancedprompt"
            }
         },
         "title": "GeneratedImage",
         "type": "object"
      },
      "Image": {
         "additionalProperties": false,
         "description": "An image.",
         "properties": {
            "gcsUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The Cloud Storage URI of the image. ``Image`` can contain a value\n      for this field or the ``image_bytes`` field but not both.\n      ",
               "title": "Gcsuri"
            },
            "imageBytes": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The image bytes data. ``Image`` can contain a value for this field\n      or the ``gcs_uri`` field but not both.\n      ",
               "title": "Imagebytes"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MIME type of the image.",
               "title": "Mimetype"
            }
         },
         "title": "Image",
         "type": "object"
      },
      "SafetyAttributes": {
         "additionalProperties": false,
         "description": "Safety attributes of a GeneratedImage or the user-provided prompt.",
         "properties": {
            "categories": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of RAI categories.\n      ",
               "title": "Categories"
            },
            "scores": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "List of scores of each categories.\n      ",
               "title": "Scores"
            },
            "contentType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Internal use only.\n      ",
               "title": "Contenttype"
            }
         },
         "title": "SafetyAttributes",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field generated_images: Optional[list[GeneratedImage]] = None (alias 'generatedImages')

Generated images.

class genai.types.UpscaleImageResponseDict

Bases: TypedDict

generated_images: Optional[list[GeneratedImageDict]]

Generated images.

pydantic model genai.types.UrlContext

Bases: BaseModel

Tool to support URL context retrieval.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UrlContext",
   "description": "Tool to support URL context retrieval.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

class genai.types.UrlContextDict

Bases: TypedDict

Tool to support URL context retrieval.

pydantic model genai.types.UrlContextMetadata

Bases: BaseModel

Metadata related to url context retrieval tool.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UrlContextMetadata",
   "description": "Metadata related to url context retrieval tool.",
   "type": "object",
   "properties": {
      "urlMetadata": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/UrlMetadata"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of url context.",
         "title": "Urlmetadata"
      }
   },
   "$defs": {
      "UrlMetadata": {
         "additionalProperties": false,
         "description": "Context for a single url retrieval.",
         "properties": {
            "retrievedUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URL retrieved by the tool.",
               "title": "Retrievedurl"
            },
            "urlRetrievalStatus": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/UrlRetrievalStatus"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Status of the url retrieval."
            }
         },
         "title": "UrlMetadata",
         "type": "object"
      },
      "UrlRetrievalStatus": {
         "description": "Status of the url retrieval.",
         "enum": [
            "URL_RETRIEVAL_STATUS_UNSPECIFIED",
            "URL_RETRIEVAL_STATUS_SUCCESS",
            "URL_RETRIEVAL_STATUS_ERROR"
         ],
         "title": "UrlRetrievalStatus",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field url_metadata: Optional[list[UrlMetadata]] = None (alias 'urlMetadata')

List of url context.

class genai.types.UrlContextMetadataDict

Bases: TypedDict

Metadata related to url context retrieval tool.

url_metadata: Optional[list[UrlMetadataDict]]

List of url context.

pydantic model genai.types.UrlMetadata

Bases: BaseModel

Context for a single url retrieval.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UrlMetadata",
   "description": "Context for a single url retrieval.",
   "type": "object",
   "properties": {
      "retrievedUrl": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The URL retrieved by the tool.",
         "title": "Retrievedurl"
      },
      "urlRetrievalStatus": {
         "anyOf": [
            {
               "$ref": "#/$defs/UrlRetrievalStatus"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Status of the url retrieval."
      }
   },
   "$defs": {
      "UrlRetrievalStatus": {
         "description": "Status of the url retrieval.",
         "enum": [
            "URL_RETRIEVAL_STATUS_UNSPECIFIED",
            "URL_RETRIEVAL_STATUS_SUCCESS",
            "URL_RETRIEVAL_STATUS_ERROR"
         ],
         "title": "UrlRetrievalStatus",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field retrieved_url: Optional[str] = None (alias 'retrievedUrl')

The URL retrieved by the tool.

field url_retrieval_status: Optional[UrlRetrievalStatus] = None (alias 'urlRetrievalStatus')

Status of the url retrieval.

class genai.types.UrlMetadataDict

Bases: TypedDict

Context for a single url retrieval.

retrieved_url: Optional[str]

The URL retrieved by the tool.

url_retrieval_status: Optional[UrlRetrievalStatus]

Status of the url retrieval.

class genai.types.UrlRetrievalStatus(*values)

Bases: CaseInSensitiveEnum

Status of the url retrieval.

URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'

Url retrieval is failed due to error.

URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'

Url retrieval is successful.

URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'

Default value. This value is unused

pydantic model genai.types.UsageMetadata

Bases: BaseModel

Usage metadata about response(s).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UsageMetadata",
   "description": "Usage metadata about response(s).",
   "type": "object",
   "properties": {
      "promptTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.",
         "title": "Prompttokencount"
      },
      "cachedContentTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens in the cached part of the prompt (the cached content).",
         "title": "Cachedcontenttokencount"
      },
      "responseTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total number of tokens across all the generated response candidates.",
         "title": "Responsetokencount"
      },
      "toolUsePromptTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens present in tool-use prompt(s).",
         "title": "Tooluseprompttokencount"
      },
      "thoughtsTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of tokens of thoughts for thinking models.",
         "title": "Thoughtstokencount"
      },
      "totalTokenCount": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total token count for prompt, response candidates, and tool-use prompts(if present).",
         "title": "Totaltokencount"
      },
      "promptTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of modalities that were processed in the request input.",
         "title": "Prompttokensdetails"
      },
      "cacheTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of modalities that were processed in the cache input.",
         "title": "Cachetokensdetails"
      },
      "responseTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of modalities that were returned in the response.",
         "title": "Responsetokensdetails"
      },
      "toolUsePromptTokensDetails": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/ModalityTokenCount"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "List of modalities that were processed in the tool-use prompt.",
         "title": "Tooluseprompttokensdetails"
      },
      "trafficType": {
         "anyOf": [
            {
               "$ref": "#/$defs/TrafficType"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Traffic type. This shows whether a request consumes Pay-As-You-Go\n or Provisioned Throughput quota."
      }
   },
   "$defs": {
      "MediaModality": {
         "description": "Server content modalities.",
         "enum": [
            "MODALITY_UNSPECIFIED",
            "TEXT",
            "IMAGE",
            "VIDEO",
            "AUDIO",
            "DOCUMENT"
         ],
         "title": "MediaModality",
         "type": "string"
      },
      "ModalityTokenCount": {
         "additionalProperties": false,
         "description": "Represents token counting info for a single modality.",
         "properties": {
            "modality": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MediaModality"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The modality associated with this token count."
            },
            "tokenCount": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of tokens.",
               "title": "Tokencount"
            }
         },
         "title": "ModalityTokenCount",
         "type": "object"
      },
      "TrafficType": {
         "description": "Output only.\n\nTraffic type. This shows whether a request consumes Pay-As-You-Go or\nProvisioned Throughput quota.",
         "enum": [
            "TRAFFIC_TYPE_UNSPECIFIED",
            "ON_DEMAND",
            "PROVISIONED_THROUGHPUT"
         ],
         "title": "TrafficType",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field cache_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'cacheTokensDetails')

List of modalities that were processed in the cache input.

field cached_content_token_count: Optional[int] = None (alias 'cachedContentTokenCount')

Number of tokens in the cached part of the prompt (the cached content).

field prompt_token_count: Optional[int] = None (alias 'promptTokenCount')

Number of tokens in the prompt. When cached_content is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.

field prompt_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'promptTokensDetails')

List of modalities that were processed in the request input.

field response_token_count: Optional[int] = None (alias 'responseTokenCount')

Total number of tokens across all the generated response candidates.

field response_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'responseTokensDetails')

List of modalities that were returned in the response.

field thoughts_token_count: Optional[int] = None (alias 'thoughtsTokenCount')

Number of tokens of thoughts for thinking models.

field tool_use_prompt_token_count: Optional[int] = None (alias 'toolUsePromptTokenCount')

Number of tokens present in tool-use prompt(s).

field tool_use_prompt_tokens_details: Optional[list[ModalityTokenCount]] = None (alias 'toolUsePromptTokensDetails')

List of modalities that were processed in the tool-use prompt.

field total_token_count: Optional[int] = None (alias 'totalTokenCount')

Total token count for prompt, response candidates, and tool-use prompts(if present).

field traffic_type: Optional[TrafficType] = None (alias 'trafficType')

Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota.

class genai.types.UsageMetadataDict

Bases: TypedDict

Usage metadata about response(s).

cache_tokens_details: Optional[list[ModalityTokenCountDict]]

List of modalities that were processed in the cache input.

cached_content_token_count: Optional[int]

Number of tokens in the cached part of the prompt (the cached content).

prompt_token_count: Optional[int]

Number of tokens in the prompt. When cached_content is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.

prompt_tokens_details: Optional[list[ModalityTokenCountDict]]

List of modalities that were processed in the request input.

response_token_count: Optional[int]

Total number of tokens across all the generated response candidates.

response_tokens_details: Optional[list[ModalityTokenCountDict]]

List of modalities that were returned in the response.

thoughts_token_count: Optional[int]

Number of tokens of thoughts for thinking models.

tool_use_prompt_token_count: Optional[int]

Number of tokens present in tool-use prompt(s).

tool_use_prompt_tokens_details: Optional[list[ModalityTokenCountDict]]

List of modalities that were processed in the tool-use prompt.

total_token_count: Optional[int]

Total token count for prompt, response candidates, and tool-use prompts(if present).

traffic_type: Optional[TrafficType]

Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota.

pydantic model genai.types.UserContent

Bases: Content

UserContent facilitates the creation of a Content object with a user role.

Example usages:

  • Create a user Content object with a string: user_content = UserContent(“Why is the sky blue?”)

  • Create a user Content object with a file data Part object: user_content = UserContent(Part.from_uri(file_uril=”gs://bucket/file.txt”, mime_type=”text/plain”))

  • Create a user Content object with byte data Part object: user_content = UserContent(Part.from_bytes(data=b”Hello, World!”, mime_type=”text/plain”))

    You can create a user Content object using other classmethods in the Part class as well. You can also create a user Content using a list of Part objects or strings.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "UserContent",
   "description": "UserContent facilitates the creation of a Content object with a user role.\n\nExample usages:\n\n\n- Create a user Content object with a string:\n  user_content = UserContent(\"Why is the sky blue?\")\n- Create a user Content object with a file data Part object:\n  user_content = UserContent(Part.from_uri(file_uril=\"gs://bucket/file.txt\",\n  mime_type=\"text/plain\"))\n- Create a user Content object with byte data Part object:\n  user_content = UserContent(Part.from_bytes(data=b\"Hello, World!\",\n  mime_type=\"text/plain\"))\n\n  You can create a user Content object using other classmethods in the Part\n  class as well.\n  You can also create a user Content using a list of Part objects or strings.",
   "type": "object",
   "properties": {
      "parts": {
         "items": {
            "$ref": "#/$defs/Part"
         },
         "title": "Parts",
         "type": "array"
      },
      "role": {
         "const": "user",
         "default": "user",
         "enum": [
            "user"
         ],
         "title": "Role",
         "type": "string"
      }
   },
   "$defs": {
      "Blob": {
         "additionalProperties": false,
         "description": "Content blob.",
         "properties": {
            "displayName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.",
               "title": "Displayname"
            },
            "data": {
               "anyOf": [
                  {
                     "format": "base64url",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Raw bytes.",
               "title": "Data"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "Blob",
         "type": "object"
      },
      "CodeExecutionResult": {
         "additionalProperties": false,
         "description": "Result of executing the [ExecutableCode].\n\nAlways follows a `part` containing the [ExecutableCode].",
         "properties": {
            "outcome": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Outcome"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Outcome of the code execution."
            },
            "output": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
               "title": "Output"
            }
         },
         "title": "CodeExecutionResult",
         "type": "object"
      },
      "ExecutableCode": {
         "additionalProperties": false,
         "description": "Code generated by the model that is meant to be executed, and the result returned to the model.\n\nGenerated when using the [FunctionDeclaration] tool and\n[FunctionCallingConfig] mode is set to [Mode.CODE].",
         "properties": {
            "code": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The code to be executed.",
               "title": "Code"
            },
            "language": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Language"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. Programming language of the `code`."
            }
         },
         "title": "ExecutableCode",
         "type": "object"
      },
      "FileData": {
         "additionalProperties": false,
         "description": "URI based data.",
         "properties": {
            "fileUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. URI.",
               "title": "Fileuri"
            },
            "mimeType": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The IANA standard MIME type of the source data.",
               "title": "Mimetype"
            }
         },
         "title": "FileData",
         "type": "object"
      },
      "FunctionCall": {
         "additionalProperties": false,
         "description": "A function call.",
         "properties": {
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The unique id of the function call. If populated, the client to execute the\n   `function_call` and return the response with the matching `id`.",
               "title": "Id"
            },
            "args": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.",
               "title": "Args"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name].",
               "title": "Name"
            }
         },
         "title": "FunctionCall",
         "type": "object"
      },
      "FunctionResponse": {
         "additionalProperties": false,
         "description": "A function response.",
         "properties": {
            "willContinue": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished.",
               "title": "Willcontinue"
            },
            "scheduling": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponseScheduling"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.",
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].",
               "title": "Name"
            },
            "response": {
               "anyOf": [
                  {
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Required. The function response in JSON object format. Use \"output\" key to specify function output and \"error\" key to specify error details (if any). If \"output\" and \"error\" keys are not specified, then whole \"response\" is treated as function output.",
               "title": "Response"
            }
         },
         "title": "FunctionResponse",
         "type": "object"
      },
      "FunctionResponseScheduling": {
         "description": "Specifies how the response should be scheduled in the conversation.",
         "enum": [
            "SCHEDULING_UNSPECIFIED",
            "SILENT",
            "WHEN_IDLE",
            "INTERRUPT"
         ],
         "title": "FunctionResponseScheduling",
         "type": "string"
      },
      "Language": {
         "description": "Required. Programming language of the `code`.",
         "enum": [
            "LANGUAGE_UNSPECIFIED",
            "PYTHON"
         ],
         "title": "Language",
         "type": "string"
      },
      "Outcome": {
         "description": "Required. Outcome of the code execution.",
         "enum": [
            "OUTCOME_UNSPECIFIED",
            "OUTCOME_OK",
            "OUTCOME_FAILED",
            "OUTCOME_DEADLINE_EXCEEDED"
         ],
         "title": "Outcome",
         "type": "string"
      },
      "Part": {
         "additionalProperties": false,
         "description": "A datatype containing media content.\n\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.",
         "properties": {
            "videoMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VideoMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Metadata for a given video."
            },
            "thought": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates if the part is thought from the model.",
               "title": "Thought"
            },
            "inlineData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Inlined bytes data."
            },
            "codeExecutionResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CodeExecutionResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Result of executing the [ExecutableCode]."
            },
            "executableCode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ExecutableCode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Code generated by the model that is meant to be executed."
            },
            "fileData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FileData"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. URI based data."
            },
            "functionCall": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionCall"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values."
            },
            "functionResponse": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FunctionResponse"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Text part (can be code).",
               "title": "Text"
            }
         },
         "title": "Part",
         "type": "object"
      },
      "VideoMetadata": {
         "additionalProperties": false,
         "description": "Describes how the video in the Part should be used by the model.",
         "properties": {
            "fps": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
               "title": "Fps"
            },
            "endOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The end offset of the video.",
               "title": "Endoffset"
            },
            "startOffset": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The start offset of the video.",
               "title": "Startoffset"
            }
         },
         "title": "VideoMetadata",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "parts"
   ]
}

Fields:
field parts: list[Part] [Required]
field role: Literal['user'] = 'user'
pydantic model genai.types.VertexAISearch

Bases: BaseModel

Retrieve from Vertex AI Search datastore or engine for grounding.

datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "VertexAISearch",
   "description": "Retrieve from Vertex AI Search datastore or engine for grounding.\n\ndatastore and engine are mutually exclusive. See\nhttps://cloud.google.com/products/agent-builder",
   "type": "object",
   "properties": {
      "datastore": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`",
         "title": "Datastore"
      },
      "engine": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`",
         "title": "Engine"
      }
   },
   "additionalProperties": false
}

Fields:
field datastore: Optional[str] = None

Optional. Fully-qualified Vertex AI Search data store resource ID. Format: projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}

field engine: Optional[str] = None

Optional. Fully-qualified Vertex AI Search engine resource ID. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

class genai.types.VertexAISearchDict

Bases: TypedDict

Retrieve from Vertex AI Search datastore or engine for grounding.

datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder

datastore: Optional[str]

projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}

Type:

Optional. Fully-qualified Vertex AI Search data store resource ID. Format

engine: Optional[str]

projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

Type:

Optional. Fully-qualified Vertex AI Search engine resource ID. Format

pydantic model genai.types.VertexRagStore

Bases: BaseModel

Retrieve from Vertex RAG Store for grounding.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "VertexRagStore",
   "description": "Retrieve from Vertex RAG Store for grounding.",
   "type": "object",
   "properties": {
      "ragCorpora": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Deprecated. Please use rag_resources instead.",
         "title": "Ragcorpora"
      },
      "ragResources": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/VertexRagStoreRagResource"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.",
         "title": "Ragresources"
      },
      "ragRetrievalConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/RagRetrievalConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The retrieval config for the Rag query."
      },
      "similarityTopK": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Number of top k results to return from the selected corpora.",
         "title": "Similaritytopk"
      },
      "vectorDistanceThreshold": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. Only return results with vector distance smaller than the threshold.",
         "title": "Vectordistancethreshold"
      }
   },
   "$defs": {
      "RagRetrievalConfig": {
         "additionalProperties": false,
         "description": "Specifies the context retrieval config.",
         "properties": {
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigFilter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for filters."
            },
            "hybridSearch": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigHybridSearch"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Hybrid Search."
            },
            "ranking": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRanking"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for ranking and reranking."
            },
            "topK": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The number of contexts to retrieve.",
               "title": "Topk"
            }
         },
         "title": "RagRetrievalConfig",
         "type": "object"
      },
      "RagRetrievalConfigFilter": {
         "additionalProperties": false,
         "description": "Config for filters.",
         "properties": {
            "metadataFilter": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. String for metadata filtering.",
               "title": "Metadatafilter"
            },
            "vectorDistanceThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector distance smaller than the threshold.",
               "title": "Vectordistancethreshold"
            },
            "vectorSimilarityThreshold": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Only returns contexts with vector similarity larger than the threshold.",
               "title": "Vectorsimilaritythreshold"
            }
         },
         "title": "RagRetrievalConfigFilter",
         "type": "object"
      },
      "RagRetrievalConfigHybridSearch": {
         "additionalProperties": false,
         "description": "Config for Hybrid Search.",
         "properties": {
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.",
               "title": "Alpha"
            }
         },
         "title": "RagRetrievalConfigHybridSearch",
         "type": "object"
      },
      "RagRetrievalConfigRanking": {
         "additionalProperties": false,
         "description": "Config for ranking and reranking.",
         "properties": {
            "llmRanker": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingLlmRanker"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for LlmRanker."
            },
            "rankService": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RagRetrievalConfigRankingRankService"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. Config for Rank Service."
            }
         },
         "title": "RagRetrievalConfigRanking",
         "type": "object"
      },
      "RagRetrievalConfigRankingLlmRanker": {
         "additionalProperties": false,
         "description": "Config for LlmRanker.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name used for ranking. Format: `gemini-1.5-pro`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingLlmRanker",
         "type": "object"
      },
      "RagRetrievalConfigRankingRankService": {
         "additionalProperties": false,
         "description": "Config for Rank Service.",
         "properties": {
            "modelName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`",
               "title": "Modelname"
            }
         },
         "title": "RagRetrievalConfigRankingRankService",
         "type": "object"
      },
      "VertexRagStoreRagResource": {
         "additionalProperties": false,
         "description": "The definition of the Rag resource.",
         "properties": {
            "ragCorpus": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
               "title": "Ragcorpus"
            },
            "ragFileIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
               "title": "Ragfileids"
            }
         },
         "title": "VertexRagStoreRagResource",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field rag_corpora: Optional[list[str]] = None (alias 'ragCorpora')

Optional. Deprecated. Please use rag_resources instead.

field rag_resources: Optional[list[VertexRagStoreRagResource]] = None (alias 'ragResources')

Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.

field rag_retrieval_config: Optional[RagRetrievalConfig] = None (alias 'ragRetrievalConfig')

Optional. The retrieval config for the Rag query.

field similarity_top_k: Optional[int] = None (alias 'similarityTopK')

Optional. Number of top k results to return from the selected corpora.

field vector_distance_threshold: Optional[float] = None (alias 'vectorDistanceThreshold')

Optional. Only return results with vector distance smaller than the threshold.

class genai.types.VertexRagStoreDict

Bases: TypedDict

Retrieve from Vertex RAG Store for grounding.

rag_corpora: Optional[list[str]]

Optional. Deprecated. Please use rag_resources instead.

rag_resources: Optional[list[VertexRagStoreRagResourceDict]]

Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.

rag_retrieval_config: Optional[RagRetrievalConfigDict]

Optional. The retrieval config for the Rag query.

similarity_top_k: Optional[int]

Optional. Number of top k results to return from the selected corpora.

vector_distance_threshold: Optional[float]

Optional. Only return results with vector distance smaller than the threshold.

pydantic model genai.types.VertexRagStoreRagResource

Bases: BaseModel

The definition of the Rag resource.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "VertexRagStoreRagResource",
   "description": "The definition of the Rag resource.",
   "type": "object",
   "properties": {
      "ragCorpus": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`",
         "title": "Ragcorpus"
      },
      "ragFileIds": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.",
         "title": "Ragfileids"
      }
   },
   "additionalProperties": false
}

Fields:
field rag_corpus: Optional[str] = None (alias 'ragCorpus')

Optional. RagCorpora resource name. Format: projects/{project}/locations/{location}/ragCorpora/{rag_corpus}

field rag_file_ids: Optional[list[str]] = None (alias 'ragFileIds')

Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.

class genai.types.VertexRagStoreRagResourceDict

Bases: TypedDict

The definition of the Rag resource.

rag_corpus: Optional[str]

projects/{project}/locations/{location}/ragCorpora/{rag_corpus}

Type:

Optional. RagCorpora resource name. Format

rag_file_ids: Optional[list[str]]

Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.

pydantic model genai.types.Video

Bases: BaseModel

A generated video.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "Video",
   "description": "A generated video.",
   "type": "object",
   "properties": {
      "uri": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Path to another storage.",
         "title": "Uri"
      },
      "videoBytes": {
         "anyOf": [
            {
               "format": "base64url",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Video bytes.",
         "title": "Videobytes"
      },
      "mimeType": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Video encoding, for example \"video/mp4\".",
         "title": "Mimetype"
      }
   },
   "additionalProperties": false
}

Fields:
field mime_type: Optional[str] = None (alias 'mimeType')

Video encoding, for example “video/mp4”.

field uri: Optional[str] = None

Path to another storage.

field video_bytes: Optional[bytes] = None (alias 'videoBytes')

Video bytes.

save(path)

Saves the video to a file.

Return type:

None

Parameters:

path – Local path where to save the video.

show()

Shows the video.

If the video has no mime_type, it is assumed to be video/mp4.

This method only works in a notebook environment.

Return type:

None

class genai.types.VideoDict

Bases: TypedDict

A generated video.

mime_type: Optional[str]

Video encoding, for example “video/mp4”.

uri: Optional[str]

Path to another storage.

video_bytes: Optional[bytes]

Video bytes.

pydantic model genai.types.VideoMetadata

Bases: BaseModel

Describes how the video in the Part should be used by the model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "VideoMetadata",
   "description": "Describes how the video in the Part should be used by the model.",
   "type": "object",
   "properties": {
      "fps": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The frame rate of the video sent to the model. If not specified, the\n        default value will be 1.0. The fps range is (0.0, 24.0].",
         "title": "Fps"
      },
      "endOffset": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The end offset of the video.",
         "title": "Endoffset"
      },
      "startOffset": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Optional. The start offset of the video.",
         "title": "Startoffset"
      }
   },
   "additionalProperties": false
}

Fields:
field end_offset: Optional[str] = None (alias 'endOffset')

Optional. The end offset of the video.

field fps: Optional[float] = None

The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].

field start_offset: Optional[str] = None (alias 'startOffset')

Optional. The start offset of the video.

class genai.types.VideoMetadataDict

Bases: TypedDict

Describes how the video in the Part should be used by the model.

end_offset: Optional[str]

Optional. The end offset of the video.

fps: Optional[float]

The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].

start_offset: Optional[str]

Optional. The start offset of the video.

pydantic model genai.types.VoiceConfig

Bases: BaseModel

The configuration for the voice to use.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "VoiceConfig",
   "description": "The configuration for the voice to use.",
   "type": "object",
   "properties": {
      "prebuiltVoiceConfig": {
         "anyOf": [
            {
               "$ref": "#/$defs/PrebuiltVoiceConfig"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The configuration for the speaker to use.\n      "
      }
   },
   "$defs": {
      "PrebuiltVoiceConfig": {
         "additionalProperties": false,
         "description": "The configuration for the prebuilt speaker to use.",
         "properties": {
            "voiceName": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The name of the prebuilt voice to use.",
               "title": "Voicename"
            }
         },
         "title": "PrebuiltVoiceConfig",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field prebuilt_voice_config: Optional[PrebuiltVoiceConfig] = None (alias 'prebuiltVoiceConfig')

The configuration for the speaker to use.

class genai.types.VoiceConfigDict

Bases: TypedDict

The configuration for the voice to use.

prebuilt_voice_config: Optional[PrebuiltVoiceConfigDict]

The configuration for the speaker to use.

pydantic model genai.types.WeightedPrompt

Bases: BaseModel

Maps a prompt to a relative weight to steer music generation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Show JSON schema
{
   "title": "WeightedPrompt",
   "description": "Maps a prompt to a relative weight to steer music generation.",
   "type": "object",
   "properties": {
      "text": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Text prompt.",
         "title": "Text"
      },
      "weight": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Weight of the prompt. The weight is used to control the relative\n      importance of the prompt. Higher weights are more important than lower\n      weights.\n\n      Weight must not be 0. Weights of all weighted_prompts in this\n      LiveMusicClientContent message will be normalized.",
         "title": "Weight"
      }
   },
   "additionalProperties": false
}

Fields:
field text: Optional[str] = None

Text prompt.

field weight: Optional[float] = None

Weight of the prompt. The weight is used to control the relative importance of the prompt. Higher weights are more important than lower weights.

Weight must not be 0. Weights of all weighted_prompts in this LiveMusicClientContent message will be normalized.

class genai.types.WeightedPromptDict

Bases: TypedDict

Maps a prompt to a relative weight to steer music generation.

text: Optional[str]

Text prompt.

weight: Optional[float]

Weight of the prompt. The weight is used to control the relative importance of the prompt. Higher weights are more important than lower weights.

Weight must not be 0. Weights of all weighted_prompts in this LiveMusicClientContent message will be normalized.