Skip to content
Back to top
View this page

# Submodules

# google.adk.a2a module

# google.adk.agents module

google.adk.agents.Agent

  alias of `LlmAgent`

pydantic model google.adk.agents.BaseAgent

  Bases: `BaseNode`

  Base class for all agents in Agent Development Kit.

  Show JSON schema

      {
         "$defs": {
            "BaseAgent": {
               "additionalProperties": false,
               "description": "Base class for all agents in Agent Development Kit.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  },
                  "parent_agent": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/BaseAgent"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "sub_agents": {
                     "items": {
                        "$ref": "#/$defs/BaseAgent"
                     },
                     "title": "Sub Agents",
                     "type": "array"
                  },
                  "before_agent_callback": {
                     "default": null,
                     "title": "Before Agent Callback",
                     "type": "null"
                  },
                  "after_agent_callback": {
                     "default": null,
                     "title": "After Agent Callback",
                     "type": "null"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseAgent",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "$ref": "#/$defs/BaseAgent"
      }

  Fields:

    - `after_agent_callback (Callable[[google.adk.agents.context.Context], Awaitable[google.genai.types.Content | None] | google.genai.types.Content | None] | list[Callable[[google.adk.agents.context.Context], Awaitable[google.genai.types.Content | None] | google.genai.types.Content | None]] | None)`

    - `before_agent_callback (Callable[[google.adk.agents.context.Context], Awaitable[google.genai.types.Content | None] | google.genai.types.Content | None] | list[Callable[[google.adk.agents.context.Context], Awaitable[google.genai.types.Content | None] | google.genai.types.Content | None]] | None)`

    - `description (str)`

    - `name (str)`

    - `parent_agent (google.adk.agents.base_agent.BaseAgent | None)`

    - `sub_agents (list[google.adk.agents.base_agent.BaseAgent])`

  Validators:

    - `_validate_name` » `name`

    - `validate_name` » `name`

    - `validate_sub_agents_unique_names` » `sub_agents`

  field after_agent_callback: Optional[AfterAgentCallback] = None

    Callback or list of callbacks to be invoked after the agent run.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      callback_context – MUST be named ‘callback_context’ (enforced).

    Returns:

      The content to return to the user.

        When the content is present, an additional event with the provided content will be appended to event history as an additional agent response.

    Return type:

      Optional[types.Content]

  field before_agent_callback: Optional[BeforeAgentCallback] = None

    Callback or list of callbacks to be invoked before the agent run.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      callback_context – MUST be named ‘callback_context’ (enforced).

    Returns:

      The content to return to the user.

        When the content is present, the agent run will be skipped and the provided content will be returned to user.

    Return type:

      Optional[types.Content]

  field description: str = ''

    Description about the agent’s capability.

    The model uses this to determine whether to delegate control to the agent. One-line description is enough and preferred.

  field name: str [Required]

    The agent’s name.

    Agent name must be a Python identifier and unique within the agent tree. Agent name cannot be “user”, since it’s reserved for end-user’s input.

    Validated by:

      - `_validate_name`

      - `validate_name`

  field parent_agent: Optional[BaseAgent] = None

    The parent agent of this agent.

    Note that an agent can ONLY be added as sub-agent once.

    If you want to add one agent twice as sub-agent, consider to create two agent instances with identical config, but with different name and add them to the agent tree.

  field sub_agents: list[BaseAgent] [Optional]

    The sub-agents of this agent.

    Validated by:

      - `validate_sub_agents_unique_names`

  validator validate_name » name
  validator validate_sub_agents_unique_names » sub_agents

    Validates that all sub-agents have unique names.

    Return type:

      `list`[`BaseAgent`]

    Parameters:

      value – The list of sub-agents to validate.

    Returns:

      The validated list of sub-agents.

  clone(update=None)

    Creates a copy of this agent instance.

    Return type:

      `TypeVar`(`SelfAgent`, bound= BaseAgent)

    Parameters:

      update – Optional mapping of new values for the fields of the cloned agent. The keys of the mapping are the names of the fields to be updated, and the values are the new values for those fields. For example: {“name”: “cloned_agent”}

    Returns:

      A new agent instance with identical configuration as the original agent except for the fields specified in the update.

  find_agent(name)

    Finds the agent with the given name in this agent and its descendants.

    Return type:

      `Optional`[`BaseAgent`]

    Parameters:

      name – The name of the agent to find.

    Returns:

      The agent with the matching name, or None if no such agent is found.

  find_sub_agent(name)

    Finds the agent with the given name in this agent’s descendants.

    Return type:

      `Optional`[`BaseAgent`]

    Parameters:

      name – The name of the agent to find.

    Returns:

      The agent with the matching name, or None if no such agent is found.

  model_post_init(_BaseAgent__context)

    Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

    Return type:

      `None`

  async run_async(parent_context)

    Entry method to run an agent via text-based conversation.

    Return type:

      `AsyncGenerator`[`Event`, `None`]

    Parameters:

      parent_context – InvocationContext, the invocation context of the parent agent.

    Yields:

      Event – the events generated by the agent.

  async run_live(parent_context)

    Entry method to run an agent via video/audio-based conversation.

    Return type:

      `AsyncGenerator`[`Event`, `None`]

    Parameters:

      parent_context – InvocationContext, the invocation context of the parent agent.

    Yields:

      Event – the events generated by the agent.

  property canonical_after_agent_callbacks: list[Callable[[Context], Awaitable[Content | None] | Content | None]]

    The resolved self.after_agent_callback field as a list of _SingleAgentCallback.

    This method is only for use by Agent Development Kit.

  property canonical_before_agent_callbacks: list[Callable[[Context], Awaitable[Content | None] | Content | None]]

    The resolved self.before_agent_callback field as a list of _SingleAgentCallback.

    This method is only for use by Agent Development Kit.

  property root_agent: BaseAgent

    Gets the root agent of this agent.

class google.adk.agents.Context(invocation_context, *, event_actions=None, function_call_id=None, tool_confirmation=None, parent_ctx=None, node=None, node_path=None, run_id='', resume_inputs=None, attempt_count=1, use_as_output=False)

  Bases: `ReadonlyContext`

  The context within an agent run.

  When used in a workflow, additional fields under the `Workflow-specific fields` section are available.

  Initializes the Context.

  Parameters:

    - invocation_context – The invocation context.

    - event_actions – The event actions for state and artifact deltas.

    - function_call_id – The function call id of the current tool call. Required for tool-specific methods like request_credential and request_confirmation.

    - tool_confirmation – The tool confirmation of the current tool call.

    - parent_ctx – The parent node’s Context.

    - node – The current node.

    - node_path – The path of the current node in the workflow graph. If not provided, it will be derived from parent_ctx and node.

    - run_id – The execution ID of the current node.

    - resume_inputs – Inputs for resuming node, keyed by interrupt id.

    - attempt_count – Number of times this node has been attempted.

    - use_as_output – If True, this node’s output also represents the parent node’s output.

  property actions: EventActions

    The event actions for the current context.

  async add_events_to_memory(*, events, custom_metadata=None)

    Adds an explicit list of events to the memory service.

    Uses this callback’s current session identifiers as memory scope.

    Return type:

      `None`

    Parameters:

      - events – Explicit events to add to memory.

      - custom_metadata – Optional metadata forwarded to the configured memory service. Supported keys are implementation-specific.

    Raises:

      ValueError – If memory service is not available.

  async add_memory(*, memories, custom_metadata=None)

    Adds explicit memory items directly to the memory service.

    Uses this callback’s current session identifiers as memory scope.

    Return type:

      `None`

    Parameters:

      - memories – Explicit memory items to add.

      - custom_metadata – Optional metadata forwarded to the configured memory service. Supported keys are implementation-specific.

    Raises:

      ValueError – If memory service is not available.

  async add_session_to_memory()

    Triggers memory generation for the current session.

    This method saves the current session’s events to the memory service, enabling the agent to recall information from past interactions.

    Return type:

      `None`

    Raises:

      ValueError – If memory service is not available.

    Example

    ```python async def my_after_agent_callback(ctx: Context):

    > # Save conversation to memory at the end of each interaction await ctx.add_session_to_memory()

    ```

  property attempt_count: int

    Returns the current attempt number (1-based).

  property error: Exception | None

    The exception raised by the node, if any.

  property error_node_path: str

    The path of the node that failed.

  property event_author: str

    Author name stamped on events emitted by this node.

    Set by the orchestrator to override the default (node name). For example, Workflow sets this to its own name so all child events appear under the workflow’s author.

    Empty string means use the node’s own name (default).

  property function_call_id: str | None

    The function call id of the current tool call.

  async get_artifact_version(filename, version=None)

    Gets artifact version info.

    Return type:

      `ArtifactVersion` | `None`

    Parameters:

      - filename – The filename of the artifact.

      - version – The version of the artifact. If None, the latest version will be returned.

    Returns:

      The artifact version info.

  get_auth_response(auth_config)

    Gets the auth response credential from session state.

    This method retrieves an authentication credential that was previously stored in session state after a user completed an OAuth flow or other authentication process.

    Return type:

      `AuthCredential` | `None`

    Parameters:

      auth_config – The authentication configuration for the credential.

    Returns:

      The auth credential from the auth response, or None if not found.

  get_invocation_context()

    Returns a copy of the invocation context with the proxy session.

    Return type:

      `InvocationContext`

  property interrupt_ids: set[str]

    Interrupt IDs accumulated during this execution. Read-only.

    Set by the framework when the node yields an Event with long_running_tool_ids.

  property isolation_scope: str | None

    Scope tag inherited from parent or set explicitly via override.

    See `Event.isolation_scope` for format.

    ⚠️ DO NOT USE THIS DIRECTLY. Internal mechanism, may change.

  async list_artifacts()

    Lists the filenames of the artifacts attached to the current session.

    Return type:

      `list`[`str`]

  async load_artifact(filename, version=None)

    Loads an artifact attached to the current session.

    Return type:

      `Part` | `None`

    Parameters:

      - filename – The filename of the artifact.

      - version – The version of the artifact. If None, the latest version will be returned.

    Returns:

      The artifact.

  async load_credential(auth_config)

    Loads a credential from the credential service.

    Return type:

      `AuthCredential` | `None`

    Parameters:

      auth_config – The authentication configuration for the credential.

    Returns:

      The loaded credential, or None if not found.

  property node: BaseNode | None

    Returns the node instance of this context.

  property node_path: str

    Returns the path of the current node in the workflow graph.

  property output: Any

    The node’s result value. Source of truth for node output.

    Set once per run. Also set by the framework when the node yields Event(output=X) or yields a raw value. If the value was set via yield, the output Event is already enqueued. If set directly, the framework emits the output Event after _run_impl returns.

    Raises ValueError if: - Set a second time (at most one output per execution). - Set when interrupt_ids is non-empty (output and interrupt

    > are mutually exclusive).

  property parent_ctx: Context | None

    Returns the parent node’s Context.

  render_ui_widget(ui_widget)

    Adds a UI widget to the current event’s actions for the UI to render.

    UI widgets provide rendering payload/metadata that the UI Host uses to display rich interactive components (e.g., MCP App iframes) alongside agent responses.

    Return type:

      `None`

    Parameters:

      ui_widget – A `UiWidget` instance.

  request_confirmation(*, hint=None, payload=None)

    Requests confirmation for the current tool call.

    This method can only be called in a tool context where function_call_id is set.

    Return type:

      `None`

    Parameters:

      - hint – A hint to the user on how to confirm the tool call.

      - payload – The payload used to confirm the tool call.

    Raises:

      ValueError – If function_call_id is not set.

  request_credential(auth_config)

    Requests a credential for the current tool call.

    This method can only be called in a tool context where function_call_id is set. For callback contexts, use save_credential/load_credential instead.

    Return type:

      `None`

    Parameters:

      auth_config – The authentication configuration for the credential.

    Raises:

      ValueError – If function_call_id is not set.

  property resume_inputs: dict[str, Any]

    Returns inputs for resuming node, keyed by interrupt id.

  property route: bool | int | str | list[bool | int | str] | None

    Routing value for conditional edges.

    Read by the orchestrator to decide which downstream edge to follow. Can be set independently of output.

  property run_id: str

    Returns the execution ID of the current node.

  async run_node(node, node_input=None, *, use_as_output=False, run_id=None, use_sub_branch=False, override_branch=None, override_isolation_scope=None, raise_on_wait=False)

    Executes a node dynamically.

    This method allows a node within a workflow to trigger the run of another node (or a callable that can be built into a node) and asynchronously wait for its result. The dynamically executed node becomes a child run of the current node in the workflow.

    IMPORTANT: Always `await` this method directly. Wrapping it in `asyncio.create_task()` means the task runs unsupervised — errors are silently swallowed and the task is not cancelled if the parent node is interrupted (e.g. via HITL).

    Return type:

      `Any`

    Parameters:

      - node – The node to be executed. This can be a BaseNode instance or a callable that can be built into a node.

      - node_input – The input data to be passed to the dynamically executed node. Defaults to None.

      - use_as_output – If True, the dynamic node’s output is used as the calling node’s output. The calling node’s own output event is suppressed to avoid duplication.

      - run_id – An optional custom run ID for the dynamic node execution. If not provided, a default run ID is generated. Useful for correlating events across runs.

      - use_sub_branch – If True, the dynamic node will be executed in a sub-branch to isolate its state and events from the main branch.

      - override_branch – An optional branch to use instead of parent’s branch.

    Returns:

      The output of the dynamically executed node, once it finishes executing.

  async save_artifact(filename, artifact, custom_metadata=None)

    Saves an artifact and records it as delta for the current session.

    Return type:

      `int`

    Parameters:

      - filename – The filename of the artifact.

      - artifact – The artifact to save.

      - custom_metadata – Custom metadata to associate with the artifact.

    Returns:

      The version of the artifact.

  async save_credential(auth_config)

    Saves a credential to the credential service.

    Return type:

      `None`

    Parameters:

      auth_config – The authentication configuration containing the credential.

  async search_memory(query)

    Searches the memory of the current user.

    Return type:

      `SearchMemoryResponse`

    Parameters:

      query – The search query.

    Returns:

      The search results from the memory service.

    Raises:

      ValueError – If memory service is not available.

  property session: Session

    Returns the current session for this invocation.

  property state: State

    The delta-aware state of the current session.

    For any state change, you can mutate this object directly, e.g. ctx.state[‘foo’] = ‘bar’

  property telemetry_context: TelemetryContext

    Returns the telemetry context.

  property tool_confirmation: ToolConfirmation | None

    The tool confirmation of the current tool call.

pydantic model google.adk.agents.InvocationContext

  Bases: `BaseModel`

  An invocation context represents the data of a single invocation of an agent.

  An invocation:

    1. Starts with a user message and ends with a final response.

    2. Can contain one or multiple agent calls.

    3. Is handled by runner.run_async().

  An invocation runs an agent until it does not request to transfer to another agent.

  An agent call:

    1. Is handled by agent.run().

    2. Ends when agent.run() ends.

  An LLM agent call is an agent with a BaseLLMFlow. An LLM agent call can contain one or multiple steps.

  An LLM agent runs steps in a loop until:

    1. A final response is generated.

    2. The agent transfers to another agent.

    3. The end_invocation is set to true by any callbacks or tools.

  A step:

    1. Calls the LLM only once and yields its response.

    2. Calls the tools and yields their responses if requested.

  The summarization of the function response is considered another step, since it is another llm call. A step ends when it’s done calling llm and tools, or if the end_invocation is set to true at any time.

  ```

    ┌─────────────────────── invocation ──────────────────────────┐ ┌──────────── llm_agent_call_1 ────────────┐ ┌─ agent_call_2 ─┐ ┌──── step_1 ────────┐ ┌───── step_2 ──────┐ [call_llm] [call_tool] [call_llm] [transfer]

  ```

  Show JSON schema

      {
         "title": "InvocationContext",
         "type": "object",
         "properties": {
            "artifact_service": {
               "default": null,
               "title": "Artifact Service"
            },
            "session_service": {
               "default": null,
               "title": "Session Service"
            },
            "memory_service": {
               "default": null,
               "title": "Memory Service"
            },
            "credential_service": {
               "default": null,
               "title": "Credential Service"
            },
            "context_cache_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContextCacheConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "invocation_id": {
               "title": "Invocation Id",
               "type": "string"
            },
            "branch": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Branch"
            },
            "isolation_scope": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Isolation Scope"
            },
            "agent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BaseAgent"
                  },
                  {
                     "$ref": "#/$defs/BaseNode"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Agent"
            },
            "user_content": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "session": {
               "$ref": "#/$defs/Session"
            },
            "node_path": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Node Path"
            },
            "agent_states": {
               "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
               },
               "title": "Agent States",
               "type": "object"
            },
            "end_of_agents": {
               "additionalProperties": {
                  "type": "boolean"
               },
               "title": "End Of Agents",
               "type": "object"
            },
            "end_invocation": {
               "default": false,
               "title": "End Invocation",
               "type": "boolean"
            },
            "live_request_queue": {
               "default": null,
               "title": "Live Request Queue"
            },
            "active_streaming_tools": {
               "default": null,
               "title": "Active Streaming Tools"
            },
            "transcription_cache": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/TranscriptionEntry"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Transcription Cache"
            },
            "live_session_resumption_handle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Live Session Resumption Handle"
            },
            "input_realtime_cache": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/RealtimeCacheEntry"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Realtime Cache"
            },
            "output_realtime_cache": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/RealtimeCacheEntry"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Realtime Cache"
            },
            "run_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RunConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "resumability_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ResumabilityConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "events_compaction_config": {
               "default": null,
               "title": "Events Compaction Config"
            },
            "token_compaction_checked": {
               "default": false,
               "title": "Token Compaction Checked",
               "type": "boolean"
            },
            "plugin_manager": {
               "default": null,
               "title": "Plugin Manager"
            },
            "canonical_tools_cache": {
               "default": null,
               "title": "Canonical Tools Cache"
            },
            "credential_by_key": {
               "additionalProperties": {
                  "$ref": "#/$defs/AuthCredential"
               },
               "title": "Credential By Key",
               "type": "object"
            }
         },
         "$defs": {
            "APIKey": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "apiKey"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "in": {
                     "$ref": "#/$defs/APIKeyIn"
                  },
                  "name": {
                     "title": "Name",
                     "type": "string"
                  }
               },
               "required": [
                  "in",
                  "name"
               ],
               "title": "APIKey",
               "type": "object"
            },
            "APIKeyIn": {
               "enum": [
                  "query",
                  "header",
                  "cookie"
               ],
               "title": "APIKeyIn",
               "type": "string"
            },
            "ActivityHandling": {
               "description": "The different ways of handling user activity.",
               "enum": [
                  "ACTIVITY_HANDLING_UNSPECIFIED",
                  "START_OF_ACTIVITY_INTERRUPTS",
                  "NO_INTERRUPTION"
               ],
               "title": "ActivityHandling",
               "type": "string"
            },
            "AudioTranscriptionConfig": {
               "additionalProperties": false,
               "description": "The audio transcription configuration in Setup.",
               "properties": {
                  "languageCodes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The language codes of the audio. BCP-47 language code. If not set, the transcription will be in the language detected by the model. If set, the server will use the language code specified in the model config as a hint for the language of the audio\n      ",
                     "title": "Languagecodes"
                  }
               },
               "title": "AudioTranscriptionConfig",
               "type": "object"
            },
            "AuthConfig": {
               "additionalProperties": true,
               "description": "The auth config sent by tool asking client to collect auth credentials and\n\nadk and client will help to fill in the response",
               "properties": {
                  "authScheme": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/APIKey"
                        },
                        {
                           "$ref": "#/$defs/HTTPBase"
                        },
                        {
                           "$ref": "#/$defs/OAuth2"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnect"
                        },
                        {
                           "$ref": "#/$defs/HTTPBearer"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnectWithConfig"
                        },
                        {
                           "$ref": "#/$defs/CustomAuthScheme"
                        }
                     ],
                     "title": "Authscheme"
                  },
                  "rawAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "exchangedAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "credentialKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Credentialkey"
                  }
               },
               "required": [
                  "authScheme"
               ],
               "title": "AuthConfig",
               "type": "object"
            },
            "AuthCredential": {
               "additionalProperties": true,
               "description": "Data class representing an authentication credential.\n\nTo exchange for the actual credential, please use\nCredentialExchanger.exchange_credential().\n\nExamples: API Key Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    api_key=\"1234\",\n)\n\nExample: HTTP Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"basic\",\n        credentials=HttpCredentials(username=\"user\", password=\"password\"),\n    ),\n)\n\nExample: OAuth2 Bearer Token in HTTP Header\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"bearer\",\n        credentials=HttpCredentials(token=\"eyAkaknabna....\"),\n    ),\n)\n\nExample: OAuth2 Auth with Authorization Code Flow\nAuthCredential(\n    auth_type=AuthCredentialTypes.OAUTH2,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n    ),\n)\n\nExample: OpenID Connect Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n        redirect_uri=\"https://example.com\",\n        scopes=[\"scope1\", \"scope2\"],\n    ),\n)\n\nExample: Auth with resource reference\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    resource_ref=\"projects/1234/locations/us-central1/resources/resource1\",\n)",
               "properties": {
                  "authType": {
                     "$ref": "#/$defs/AuthCredentialTypes"
                  },
                  "resourceRef": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Resourceref"
                  },
                  "apiKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Apikey"
                  },
                  "http": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/HttpAuth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "serviceAccount": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccount"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "oauth2": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuth2Auth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "required": [
                  "authType"
               ],
               "title": "AuthCredential",
               "type": "object"
            },
            "AuthCredentialTypes": {
               "description": "Represents the type of authentication credential.",
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect",
                  "serviceAccount"
               ],
               "title": "AuthCredentialTypes",
               "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"
            },
            "AvatarConfig": {
               "additionalProperties": false,
               "description": "Configures the avatar to be used in the session.",
               "properties": {
                  "avatarName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Pre-built avatar id.",
                     "title": "Avatarname"
                  },
                  "customizedAvatar": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CustomizedAvatar"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Customized avatar appearance with a reference image."
                  },
                  "audioBitrateBps": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The bitrate of compressed audio.",
                     "title": "Audiobitratebps"
                  },
                  "videoBitrateBps": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The bitrate of compressed video output.",
                     "title": "Videobitratebps"
                  }
               },
               "title": "AvatarConfig",
               "type": "object"
            },
            "BaseAgent": {
               "additionalProperties": false,
               "description": "Base class for all agents in Agent Development Kit.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  },
                  "parent_agent": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/BaseAgent"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "sub_agents": {
                     "items": {
                        "$ref": "#/$defs/BaseAgent"
                     },
                     "title": "Sub Agents",
                     "type": "array"
                  },
                  "before_agent_callback": {
                     "default": null,
                     "title": "Before Agent Callback",
                     "type": "null"
                  },
                  "after_agent_callback": {
                     "default": null,
                     "title": "After Agent Callback",
                     "type": "null"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseAgent",
               "type": "object"
            },
            "BaseNode": {
               "description": "A base class for all nodes in the workflow graph.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseNode",
               "type": "object"
            },
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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"
            },
            "CacheMetadata": {
               "additionalProperties": false,
               "description": "Metadata for context cache associated with LLM responses.\n\nThis class stores cache identification, usage tracking, and lifecycle\ninformation for a particular cache instance. It can be in two states:\n\n1. Active cache state: cache_name is set, all fields populated\n2. Fingerprint-only state: cache_name is None, only fingerprint and\n   contents_count are set for prefix matching\n\nToken counts (cached and total) are available in the LlmResponse.usage_metadata\nand should be accessed from there to avoid duplication.\n\nAttributes:\n    cache_name: The full resource name of the cached content (e.g.,\n        'projects/123/locations/us-central1/cachedContents/456').\n        None when no active cache exists (fingerprint-only state).\n    expire_time: Unix timestamp when the cache expires. None when no\n        active cache exists.\n    fingerprint: Hash of cacheable contents (instruction + tools + contents).\n        Always present for prefix matching.\n    invocations_used: Number of invocations this cache has been used for.\n        None when no active cache exists.\n    contents_count: Number of contents. When active cache exists, this is\n        the count of cached contents. When no active cache exists, this is\n        the total count of contents in the request.\n    created_at: Unix timestamp when the cache was created. None when\n        no active cache exists.",
               "properties": {
                  "cache_name": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Full resource name of the cached content (None if no active cache)",
                     "title": "Cache Name"
                  },
                  "expire_time": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unix timestamp when cache expires (None if no active cache)",
                     "title": "Expire Time"
                  },
                  "fingerprint": {
                     "description": "Hash of cacheable contents used to detect changes",
                     "title": "Fingerprint",
                     "type": "string"
                  },
                  "invocations_used": {
                     "anyOf": [
                        {
                           "minimum": 0,
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Number of invocations this cache has been used for (None if no active cache)",
                     "title": "Invocations Used"
                  },
                  "contents_count": {
                     "description": "Number of contents (cached contents when active cache exists, total contents in request when no active cache)",
                     "minimum": 0,
                     "title": "Contents Count",
                     "type": "integer"
                  },
                  "created_at": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unix timestamp when cache was created (None if no active cache)",
                     "title": "Created At"
                  }
               },
               "required": [
                  "fingerprint",
                  "contents_count"
               ],
               "title": "CacheMetadata",
               "type": "object"
            },
            "Citation": {
               "additionalProperties": false,
               "description": "A citation for a piece of generatedcontent.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "endIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The end index of the citation in the content.",
                     "title": "Endindex"
                  },
                  "license": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The license of the source of the citation.",
                     "title": "License"
                  },
                  "publicationDate": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GoogleTypeDate"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The publication date of the source of the citation."
                  },
                  "startIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The start index of the citation in the content.",
                     "title": "Startindex"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The title of the source of the citation.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The URI of the source of the citation.",
                     "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "ContextCacheConfig": {
               "additionalProperties": false,
               "description": "Configuration for context caching across all agents in an app.\n\nThis configuration enables and controls context caching behavior for\nall LLM agents in an app. When this config is present on an app, context\ncaching is enabled for all agents. When absent (None), context caching\nis disabled.\n\nContext caching can significantly reduce costs and improve response times\nby reusing previously processed context across multiple requests.\n\nAttributes:\n    cache_intervals: Maximum number of invocations to reuse the same cache before refreshing it\n    ttl_seconds: Time-to-live for cache in seconds\n    min_tokens: Minimum tokens required to enable caching",
               "properties": {
                  "cache_intervals": {
                     "default": 10,
                     "description": "Maximum number of invocations to reuse the same cache before refreshing it",
                     "maximum": 100,
                     "minimum": 1,
                     "title": "Cache Intervals",
                     "type": "integer"
                  },
                  "ttl_seconds": {
                     "default": 1800,
                     "description": "Time-to-live for cache in seconds",
                     "exclusiveMinimum": 0,
                     "title": "Ttl Seconds",
                     "type": "integer"
                  },
                  "min_tokens": {
                     "default": 0,
                     "description": "Minimum estimated request tokens required to enable caching. This compares against the estimated total tokens of the request (system instruction + tools + contents). Context cache storage may have cost. Set higher to avoid caching small requests where overhead may exceed benefits.",
                     "minimum": 0,
                     "title": "Min Tokens",
                     "type": "integer"
                  }
               },
               "title": "ContextCacheConfig",
               "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"
            },
            "CustomAuthScheme": {
               "additionalProperties": true,
               "description": "A flexible model for custom authentication schemes.\n\nThe subclasses must define a `default` for the `type_` field, if using OAuth2\nuser consent flow, to ensure correct rehydration.",
               "properties": {
                  "type": {
                     "title": "Type",
                     "type": "string"
                  }
               },
               "required": [
                  "type"
               ],
               "title": "CustomAuthScheme",
               "type": "object"
            },
            "CustomizedAvatar": {
               "additionalProperties": false,
               "description": "Configures the customized avatar to be used in the session.",
               "properties": {
                  "imageMimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The mime type of the reference image, e.g., \"image/jpeg\".",
                     "title": "Imagemimetype"
                  },
                  "imageData": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The data of the reference image. The dimensions of the reference\n      image should be 9:16 (portrait) with a minimum resolution of 704x1280.",
                     "title": "Imagedata"
                  }
               },
               "title": "CustomizedAvatar",
               "type": "object"
            },
            "EndSensitivity": {
               "description": "End of speech sensitivity.",
               "enum": [
                  "END_SENSITIVITY_UNSPECIFIED",
                  "END_SENSITIVITY_HIGH",
                  "END_SENSITIVITY_LOW"
               ],
               "title": "EndSensitivity",
               "type": "string"
            },
            "Event": {
               "description": "Represents an event in a conversation between agents and users.\n\nIt is used to store the content of the conversation, as well as the actions\ntaken by the agents like function calls, etc.",
               "properties": {
                  "modelVersion": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Modelversion"
                  },
                  "content": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Content"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "groundingMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "partial": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Partial"
                  },
                  "turnComplete": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Turncomplete"
                  },
                  "finishReason": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FinishReason"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "errorCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Errorcode"
                  },
                  "errorMessage": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Errormessage"
                  },
                  "interrupted": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Interrupted"
                  },
                  "customMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Custommetadata"
                  },
                  "usageMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GenerateContentResponseUsageMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "liveSessionResumptionUpdate": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/LiveServerSessionResumptionUpdate"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "liveSessionId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Livesessionid"
                  },
                  "goAway": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/LiveServerGoAway"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "inputTranscription": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Transcription"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "outputTranscription": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Transcription"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "avgLogprobs": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Avglogprobs"
                  },
                  "logprobsResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/LogprobsResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "cacheMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CacheMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "citationMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CitationMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "interactionId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Interactionid"
                  },
                  "invocationId": {
                     "default": "",
                     "title": "Invocationid",
                     "type": "string"
                  },
                  "author": {
                     "default": "",
                     "title": "Author",
                     "type": "string"
                  },
                  "actions": {
                     "$ref": "#/$defs/EventActions"
                  },
                  "output": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output"
                  },
                  "nodeInfo": {
                     "$ref": "#/$defs/NodeInfo"
                  },
                  "longRunningToolIds": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array",
                           "uniqueItems": true
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Longrunningtoolids"
                  },
                  "branch": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Branch"
                  },
                  "isolationScope": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Isolationscope"
                  },
                  "id": {
                     "default": "",
                     "title": "Id",
                     "type": "string"
                  },
                  "timestamp": {
                     "title": "Timestamp",
                     "type": "number"
                  }
               },
               "title": "Event",
               "type": "object"
            },
            "EventActions": {
               "additionalProperties": false,
               "description": "Represents the actions attached to an event.",
               "properties": {
                  "skipSummarization": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Skipsummarization"
                  },
                  "stateDelta": {
                     "additionalProperties": true,
                     "title": "Statedelta",
                     "type": "object"
                  },
                  "artifactDelta": {
                     "additionalProperties": {
                        "type": "integer"
                     },
                     "title": "Artifactdelta",
                     "type": "object"
                  },
                  "transferToAgent": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Transfertoagent"
                  },
                  "escalate": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Escalate"
                  },
                  "requestedAuthConfigs": {
                     "additionalProperties": {
                        "$ref": "#/$defs/AuthConfig"
                     },
                     "title": "Requestedauthconfigs",
                     "type": "object"
                  },
                  "requestedToolConfirmations": {
                     "additionalProperties": {
                        "$ref": "#/$defs/ToolConfirmation"
                     },
                     "title": "Requestedtoolconfirmations",
                     "type": "object"
                  },
                  "compaction": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/EventCompaction"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "endOfAgent": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Endofagent"
                  },
                  "agentState": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Agentstate"
                  },
                  "rewindBeforeInvocationId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Rewindbeforeinvocationid"
                  },
                  "route": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "integer"
                        },
                        {
                           "type": "string"
                        },
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "boolean"
                                 },
                                 {
                                    "type": "integer"
                                 },
                                 {
                                    "type": "string"
                                 }
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Route"
                  },
                  "renderUiWidgets": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/UiWidget"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Renderuiwidgets"
                  },
                  "setModelResponse": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Setmodelresponse"
                  }
               },
               "title": "EventActions",
               "type": "object"
            },
            "EventCompaction": {
               "additionalProperties": false,
               "description": "The compaction of the events.",
               "properties": {
                  "startTimestamp": {
                     "title": "Starttimestamp",
                     "type": "number"
                  },
                  "endTimestamp": {
                     "title": "Endtimestamp",
                     "type": "number"
                  },
                  "compactedContent": {
                     "$ref": "#/$defs/Content"
                  }
               },
               "required": [
                  "startTimestamp",
                  "endTimestamp",
                  "compactedContent"
               ],
               "title": "EventCompaction",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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",
                  "UNEXPECTED_TOOL_CALL",
                  "IMAGE_PROHIBITED_CONTENT",
                  "NO_IMAGE",
                  "IMAGE_RECITATION",
                  "IMAGE_OTHER"
               ],
               "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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"
            },
            "GenerateContentResponseUsageMetadata": {
               "additionalProperties": false,
               "description": "Usage metadata about the content generation request and response.\n\nThis message provides a detailed breakdown of token usage and other relevant\nmetrics. This data type is not supported in Gemini API.",
               "properties": {
                  "cacheTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown of the token count for each modality in the cached content.",
                     "title": "Cachetokensdetails"
                  },
                  "cachedContentTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens in the cached content that was used for this request.",
                     "title": "Cachedcontenttokencount"
                  },
                  "candidatesTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens in the generated candidates.",
                     "title": "Candidatestokencount"
                  },
                  "candidatesTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown of the token count for each modality in the generated candidates.",
                     "title": "Candidatestokensdetails"
                  },
                  "promptTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also 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. A detailed breakdown of the token count for each modality in the prompt.",
                     "title": "Prompttokensdetails"
                  },
                  "thoughtsTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens that were part of the model's generated \"thoughts\" output, if applicable.",
                     "title": "Thoughtstokencount"
                  },
                  "toolUsePromptTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.",
                     "title": "Tooluseprompttokencount"
                  },
                  "toolUsePromptTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.",
                     "title": "Tooluseprompttokensdetails"
                  },
                  "totalTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.",
                     "title": "Totaltokencount"
                  },
                  "trafficType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/TrafficType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The traffic type for this request."
                  }
               },
               "title": "GenerateContentResponseUsageMetadata",
               "type": "object"
            },
            "GetSessionConfig": {
               "description": "The configuration of getting a session.\n\nAttributes:\n  num_recent_events: The limit of recent events to get for the session.\n    Optional: if None, the filter is not applied; if greater than 0, returns\n      at most given number of recent events; if 0, no events are returned.\n  after_timestamp: The earliest timestamp of events to get for the session.\n    Optional: if None, the filter is not applied; otherwise, returns events\n      with timestamp >= the given time.",
               "properties": {
                  "num_recent_events": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Num Recent Events"
                  },
                  "after_timestamp": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "After Timestamp"
                  }
               },
               "title": "GetSessionConfig",
               "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. This\ndata type is not supported in Gemini API.",
               "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": "A piece of evidence that supports a claim made by the model.\n\nThis is used to show a citation for a claim made by the model. When grounding\nis enabled, the model returns a `GroundingChunk` that contains a reference to\nthe source of the information.",
               "properties": {
                  "image": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkImage"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from an image search result. See the `Image` message for details."
                  },
                  "maps": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMaps"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A `Maps` chunk is a piece of evidence that comes from Google Maps.\n\n      It contains information about a place, such as its name, address, and\n      reviews. This is used to provide the user with rich, location-based\n      information."
                  },
                  "retrievedContext": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkRetrievedContext"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details"
                  },
                  "web": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkWeb"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from a web page, typically from Google Search. See the `Web` message for details."
                  }
               },
               "title": "GroundingChunk",
               "type": "object"
            },
            "GroundingChunkCustomMetadata": {
               "additionalProperties": false,
               "description": "User provided metadata about the GroundingFact.\n\nThis data type is not supported in Vertex AI.",
               "properties": {
                  "key": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The key of the metadata.",
                     "title": "Key"
                  },
                  "numericValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.",
                     "title": "Numericvalue"
                  },
                  "stringListValue": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkStringList"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A list of string values for the metadata."
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The string value of the metadata.",
                     "title": "Stringvalue"
                  }
               },
               "title": "GroundingChunkCustomMetadata",
               "type": "object"
            },
            "GroundingChunkImage": {
               "additionalProperties": false,
               "description": "An `Image` chunk is a piece of evidence that comes from an image search result.\n\nIt contains the URI of the image search result and the URI of the image. This\nis used to provide the user with a link to the source of the information.",
               "properties": {
                  "sourceUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the image search result page.",
                     "title": "Sourceuri"
                  },
                  "imageUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the image.",
                     "title": "Imageuri"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the image search result page.",
                     "title": "Title"
                  },
                  "domain": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The domain of the image search result page.",
                     "title": "Domain"
                  }
               },
               "title": "GroundingChunkImage",
               "type": "object"
            },
            "GroundingChunkMaps": {
               "additionalProperties": false,
               "description": "A `Maps` chunk is a piece of evidence that comes from Google Maps.\n\nIt contains information about a place, such as its name, address, and reviews.\nThis is used to provide the user with rich, location-based information.",
               "properties": {
                  "placeAnswerSources": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSources"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The sources that were used to generate the place answer.\n\n      This includes review snippets and photos that were used to generate the\n      answer, as well as URIs to flag content."
                  },
                  "placeId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "This Place's resource name, in `places/{place_id}` format.\n\n      This can be used to look up the place in the Google Maps API.",
                     "title": "Placeid"
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The text of the place answer.",
                     "title": "Text"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the place.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the place.",
                     "title": "Uri"
                  },
                  "route": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsRoute"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. Route information."
                  }
               },
               "title": "GroundingChunkMaps",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSources": {
               "additionalProperties": false,
               "description": "The sources that were used to generate the place answer.\n\nThis includes review snippets and photos that were used to generate the\nanswer, as well as URIs to flag content.",
               "properties": {
                  "reviewSnippet": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Snippets of reviews that were used to generate the answer.",
                     "title": "Reviewsnippet"
                  },
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link where users can flag a problem with the generated answer.",
                     "title": "Flagcontenturi"
                  },
                  "reviewSnippets": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Snippets of reviews that were used to generate the answer.",
                     "title": "Reviewsnippets"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSources",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution": {
               "additionalProperties": false,
               "description": "Author attribution for a photo or review.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Name of the author of the Photo or Review.",
                     "title": "Displayname"
                  },
                  "photoUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Profile photo URI of the author of the Photo or Review.",
                     "title": "Photouri"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "URI of the author of the Photo or Review.",
                     "title": "Uri"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSourcesReviewSnippet": {
               "additionalProperties": false,
               "description": "Encapsulates a review snippet.",
               "properties": {
                  "authorAttribution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "This review's author."
                  },
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link where users can flag a problem with the review.",
                     "title": "Flagcontenturi"
                  },
                  "googleMapsUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link to show the review on Google Maps.",
                     "title": "Googlemapsuri"
                  },
                  "relativePublishTimeDescription": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country.",
                     "title": "Relativepublishtimedescription"
                  },
                  "review": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A reference representing this place review which may be used to look up this place review again.",
                     "title": "Review"
                  },
                  "reviewId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Id of the review referencing the place.",
                     "title": "Reviewid"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Title of the review.",
                     "title": "Title"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSourcesReviewSnippet",
               "type": "object"
            },
            "GroundingChunkMapsRoute": {
               "additionalProperties": false,
               "description": "Route information from Google Maps.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "distanceMeters": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total distance of the route, in meters.",
                     "title": "Distancemeters"
                  },
                  "duration": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total duration of the route.",
                     "title": "Duration"
                  },
                  "encodedPolyline": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "An encoded polyline of the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm",
                     "title": "Encodedpolyline"
                  }
               },
               "title": "GroundingChunkMapsRoute",
               "type": "object"
            },
            "GroundingChunkRetrievedContext": {
               "additionalProperties": false,
               "description": "Context retrieved from a data source to ground the model's response.\n\nThis is used when a retrieval tool fetches information from a user-provided\ncorpus or a public dataset.",
               "properties": {
                  "documentName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. This field is not supported in Gemini API.",
                     "title": "Documentname"
                  },
                  "ragChunk": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RagChunk"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used. This field is not supported in Gemini API."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The content of the retrieved data source.",
                     "title": "Text"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the retrieved data source.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the retrieved data source.",
                     "title": "Uri"
                  },
                  "customMetadata": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkCustomMetadata"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. User-provided metadata about the retrieved context. This field is not supported in Vertex AI.",
                     "title": "Custommetadata"
                  },
                  "fileSearchStore": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`. This field is not supported in Vertex AI.",
                     "title": "Filesearchstore"
                  },
                  "pageNumber": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Page number of the retrieved context. This field is not supported in Vertex AI.",
                     "title": "Pagenumber"
                  },
                  "mediaId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Media ID. This field is not supported in Vertex AI.",
                     "title": "Mediaid"
                  }
               },
               "title": "GroundingChunkRetrievedContext",
               "type": "object"
            },
            "GroundingChunkStringList": {
               "additionalProperties": false,
               "description": "A list of string values. This data type is not supported in Vertex AI.",
               "properties": {
                  "values": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The string values of the list.",
                     "title": "Values"
                  }
               },
               "title": "GroundingChunkStringList",
               "type": "object"
            },
            "GroundingChunkWeb": {
               "additionalProperties": false,
               "description": "A `Web` chunk is a piece of evidence that comes from a web page.\n\nIt contains the URI of the web page, the title of the page, and the domain of\nthe page. This is used to provide the user with a link to the source of the\ninformation.",
               "properties": {
                  "domain": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The domain of the web page that contains the evidence. This can be used to filter out low-quality sources. This field is not supported in Gemini API.",
                     "title": "Domain"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the web page that contains the evidence.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the web page that contains the evidence.",
                     "title": "Uri"
                  }
               },
               "title": "GroundingChunkWeb",
               "type": "object"
            },
            "GroundingMetadata": {
               "additionalProperties": false,
               "description": "Information for various kinds of grounding.",
               "properties": {
                  "imageSearchQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The image search queries that were used to generate the content. This field is populated only when the grounding source is Google Search with the Image Search search_type enabled.",
                     "title": "Imagesearchqueries"
                  },
                  "groundingChunks": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunk"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of supporting references retrieved from the grounding\n      source. This field is populated when the grounding source is Google\n      Search, Vertex AI Search, or Google Maps.\n      ",
                     "title": "Groundingchunks"
                  },
                  "groundingSupports": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingSupport"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of grounding support.",
                     "title": "Groundingsupports"
                  },
                  "retrievalMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetrievalMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Metadata related to retrieval in the grounding flow."
                  },
                  "searchEntryPoint": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/SearchEntryPoint"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Google search entry for the following-up web\n      searches."
                  },
                  "webSearchQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Web search queries for the following-up web search.",
                     "title": "Websearchqueries"
                  },
                  "googleMapsWidgetContextToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.",
                     "title": "Googlemapswidgetcontexttoken"
                  },
                  "retrievalQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The queries that were executed by the retrieval tools. This field is populated only when the grounding source is a retrieval tool, such as Vertex AI Search. This field is not supported in Gemini API.",
                     "title": "Retrievalqueries"
                  },
                  "sourceFlaggingUris": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingMetadataSourceFlaggingUri"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps. This field is not supported in Gemini API.",
                     "title": "Sourceflagginguris"
                  }
               },
               "title": "GroundingMetadata",
               "type": "object"
            },
            "GroundingMetadataSourceFlaggingUri": {
               "additionalProperties": false,
               "description": "A URI that can be used to flag a place or review for inappropriate content.\n\nThis is populated only when the grounding source is Google Maps. This data\ntype is not supported in Gemini API.",
               "properties": {
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI that can be used to flag the content.",
                     "title": "Flagcontenturi"
                  },
                  "sourceId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The ID of the place or review.",
                     "title": "Sourceid"
                  }
               },
               "title": "GroundingMetadataSourceFlaggingUri",
               "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.\n\n      Ranges from 0 to 1. 1 is the most confident. This list must have the\n      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\n      citations associated with the claim. For instance [1,3,4] means that\n      grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the\n      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."
                  },
                  "renderedParts": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "integer"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Indices into the `rendered_parts` field of the `GroundingMetadata` message. These indices specify which rendered parts are associated with this support message.",
                     "title": "Renderedparts"
                  }
               },
               "title": "GroundingSupport",
               "type": "object"
            },
            "HTTPBase": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  }
               },
               "required": [
                  "scheme"
               ],
               "title": "HTTPBase",
               "type": "object"
            },
            "HTTPBearer": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "const": "bearer",
                     "default": "bearer",
                     "title": "Scheme",
                     "type": "string"
                  },
                  "bearerFormat": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Bearerformat"
                  }
               },
               "title": "HTTPBearer",
               "type": "object"
            },
            "HttpAuth": {
               "additionalProperties": true,
               "description": "The credentials and metadata for HTTP authentication.",
               "properties": {
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  },
                  "credentials": {
                     "$ref": "#/$defs/HttpCredentials"
                  },
                  "additionalHeaders": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "type": "string"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Additionalheaders"
                  }
               },
               "required": [
                  "scheme",
                  "credentials"
               ],
               "title": "HttpAuth",
               "type": "object"
            },
            "HttpCredentials": {
               "additionalProperties": true,
               "description": "Represents the secret token value for HTTP authentication, like user name, password, oauth token, etc.",
               "properties": {
                  "username": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Username"
                  },
                  "password": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Password"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token"
                  }
               },
               "title": "HttpCredentials",
               "type": "object"
            },
            "Language": {
               "description": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "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"
            },
            "LogprobsResult": {
               "additionalProperties": false,
               "description": "The log probabilities of the tokens generated by the model.\n\nThis is useful for understanding the model's confidence in its predictions and\nfor debugging. For example, you can use log probabilities to identify when the\nmodel is making a less confident prediction or to explore alternative\nresponses that the model considered. A low log probability can also indicate\nthat the model is \"hallucinating\" or generating factually incorrect\ninformation.",
               "properties": {
                  "chosenCandidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultCandidate"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of the chosen candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps. Note that the chosen candidate might not be in `top_candidates`.",
                     "title": "Chosencandidates"
                  },
                  "topCandidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultTopCandidates"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of the top candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps.",
                     "title": "Topcandidates"
                  },
                  "logProbabilitySum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Sum of log probabilities for all tokens. This field is not supported in Vertex AI.",
                     "title": "Logprobabilitysum"
                  }
               },
               "title": "LogprobsResult",
               "type": "object"
            },
            "LogprobsResultCandidate": {
               "additionalProperties": false,
               "description": "A single token and its associated log probability.",
               "properties": {
                  "logProbability": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.",
                     "title": "Logprobability"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The token's string representation.",
                     "title": "Token"
                  },
                  "tokenId": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary.",
                     "title": "Tokenid"
                  }
               },
               "title": "LogprobsResultCandidate",
               "type": "object"
            },
            "LogprobsResultTopCandidates": {
               "additionalProperties": false,
               "description": "A list of the top candidate tokens and their log probabilities at each decoding step.\n\nThis can be used to see what other tokens the model considered.",
               "properties": {
                  "candidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultCandidate"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The list of candidate tokens, 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": "The number of tokens counted for this modality.",
                     "title": "Tokencount"
                  }
               },
               "title": "ModalityTokenCount",
               "type": "object"
            },
            "MultiSpeakerVoiceConfig": {
               "additionalProperties": false,
               "description": "Configuration for a multi-speaker text-to-speech request.",
               "properties": {
                  "speakerVoiceConfigs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/SpeakerVoiceConfig"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.",
                     "title": "Speakervoiceconfigs"
                  }
               },
               "title": "MultiSpeakerVoiceConfig",
               "type": "object"
            },
            "NodeInfo": {
               "description": "Workflow node metadata attached to an Event.",
               "properties": {
                  "path": {
                     "default": "",
                     "title": "Path",
                     "type": "string"
                  },
                  "outputFor": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Outputfor"
                  },
                  "messageAsOutput": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Messageasoutput"
                  }
               },
               "title": "NodeInfo",
               "type": "object"
            },
            "OAuth2": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "oauth2"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "flows": {
                     "$ref": "#/$defs/OAuthFlows"
                  }
               },
               "required": [
                  "flows"
               ],
               "title": "OAuth2",
               "type": "object"
            },
            "OAuth2Auth": {
               "additionalProperties": true,
               "description": "Represents credential value and its metadata for a OAuth2 credential.",
               "properties": {
                  "clientId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientid"
                  },
                  "clientSecret": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientsecret"
                  },
                  "authUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authuri"
                  },
                  "nonce": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Nonce"
                  },
                  "state": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State"
                  },
                  "redirectUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Redirecturi"
                  },
                  "authResponseUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authresponseuri"
                  },
                  "authCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authcode"
                  },
                  "accessToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Accesstoken"
                  },
                  "refreshToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshtoken"
                  },
                  "idToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Idtoken"
                  },
                  "expiresAt": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresat"
                  },
                  "expiresIn": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresin"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  },
                  "codeVerifier": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codeverifier"
                  },
                  "codeChallengeMethod": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codechallengemethod"
                  },
                  "tokenEndpointAuthMethod": {
                     "anyOf": [
                        {
                           "enum": [
                              "client_secret_basic",
                              "client_secret_post",
                              "client_secret_jwt",
                              "private_key_jwt"
                           ],
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": "client_secret_basic",
                     "title": "Tokenendpointauthmethod"
                  }
               },
               "title": "OAuth2Auth",
               "type": "object"
            },
            "OAuthFlowAuthorizationCode": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl",
                  "tokenUrl"
               ],
               "title": "OAuthFlowAuthorizationCode",
               "type": "object"
            },
            "OAuthFlowClientCredentials": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowClientCredentials",
               "type": "object"
            },
            "OAuthFlowImplicit": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl"
               ],
               "title": "OAuthFlowImplicit",
               "type": "object"
            },
            "OAuthFlowPassword": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowPassword",
               "type": "object"
            },
            "OAuthFlows": {
               "additionalProperties": true,
               "properties": {
                  "implicit": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowImplicit"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "password": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowPassword"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "clientCredentials": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowClientCredentials"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "authorizationCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowAuthorizationCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "title": "OAuthFlows",
               "type": "object"
            },
            "OpenIdConnect": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "openIdConnectUrl": {
                     "title": "Openidconnecturl",
                     "type": "string"
                  }
               },
               "required": [
                  "openIdConnectUrl"
               ],
               "title": "OpenIdConnect",
               "type": "object"
            },
            "OpenIdConnectWithConfig": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "authorization_endpoint": {
                     "title": "Authorization Endpoint",
                     "type": "string"
                  },
                  "token_endpoint": {
                     "title": "Token Endpoint",
                     "type": "string"
                  },
                  "userinfo_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Userinfo Endpoint"
                  },
                  "revocation_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Revocation Endpoint"
                  },
                  "token_endpoint_auth_methods_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token Endpoint Auth Methods Supported"
                  },
                  "grant_types_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Grant Types Supported"
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  }
               },
               "required": [
                  "authorization_endpoint",
                  "token_endpoint"
               ],
               "title": "OpenIdConnectWithConfig",
               "type": "object"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "PrebuiltVoiceConfig": {
               "additionalProperties": false,
               "description": "Configuration for a prebuilt voice.",
               "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"
            },
            "RagChunk": {
               "additionalProperties": false,
               "description": "A RagChunk includes the content of a chunk of a RagFile, and associated metadata.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "pageSpan": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RagChunkPageSpan"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "If populated, represents where the chunk starts and ends in the document."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The content of the chunk.",
                     "title": "Text"
                  }
               },
               "title": "RagChunk",
               "type": "object"
            },
            "RagChunkPageSpan": {
               "additionalProperties": false,
               "description": "Represents where the chunk starts and ends in the document.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "firstPage": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Page where chunk starts in the document. Inclusive. 1-indexed.",
                     "title": "Firstpage"
                  },
                  "lastPage": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Page where chunk ends in the document. Inclusive. 1-indexed.",
                     "title": "Lastpage"
                  }
               },
               "title": "RagChunkPageSpan",
               "type": "object"
            },
            "RealtimeCacheEntry": {
               "additionalProperties": false,
               "description": "Store audio data chunks for caching before flushing.",
               "properties": {
                  "role": {
                     "title": "Role",
                     "type": "string"
                  },
                  "data": {
                     "$ref": "#/$defs/Blob"
                  },
                  "timestamp": {
                     "title": "Timestamp",
                     "type": "number"
                  }
               },
               "required": [
                  "role",
                  "data",
                  "timestamp"
               ],
               "title": "RealtimeCacheEntry",
               "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"
            },
            "ReplicatedVoiceConfig": {
               "additionalProperties": false,
               "description": "The configuration for the replicated voice to use.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The mimetype of the voice sample. The only currently supported\n      value is `audio/wav`. This represents 16-bit signed little-endian wav\n      data, with a 24kHz sampling rate.\n      ",
                     "title": "Mimetype"
                  },
                  "voiceSampleAudio": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The sample of the custom voice.\n      ",
                     "title": "Voicesampleaudio"
                  },
                  "consentAudio": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Recorded consent verifying ownership of the voice. This\n      represents 16-bit signed little-endian wav data, with a 24kHz sampling\n      rate.",
                     "title": "Consentaudio"
                  },
                  "voiceConsentSignature": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VoiceConsentSignature"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Signature of a previously verified consent audio. This should be\n      populated with a signature generated by the server for a previous\n      request containing the consent_audio field. When provided, the\n      signature is verified instead of the consent_audio field to reduce\n      latency. Requests will fail if the signature is invalid or expired."
                  }
               },
               "title": "ReplicatedVoiceConfig",
               "type": "object"
            },
            "ResumabilityConfig": {
               "description": "The config of the resumability for an application.\n\nThe \"resumability\" in ADK refers to the ability to:\n1. pause an invocation upon a long-running function call.\n2. resume an invocation from the last event, if it's paused or failed midway\nthrough.\n\nNote: ADK resumes the invocation in a best-effort manner:\n1. Tool call to resume needs to be idempotent because we only guarantee\nan at-least-once behavior once resumed.\n2. Any temporary / in-memory state will be lost upon resumption.",
               "properties": {
                  "is_resumable": {
                     "default": false,
                     "title": "Is Resumable",
                     "type": "boolean"
                  }
               },
               "title": "ResumabilityConfig",
               "type": "object"
            },
            "RetrievalMetadata": {
               "additionalProperties": false,
               "description": "Metadata returned to client when grounding is enabled.",
               "properties": {
                  "googleSearchDynamicRetrievalScore": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Score indicating how likely information from google\n      search could help answer the prompt. The score is in the range [0, 1],\n      where 0 is the least likely and 1 is the most likely. This score is only\n      populated when google search grounding and dynamic retrieval is enabled.\n      It will be compared to the threshold to determine whether to trigger\n      Google search.",
                     "title": "Googlesearchdynamicretrievalscore"
                  }
               },
               "title": "RetrievalMetadata",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "type": "object"
            },
            "RunConfig": {
               "additionalProperties": false,
               "description": "Configs for runtime behavior of agents.\n\nThe configs here will be overridden by agent-specific configurations.",
               "properties": {
                  "speech_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/SpeechConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "response_modalities": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Response Modalities"
                  },
                  "avatar_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AvatarConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "save_input_blobs_as_artifacts": {
                     "default": false,
                     "deprecated": true,
                     "description": "Whether or not to save the input blobs as artifacts. DEPRECATED: Use SaveFilesAsArtifactsPlugin instead for better control and flexibility. See google.adk.plugins.SaveFilesAsArtifactsPlugin.",
                     "title": "Save Input Blobs As Artifacts",
                     "type": "boolean"
                  },
                  "support_cfc": {
                     "default": false,
                     "title": "Support Cfc",
                     "type": "boolean"
                  },
                  "streaming_mode": {
                     "$ref": "#/$defs/StreamingMode",
                     "default": null
                  },
                  "output_audio_transcription": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AudioTranscriptionConfig"
                        },
                        {
                           "type": "null"
                        }
                     ]
                  },
                  "input_audio_transcription": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AudioTranscriptionConfig"
                        },
                        {
                           "type": "null"
                        }
                     ]
                  },
                  "realtime_input_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RealtimeInputConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "enable_affective_dialog": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Enable Affective Dialog"
                  },
                  "proactivity": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ProactivityConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "session_resumption": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/SessionResumptionConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "context_window_compression": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ContextWindowCompressionConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "save_live_blob": {
                     "default": false,
                     "title": "Save Live Blob",
                     "type": "boolean"
                  },
                  "tool_thread_pool_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolThreadPoolConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "save_live_audio": {
                     "default": false,
                     "deprecated": true,
                     "description": "DEPRECATED: Use save_live_blob instead. If set to True, it saves live video and audio data to session and artifact service.",
                     "title": "Save Live Audio",
                     "type": "boolean"
                  },
                  "max_llm_calls": {
                     "default": 500,
                     "title": "Max Llm Calls",
                     "type": "integer"
                  },
                  "custom_metadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Custom Metadata"
                  },
                  "get_session_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GetSessionConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "title": "RunConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "SearchEntryPoint": {
               "additionalProperties": false,
               "description": "The entry point used to search for grounding sources.",
               "properties": {
                  "renderedContent": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Web content snippet that can be embedded in a web page\n      or an app webview.",
                     "title": "Renderedcontent"
                  },
                  "sdkBlob": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. JSON representing array of tuples.",
                     "title": "Sdkblob"
                  }
               },
               "title": "SearchEntryPoint",
               "type": "object"
            },
            "SecuritySchemeType": {
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect"
               ],
               "title": "SecuritySchemeType",
               "type": "string"
            },
            "Segment": {
               "additionalProperties": false,
               "description": "Segment of the content this support belongs to.",
               "properties": {
                  "startIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. Start index in the given Part, measured in bytes.\n\n      Offset from the start of the Part, inclusive, starting at zero.",
                     "title": "Startindex"
                  },
                  "endIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. End index in the given Part, measured in bytes.\n\n      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\n      Content object.",
                     "title": "Partindex"
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The text corresponding to the segment from the\n      response.",
                     "title": "Text"
                  }
               },
               "title": "Segment",
               "type": "object"
            },
            "ServiceAccount": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  service_account_credential: The service account credential (JSON key).\n  scopes: The OAuth2 scopes to request. Optional; when omitted with\n      ``use_default_credential=True``, defaults to the cloud-platform scope.\n  use_default_credential: Whether to use Application Default Credentials.\n  use_id_token: Whether to exchange for an ID token instead of an access\n      token. Required for service-to-service authentication with Cloud Run,\n      Cloud Functions, and other Google Cloud services that require identity\n      verification. When True, ``audience`` must also be set.\n  audience: The target audience for the ID token, typically the URL of the\n      receiving service (e.g. ``https://my-service-xyz.run.app``). Required\n      when ``use_id_token`` is True.",
               "properties": {
                  "serviceAccountCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccountCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  },
                  "useDefaultCredential": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Usedefaultcredential"
                  },
                  "useIdToken": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Useidtoken"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  }
               },
               "title": "ServiceAccount",
               "type": "object"
            },
            "ServiceAccountCredential": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  type: The type should be \"service_account\".\n  project_id: The project ID.\n  private_key_id: The ID of the private key.\n  private_key: The private key.\n  client_email: The client email.\n  client_id: The client ID.\n  auth_uri: The authorization URI.\n  token_uri: The token URI.\n  auth_provider_x509_cert_url: URL for auth provider's X.509 cert.\n  client_x509_cert_url: URL for the client's X.509 cert.\n  universe_domain: The universe domain.\n\nExample:\n\n    config = ServiceAccountCredential(\n        type_=\"service_account\",\n        project_id=\"your_project_id\",\n        private_key_id=\"your_private_key_id\",\n        private_key=\"-----BEGIN PRIVATE KEY-----...\",\n        client_email=\"...@....iam.gserviceaccount.com\",\n        client_id=\"your_client_id\",\n        auth_uri=\"https://accounts.google.com/o/oauth2/auth\",\n        token_uri=\"https://oauth2.googleapis.com/token\",\n        auth_provider_x509_cert_url=\"https://www.googleapis.com/oauth2/v1/certs\",\n        client_x509_cert_url=\"https://www.googleapis.com/robot/v1/metadata/x509/...\",\n        universe_domain=\"googleapis.com\"\n    )\n\n\n    config = ServiceAccountConfig.model_construct(**{\n        ...service account config dict\n    })",
               "properties": {
                  "type": {
                     "default": "",
                     "title": "Type",
                     "type": "string"
                  },
                  "projectId": {
                     "title": "Projectid",
                     "type": "string"
                  },
                  "privateKeyId": {
                     "title": "Privatekeyid",
                     "type": "string"
                  },
                  "privateKey": {
                     "title": "Privatekey",
                     "type": "string"
                  },
                  "clientEmail": {
                     "title": "Clientemail",
                     "type": "string"
                  },
                  "clientId": {
                     "title": "Clientid",
                     "type": "string"
                  },
                  "authUri": {
                     "title": "Authuri",
                     "type": "string"
                  },
                  "tokenUri": {
                     "title": "Tokenuri",
                     "type": "string"
                  },
                  "authProviderX509CertUrl": {
                     "title": "Authproviderx509Certurl",
                     "type": "string"
                  },
                  "clientX509CertUrl": {
                     "title": "Clientx509Certurl",
                     "type": "string"
                  },
                  "universeDomain": {
                     "title": "Universedomain",
                     "type": "string"
                  }
               },
               "required": [
                  "projectId",
                  "privateKeyId",
                  "privateKey",
                  "clientEmail",
                  "clientId",
                  "authUri",
                  "tokenUri",
                  "authProviderX509CertUrl",
                  "clientX509CertUrl",
                  "universeDomain"
               ],
               "title": "ServiceAccountCredential",
               "type": "object"
            },
            "Session": {
               "additionalProperties": false,
               "description": "Represents a series of interactions between a user and agents.",
               "properties": {
                  "id": {
                     "title": "Id",
                     "type": "string"
                  },
                  "appName": {
                     "title": "Appname",
                     "type": "string"
                  },
                  "userId": {
                     "title": "Userid",
                     "type": "string"
                  },
                  "state": {
                     "additionalProperties": true,
                     "title": "State",
                     "type": "object"
                  },
                  "events": {
                     "items": {
                        "$ref": "#/$defs/Event"
                     },
                     "title": "Events",
                     "type": "array"
                  },
                  "lastUpdateTime": {
                     "default": 0.0,
                     "title": "Lastupdatetime",
                     "type": "number"
                  }
               },
               "required": [
                  "id",
                  "appName",
                  "userId"
               ],
               "title": "Session",
               "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": "Configuration for a single speaker in a multi-speaker setup.",
               "properties": {
                  "speaker": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The name of the speaker. This should be the same as the speaker name used in the prompt.",
                     "title": "Speaker"
                  },
                  "voiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The configuration for the voice of this speaker."
                  }
               },
               "title": "SpeakerVoiceConfig",
               "type": "object"
            },
            "SpeechConfig": {
               "additionalProperties": false,
               "description": "Config for speech generation and transcription.",
               "properties": {
                  "voiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration in case of single-voice output."
                  },
                  "languageCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The language code (ISO 639-1) for the speech synthesis.",
                     "title": "Languagecode"
                  },
                  "multiSpeakerVoiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`."
                  }
               },
               "title": "SpeechConfig",
               "type": "object"
            },
            "StartSensitivity": {
               "description": "Start of speech sensitivity.",
               "enum": [
                  "START_SENSITIVITY_UNSPECIFIED",
                  "START_SENSITIVITY_HIGH",
                  "START_SENSITIVITY_LOW"
               ],
               "title": "StartSensitivity",
               "type": "string"
            },
            "StreamingMode": {
               "description": "Streaming modes for agent execution.\n\nThis enum defines different streaming behaviors for how the agent returns\nevents as model response.",
               "enum": [
                  null,
                  "sse",
                  "bidi"
               ],
               "title": "StreamingMode"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolConfirmation": {
               "additionalProperties": false,
               "description": "Represents a tool confirmation configuration.",
               "properties": {
                  "hint": {
                     "default": "",
                     "title": "Hint",
                     "type": "string"
                  },
                  "confirmed": {
                     "default": false,
                     "title": "Confirmed",
                     "type": "boolean"
                  },
                  "payload": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Payload"
                  }
               },
               "title": "ToolConfirmation",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolThreadPoolConfig": {
               "additionalProperties": false,
               "description": "Configuration for the tool thread pool executor.\n\nAttributes:\n  max_workers: Maximum number of worker threads in the pool. Defaults to 4.",
               "properties": {
                  "max_workers": {
                     "default": 4,
                     "description": "Maximum number of worker threads in the pool.",
                     "minimum": 1,
                     "title": "Max Workers",
                     "type": "integer"
                  }
               },
               "title": "ToolThreadPoolConfig",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "TrafficType": {
               "description": "Output only.\n\nThe traffic type for this request. This enum is not supported in Gemini API.",
               "enum": [
                  "TRAFFIC_TYPE_UNSPECIFIED",
                  "ON_DEMAND",
                  "ON_DEMAND_PRIORITY",
                  "ON_DEMAND_FLEX",
                  "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": "Optional. Transcription text.",
                     "title": "Text"
                  },
                  "finished": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The bool indicates the end of the transcription.",
                     "title": "Finished"
                  }
               },
               "title": "Transcription",
               "type": "object"
            },
            "TranscriptionEntry": {
               "additionalProperties": false,
               "description": "Store the data that can be used for transcription.",
               "properties": {
                  "role": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Role"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "$ref": "#/$defs/Content"
                        }
                     ],
                     "title": "Data"
                  }
               },
               "required": [
                  "data"
               ],
               "title": "TranscriptionEntry",
               "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",
                  "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"
               ],
               "title": "TurnCoverage",
               "type": "string"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            },
            "UiWidget": {
               "additionalProperties": false,
               "description": "Rendering metadata for a UI widget associated with an event.\n\nWhen present on an Event.actions, the UI renders the widget using the\nspecified provider's renderer component.",
               "properties": {
                  "id": {
                     "title": "Id",
                     "type": "string"
                  },
                  "provider": {
                     "title": "Provider",
                     "type": "string"
                  },
                  "payload": {
                     "additionalProperties": true,
                     "title": "Payload",
                     "type": "object"
                  }
               },
               "required": [
                  "id",
                  "provider"
               ],
               "title": "UiWidget",
               "type": "object"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "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": {
                  "replicatedVoiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ReplicatedVoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration for a replicated voice, which is a clone of a\n      user's voice that can be used for speech synthesis. If this is unset, a\n      default voice is used."
                  },
                  "prebuiltVoiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PrebuiltVoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration for a prebuilt voice."
                  }
               },
               "title": "VoiceConfig",
               "type": "object"
            },
            "VoiceConsentSignature": {
               "additionalProperties": false,
               "description": "The signature of the voice consent check.",
               "properties": {
                  "signature": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The signature string.\n      ",
                     "title": "Signature"
                  }
               },
               "title": "VoiceConsentSignature",
               "type": "object"
            }
         },
         "additionalProperties": false,
         "required": [
            "invocation_id",
            "session"
         ]
      }

  Fields:

    - `active_streaming_tools (dict[str, google.adk.agents.active_streaming_tool.ActiveStreamingTool] | None)`

    - `agent (google.adk.agents.base_agent.BaseAgent | google.adk.workflow._base_node.BaseNode | None)`

    - `agent_states (dict[str, dict[str, Any]])`

    - `artifact_service (google.adk.artifacts.base_artifact_service.BaseArtifactService | None)`

    - `branch (str | None)`

    - `canonical_tools_cache (list[google.adk.tools.base_tool.BaseTool] | None)`

    - `context_cache_config (google.adk.agents.context_cache_config.ContextCacheConfig | None)`

    - `credential_by_key (dict[str, google.adk.auth.auth_credential.AuthCredential])`

    - `credential_service (google.adk.auth.credential_service.base_credential_service.BaseCredentialService | None)`

    - `end_invocation (bool)`

    - `end_of_agents (dict[str, bool])`

    - `events_compaction_config (google.adk.apps._configs.EventsCompactionConfig | None)`

    - `input_realtime_cache (list[google.adk.agents.invocation_context.RealtimeCacheEntry] | None)`

    - `invocation_id (str)`

    - `isolation_scope (str | None)`

    - `live_request_queue (google.adk.agents.live_request_queue.LiveRequestQueue | None)`

    - `live_session_resumption_handle (str | None)`

    - `memory_service (google.adk.memory.base_memory_service.BaseMemoryService | None)`

    - `node_path (str | None)`

    - `output_realtime_cache (list[google.adk.agents.invocation_context.RealtimeCacheEntry] | None)`

    - `plugin_manager (google.adk.plugins.plugin_manager.PluginManager)`

    - `resumability_config (google.adk.apps._configs.ResumabilityConfig | None)`

    - `run_config (google.adk.agents.run_config.RunConfig | None)`

    - `session (google.adk.sessions.session.Session)`

    - `session_service (google.adk.sessions.base_session_service.BaseSessionService)`

    - `token_compaction_checked (bool)`

    - `transcription_cache (list[google.adk.agents.transcription_entry.TranscriptionEntry] | None)`

    - `user_content (google.genai.types.Content | None)`

  field active_streaming_tools: Optional[dict[str, ActiveStreamingTool]] = None

    The running streaming tools of this invocation.

  field agent: Optional[BaseAgent | BaseNode] = None

    The current agent of this invocation context.

    None when Runner drives a BaseNode (not a BaseAgent).

  field agent_states: dict[str, dict[str, Any]] [Optional]

    The state of the agent for this invocation.

  field artifact_service: Optional[BaseArtifactService] = None
  field branch: Optional[str] = None

    The branch of the invocation context.

    The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3.

    Branch is used when multiple sub-agents shouldn’t see their peer agents’ conversation history.

  field canonical_tools_cache: Optional[list[BaseTool]] = None

    The cache of canonical tools for this invocation.

  field context_cache_config: Optional[ContextCacheConfig] = None
  field credential_by_key: dict[str, AuthCredential] [Optional]

    The resolved credentials for this invocation, keyed by credential_key.

  field credential_service: Optional[BaseCredentialService] = None
  field end_invocation: bool = False

    Whether to end this invocation.

    Set to True in callbacks or tools to terminate this invocation.

  field end_of_agents: dict[str, bool] [Optional]

    The end of agent status for each agent in this invocation.

  field events_compaction_config: Optional[EventsCompactionConfig] = None

    The compaction config for this invocation.

  field input_realtime_cache: Optional[list[RealtimeCacheEntry]] = None

    Caches input audio chunks before flushing to session and artifact services.

  field invocation_id: str [Required]

    The id of this invocation context. Readonly.

  field isolation_scope: Optional[str] = None

    Scope tag for filtering session events visible to this agent.

    When set, the LLM content-builder restricts session events to those whose `event.isolation_scope` matches. One usage today is the Task API: task-mode and single_turn-mode agents are scoped under the originating function-call id; chat coordinators are unscoped and see only unscoped events.

    ⚠️ DO NOT USE THIS FIELD DIRECTLY. It is an internal mechanism that may change without notice.

  field live_request_queue: Optional[LiveRequestQueue] = None

    The queue to receive live requests.

  field live_session_resumption_handle: Optional[str] = None

    The handle for live session resumption.

  field memory_service: Optional[BaseMemoryService] = None
  field node_path: Optional[str] = None

    The path of the current agent in the workflow call stack.

    Used by workflow agents to track their position in nested agent hierarchies. Format: “agent_1/agent_2/agent_3” where agent_1 is the outermost workflow. None for non-workflow agents.

  field output_realtime_cache: Optional[list[RealtimeCacheEntry]] = None

    Caches output audio chunks before flushing to session and artifact services.

  field plugin_manager: PluginManager [Optional]

    The manager for keeping track of plugins in this invocation.

  field resumability_config: Optional[ResumabilityConfig] = None

    The resumability config that applies to all agents under this invocation.

  field run_config: Optional[RunConfig] = None

    Configurations for live agents under this invocation.

  field session: Session [Required]

    The current session of this invocation context. Readonly.

  field session_service: BaseSessionService [Required]
  field token_compaction_checked: bool = False

    Whether token-threshold compaction ran during this invocation.

  field transcription_cache: Optional[list[TranscriptionEntry]] = None

    Caches necessary data, audio or contents, that are needed by transcription.

  field user_content: Optional[types.Content] = None

    The user content that started this invocation. Readonly.

  increment_llm_call_count()

    Tracks number of llm calls made.

    Raises:

      LlmCallsLimitExceededError – If number of llm calls made exceed the set threshold.

  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.

  populate_invocation_agent_states()

    Populates agent states for the current invocation if it is resumable.

    For history events that contain agent state information, set the agent_state and end_of_agent of the agent that generated the event.

    For non-workflow agents, also set an initial agent_state if it has already generated some contents.

    Return type:

      `None`

  reset_sub_agent_states(agent_name)

    Resets the state of all sub-agents of the given agent in this invocation.

    Return type:

      `None`

    Parameters:

      agent_name – The name of the agent whose sub-agent states need to be reset.

  set_agent_state(agent_name, *, agent_state=None, end_of_agent=False)

    Sets the state of an agent in this invocation.

    - If end_of_agent is True, will set the end_of_agent flag to True and clear the agent_state.

    - Otherwise, if agent_state is not None, will set the agent_state and reset the end_of_agent flag to False.

    - Otherwise, will clear the agent_state and end_of_agent flag, to allow the agent to re-run.

    Parameters:

      - agent_name – The name of the agent.

      - agent_state – The state of the agent. Will be ignored if end_of_agent is True.

      - end_of_agent – Whether the agent has finished running.

    Return type:

      `None`

  should_pause_invocation(event)

    Returns whether to pause the invocation right after this event.

    “Pausing” an invocation is different from “ending” an invocation. A paused invocation can be resumed later, while an ended invocation cannot.

    Pausing the current agent’s run will also pause all the agents that depend on its execution, i.e. the subsequent agents in a workflow, and the current agent’s ancestors, etc.

    Note that parallel sibling agents won’t be affected, but their common ancestors will be paused after all the non-blocking sub-agents finished running.

    Return type:

      `bool`

    Should meet all following conditions to pause an invocation:

      1. The current event has a long running function call.

    Parameters:

      event – The current event.

    Returns:

      Whether to pause the invocation right after this event.

  property app_name: str
  property is_resumable: bool

    Returns whether the current invocation is resumable.

  property user_id: str

pydantic model google.adk.agents.LiveRequest

  Bases: `BaseModel`

  Request send to live agents.

  Show JSON schema

      {
         "title": "LiveRequest",
         "description": "Request send to live agents.",
         "type": "object",
         "properties": {
            "content": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "blob": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Blob"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "activity_start": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityStart"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "activity_end": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ActivityEnd"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "close": {
               "default": false,
               "title": "Close",
               "type": "boolean"
            }
         },
         "$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": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "startOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The start offset of the video.",
                     "title": "Startoffset"
                  }
               },
               "title": "VideoMetadata",
               "type": "object"
            }
         }
      }

  Fields:

    - `activity_end (google.genai.types.ActivityEnd | None)`

    - `activity_start (google.genai.types.ActivityStart | None)`

    - `blob (google.genai.types.Blob | None)`

    - `close (bool)`

    - `content (google.genai.types.Content | None)`

  field activity_end: Optional[types.ActivityEnd] = None

    If set, signal the end of user activity to the model.

    When multiple fields are set, they are processed by priority (highest first): activity_start > activity_end > blob > content.

  field activity_start: Optional[types.ActivityStart] = None

    If set, signal the start of user activity to the model.

    When multiple fields are set, they are processed by priority (highest first): activity_start > activity_end > blob > content.

  field blob: Optional[types.Blob] = None

    If set, send the blob to the model in realtime mode.

    When multiple fields are set, they are processed by priority (highest first): activity_start > activity_end > blob > content.

  field close: bool = False

    If set, close the queue. queue.shutdown() is only supported in Python 3.13+.

  field content: Optional[types.Content] = None

    If set, send the content to the model in turn-by-turn mode.

    When multiple fields are set, they are processed by priority (highest first): activity_start > activity_end > blob > content.

class google.adk.agents.LiveRequestQueue

  Bases: `object`

  Queue used to send LiveRequest in a live(bidirectional streaming) way.

  close()
  async get()
    Return type:

      `LiveRequest`

  send(req)
  send_activity_end()

    Sends an activity end signal to mark the end of user input.

  send_activity_start()

    Sends an activity start signal to mark the beginning of user input.

  send_content(content)
  send_realtime(blob)

pydantic model google.adk.agents.LlmAgent

  Bases: `BaseAgent`

  LLM-based Agent.

  Show JSON schema

      {
         "title": "LlmAgent",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            },
            "parent_agent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BaseAgent"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "sub_agents": {
               "items": {
                  "$ref": "#/$defs/BaseAgent"
               },
               "title": "Sub Agents",
               "type": "array"
            },
            "before_agent_callback": {
               "default": null,
               "title": "Before Agent Callback",
               "type": "null"
            },
            "after_agent_callback": {
               "default": null,
               "title": "After Agent Callback",
               "type": "null"
            },
            "model": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "$ref": "#/$defs/BaseLlm"
                  }
               ],
               "default": "",
               "title": "Model"
            },
            "instruction": {
               "default": "",
               "title": "Instruction",
               "type": "string"
            },
            "global_instruction": {
               "default": "",
               "title": "Global Instruction",
               "type": "string"
            },
            "static_instruction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "$ref": "#/$defs/File"
                  },
                  {
                     "$ref": "#/$defs/Part"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "type": "string"
                           },
                           {
                              "$ref": "#/$defs/File"
                           },
                           {
                              "$ref": "#/$defs/Part"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Static Instruction"
            },
            "tools": {
               "items": {
                  "anyOf": []
               },
               "title": "Tools",
               "type": "array"
            },
            "generate_content_config": {
               "default": null,
               "title": "Generate Content Config"
            },
            "mode": {
               "anyOf": [
                  {
                     "enum": [
                        "chat",
                        "task",
                        "single_turn"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Mode"
            },
            "parallel_worker": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Parallel Worker"
            },
            "disallow_transfer_to_parent": {
               "default": false,
               "title": "Disallow Transfer To Parent",
               "type": "boolean"
            },
            "disallow_transfer_to_peers": {
               "default": false,
               "title": "Disallow Transfer To Peers",
               "type": "boolean"
            },
            "include_contents": {
               "default": "default",
               "enum": [
                  "default",
                  "none"
               ],
               "title": "Include Contents",
               "type": "string"
            },
            "output_key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Key"
            },
            "planner": {
               "default": null,
               "title": "Planner"
            },
            "code_executor": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BaseCodeExecutor"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "before_model_callback": {
               "default": null,
               "title": "Before Model Callback",
               "type": "null"
            },
            "after_model_callback": {
               "default": null,
               "title": "After Model Callback",
               "type": "null"
            },
            "on_model_error_callback": {
               "default": null,
               "title": "On Model Error Callback",
               "type": "null"
            },
            "before_tool_callback": {
               "default": null,
               "title": "Before Tool Callback",
               "type": "null"
            },
            "after_tool_callback": {
               "default": null,
               "title": "After Tool Callback",
               "type": "null"
            },
            "on_tool_error_callback": {
               "default": null,
               "title": "On Tool Error Callback",
               "type": "null"
            }
         },
         "$defs": {
            "BaseAgent": {
               "additionalProperties": false,
               "description": "Base class for all agents in Agent Development Kit.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  },
                  "parent_agent": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/BaseAgent"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "sub_agents": {
                     "items": {
                        "$ref": "#/$defs/BaseAgent"
                     },
                     "title": "Sub Agents",
                     "type": "array"
                  },
                  "before_agent_callback": {
                     "default": null,
                     "title": "Before Agent Callback",
                     "type": "null"
                  },
                  "after_agent_callback": {
                     "default": null,
                     "title": "After Agent Callback",
                     "type": "null"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseAgent",
               "type": "object"
            },
            "BaseCodeExecutor": {
               "description": "Abstract base class for all code executors.\n\nThe code executor allows the agent to execute code blocks from model responses\nand incorporate the execution results into the final response.\n\nAttributes:\n  optimize_data_file: If true, extract and process data files from the model\n    request and attach them to the code executor. Supported data file\n    MimeTypes are [text/csv]. Default to False.\n  stateful: Whether the code executor is stateful. Default to False.\n  error_retry_attempts: The number of attempts to retry on consecutive code\n    execution errors. Default to 2.\n  code_block_delimiters: The list of the enclosing delimiters to identify the\n    code blocks.\n  execution_result_delimiters: The delimiters to format the code execution\n    result.\n  timeout_seconds: The fallback timeout in seconds for the code execution.",
               "properties": {
                  "optimize_data_file": {
                     "default": false,
                     "title": "Optimize Data File",
                     "type": "boolean"
                  },
                  "stateful": {
                     "default": false,
                     "title": "Stateful",
                     "type": "boolean"
                  },
                  "error_retry_attempts": {
                     "default": 2,
                     "title": "Error Retry Attempts",
                     "type": "integer"
                  },
                  "code_block_delimiters": {
                     "default": [
                        [
                           "```tool_code\n",
                           "\n```"
                        ],
                        [
                           "```python\n",
                           "\n```"
                        ]
                     ],
                     "items": {
                        "maxItems": 2,
                        "minItems": 2,
                        "prefixItems": [
                           {
                              "type": "string"
                           },
                           {
                              "type": "string"
                           }
                        ],
                        "type": "array"
                     },
                     "title": "Code Block Delimiters",
                     "type": "array"
                  },
                  "execution_result_delimiters": {
                     "default": [
                        "```tool_output\n",
                        "\n```"
                     ],
                     "maxItems": 2,
                     "minItems": 2,
                     "prefixItems": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "string"
                        }
                     ],
                     "title": "Execution Result Delimiters",
                     "type": "array"
                  },
                  "timeout_seconds": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout Seconds"
                  }
               },
               "title": "BaseCodeExecutor",
               "type": "object"
            },
            "BaseLlm": {
               "description": "The BaseLLM class.",
               "properties": {
                  "model": {
                     "title": "Model",
                     "type": "string"
                  }
               },
               "required": [
                  "model"
               ],
               "title": "BaseLlm",
               "type": "object"
            },
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "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": [
                        {
                           "additionalProperties": true,
                           "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.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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",
                  "REGISTERED"
               ],
               "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": {
                              "additionalProperties": true,
                              "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "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": [
            "name"
         ]
      }

  Fields:

    - `after_model_callback (Optional[AfterModelCallback])`

    - `after_tool_callback (Optional[AfterToolCallback])`

    - `before_model_callback (Optional[BeforeModelCallback])`

    - `before_tool_callback (Optional[BeforeToolCallback])`

    - `code_executor (Optional[BaseCodeExecutor])`

    - `disallow_transfer_to_parent (bool)`

    - `disallow_transfer_to_peers (bool)`

    - `generate_content_config (Optional[types.GenerateContentConfig])`

    - `global_instruction (Union[str, InstructionProvider])`

    - `include_contents (Literal['default', 'none'])`

    - `input_schema (Optional[type[BaseModel]])`

    - `instruction (Union[str, InstructionProvider])`

    - `mode (Literal['chat', 'task', 'single_turn'] | None)`

    - `model (Union[str, BaseLlm])`

    - `on_model_error_callback (Optional[OnModelErrorCallback])`

    - `on_tool_error_callback (Optional[OnToolErrorCallback])`

    - `output_key (Optional[str])`

    - `output_schema (Optional[SchemaType])`

    - `parallel_worker (bool | None)`

    - `planner (Optional[BasePlanner])`

    - `static_instruction (Optional[types.ContentUnion])`

    - `tools (list[ToolUnion])`

  Validators:

    - `__model_validator_after` » `all fields`

    - `validate_generate_content_config` » `generate_content_config`

  field after_model_callback: Optional[AfterModelCallback] = None

    Callback or list of callbacks to be called after calling the LLM.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      - callback_context – CallbackContext,

      - llm_response – LlmResponse, the actual model response.

    Returns:

      The content to return to the user. When present, the actual model response will be ignored and the provided content will be returned to user.

    Validated by:

      - `__model_validator_after`

  field after_tool_callback: Optional[AfterToolCallback] = None

    Callback or list of callbacks to be called after calling the tool.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      - tool – The tool to be called.

      - args – The arguments to the tool.

      - tool_context – ToolContext,

      - tool_response – The response from the tool.

    Returns:

      When present, the returned dict will be used as tool result.

    Validated by:

      - `__model_validator_after`

  field before_model_callback: Optional[BeforeModelCallback] = None

    Callback or list of callbacks to be called before calling the LLM.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      - callback_context – CallbackContext,

      - llm_request – LlmRequest, The raw model request. Callback can mutate the

      - request.

    Returns:

      The content to return to the user. When present, the model call will be skipped and the provided content will be returned to user.

    Validated by:

      - `__model_validator_after`

  field before_tool_callback: Optional[BeforeToolCallback] = None

    Callback or list of callbacks to be called before calling the tool.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      - tool – The tool to be called.

      - args – The arguments to the tool.

      - tool_context – ToolContext,

    Returns:

      The tool response. When present, the returned tool response will be used and the framework will skip calling the actual tool.

    Validated by:

      - `__model_validator_after`

  field code_executor: Optional[BaseCodeExecutor] = None

    Allow agent to execute code blocks from model responses using the provided CodeExecutor.

    Check out available code executions in google.adk.code_executor package.

    Note

    To use model’s built-in code executor, use the BuiltInCodeExecutor.

    Validated by:

      - `__model_validator_after`

  field disallow_transfer_to_parent: bool = False

    Disallows LLM-controlled transferring to the parent agent.

    NOTE: Setting this as True also prevents this agent from continuing to reply to the end-user, and will transfer control back to the parent agent in the next turn. This behavior prevents one-way transfer, in which end-user may be stuck with one agent that cannot transfer to other agents in the agent tree.

    Validated by:

      - `__model_validator_after`

  field disallow_transfer_to_peers: bool = False

    Disallows LLM-controlled transferring to the peer agents.

    Validated by:

      - `__model_validator_after`

  field generate_content_config: Optional[types.GenerateContentConfig] = None

    The additional content generation configurations.

    NOTE: not all fields are usable, e.g. tools must be configured via tools, thinking_config can be configured here or via the planner. If both are set, the planner’s configuration takes precedence.

    For example: use this config to adjust model temperature, configure safety settings, etc.

    Validated by:

      - `__model_validator_after`

      - `validate_generate_content_config`

  field global_instruction: Union[str, InstructionProvider] = ''

    Instructions for all the agents in the entire agent tree.

    DEPRECATED: This field is deprecated and will be removed in a future version. Use GlobalInstructionPlugin instead, which provides the same functionality at the App level. See migration guide for details.

    ONLY the global_instruction in root agent will take effect.

    For example: use global_instruction to make all agents have a stable identity or personality.

    Validated by:

      - `__model_validator_after`

  field include_contents: Literal['default', 'none'] = 'default'

    Controls content inclusion in model requests.

    Options:

      default: Model receives relevant conversation history none: Model receives no prior history, operates solely on current instruction and input

    Validated by:

      - `__model_validator_after`

  field input_schema: Optional[type[BaseModel]] = None

    The input schema when agent is used as a tool.

    Validated by:

      - `__model_validator_after`

  field instruction: Union[str, InstructionProvider] = ''

    Dynamic instructions for the LLM model, guiding the agent’s behavior.

    These instructions can contain placeholders like {variable_name} that will be resolved at runtime using session state and context.

    Behavior depends on static_instruction: - If static_instruction is None: instruction goes to system_instruction - If static_instruction is set: instruction goes to user content in the request

    This allows for context caching optimization where static content (static_instruction) comes first in the prompt, followed by dynamic content (instruction).

    Validated by:

      - `__model_validator_after`

  field mode: Literal['chat', 'task', 'single_turn'] | None = None

    The delegation mode for this agent.

    Options:

      chat: Standard chat agent reachable via transfer_to_agent. task: Task agent that chats with the user to accomplish a task. single_turn: Agents that complete a task without chatting with the user.

    Default value is chat as a sub-agent, single_turn as a node in a workflow.

    Validated by:

      - `__model_validator_after`

  field model: Union[str, BaseLlm] = ''

    The model to use for the agent.

    When not set, the agent will inherit the model from its ancestor. If no ancestor provides a model, the agent uses the default model configured via LlmAgent.set_default_model. The built-in default is gemini-2.5-flash.

    Validated by:

      - `__model_validator_after`

  field on_model_error_callback: Optional[OnModelErrorCallback] = None

    Callback or list of callbacks to be called when a model call encounters an error.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      - callback_context – CallbackContext,

      - llm_request – LlmRequest, The raw model request.

      - error – The error from the model call.

    Returns:

      The content to return to the user. When present, the error will be ignored and the provided content will be returned to user.

    Validated by:

      - `__model_validator_after`

  field on_tool_error_callback: Optional[OnToolErrorCallback] = None

    Callback or list of callbacks to be called when a tool call encounters an error.

    When a list of callbacks is provided, the callbacks will be called in the order they are listed until a callback does not return None.

    Parameters:

      - tool – The tool to be called.

      - args – The arguments to the tool.

      - tool_context – ToolContext,

      - error – The error from the tool call.

    Returns:

      When present, the returned dict will be used as tool result.

    Validated by:

      - `__model_validator_after`

  field output_key: Optional[str] = None

    The key in session state to store the output of the agent.

    Typically use cases: - Extracts agent reply for later use, such as in tools, callbacks, etc. - Connects agents to coordinate with each other.

    Validated by:

      - `__model_validator_after`

  field output_schema: Optional[SchemaType] = None

    The output schema when agent replies.

    Supports all schema types that the underlying Google GenAI API supports:

      - type[BaseModel]: e.g., MySchema

      - list[type[BaseModel]]: e.g., list[MySchema]

      - list[primitive]: e.g., list[str], list[int]

      - dict: Raw dict schemas

      - Schema: Google’s Schema type

    Note

    The ADK supports using output_schema and tools together. It works by exposing tools during the thought loop and enforcing structure only on the final output.

    Validated by:

      - `__model_validator_after`

  field parallel_worker: bool | None = None

    Whether to run the agent in parallel worker mode.

    Validated by:

      - `__model_validator_after`

  field planner: Optional[BasePlanner] = None

    Instructs the agent to make a plan and execute it step by step.

    Note

    To use model’s built-in thinking features, set the thinking_config field in google.adk.planners.built_in_planner.

    Validated by:

      - `__model_validator_after`

  field static_instruction: Optional[types.ContentUnion] = None

    Static instruction content sent literally as system instruction at the beginning.

    This field is for content that never changes and doesn’t contain placeholders. It’s sent directly to the model without any processing or variable substitution.

    This field is primarily for context caching optimization. Static instructions are sent as system instruction at the beginning of the request, allowing for improved performance when the static portion remains unchanged. Live API has its own cache mechanism, thus this field doesn’t work with Live API.

    Impact on instruction field: - When static_instruction is None: instruction → system_instruction - When static_instruction is set: instruction → user content (after static content)

    Context Caching: - Implicit Cache: Automatic caching by model providers (no config needed) - Explicit Cache: Cache explicitly created by user for instructions, tools and contents

    See below for more information of Implicit Cache and Explicit Cache Gemini API: https://ai.google.dev/gemini-api/docs/caching?lang=python Vertex API: https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview

    Setting static_instruction alone does NOT enable caching automatically. For explicit caching control, configure context_cache_config at App level.

    Content Support: Accepts types.ContentUnion which includes: - str: Simple text instruction - types.Content: Rich content object - types.Part: Single part (text, inline_data, file_data, etc.) - PIL.Image.Image: Image object - types.File: File reference - list[PartUnion]: List of parts

    Examples: ```python # Simple string instruction static_instruction = “You are a helpful assistant.”

    # Rich content with files static_instruction = types.Content(

    > role=’user’, parts=[

    > > types.Part(text=’You are a helpful assistant.’), types.Part(file_data=types.FileData(…))

    > ]

    ## )

    Validated by:

      - `__model_validator_after`

  field tools: list[ToolUnion] [Optional]

    Tools available to this agent.

    Validated by:

      - `__model_validator_after`

  classmethod set_default_live_model(model)

    Overrides the default model used for live mode when an agent has no model set.

    Return type:

      `None`

  classmethod set_default_model(model)

    Overrides the default model used when an agent has no model set.

    Return type:

      `None`

  validator validate_generate_content_config » generate_content_config
    Return type:

      `GenerateContentConfig`

  async canonical_global_instruction(ctx)

    The resolved self.instruction field to construct global instruction.

    This method is only for use by Agent Development Kit.

    Return type:

      `tuple`[`str`, `bool`]

    Parameters:

      ctx – The context to retrieve the session state.

    Returns:

      A tuple of (instruction, bypass_state_injection). instruction: The resolved self.global_instruction field. bypass_state_injection: Whether the instruction is based on InstructionProvider.

  async canonical_instruction(ctx)

    The resolved self.instruction field to construct instruction for this agent.

    This method is only for use by Agent Development Kit.

    Return type:

      `tuple`[`str`, `bool`]

    Parameters:

      ctx – The context to retrieve the session state.

    Returns:

      A tuple of (instruction, bypass_state_injection). instruction: The resolved self.instruction field. bypass_state_injection: Whether the instruction is based on InstructionProvider.

  async canonical_tools(ctx=None)

    The resolved self.tools field as a list of BaseTool based on the context.

    This method is only for use by Agent Development Kit.

    Return type:

      `list`[`BaseTool`]

  model_post_init(_LlmAgent__context)

    Provides a warning if multiple thinking configurations are found.

    Return type:

      `None`

  DEFAULT_LIVE_MODEL: ClassVar[str] = 'gemini-live-2.5-flash-native-audio'

    System default model used for live mode when no model is set on an agent.

  DEFAULT_MODEL: ClassVar[str] = 'gemini-2.5-flash'

    System default model used when no model is set on an agent.

  property canonical_after_model_callbacks: list[Callable[[Context, LlmResponse], Awaitable[LlmResponse | None] | LlmResponse | None]]

    The resolved self.after_model_callback field as a list of _SingleAfterModelCallback.

    This method is only for use by Agent Development Kit.

  property canonical_after_tool_callbacks: list[Callable[[BaseTool, dict[str, Any], Context, dict], Awaitable[dict | None] | dict | None] | list[Callable[[BaseTool, dict[str, Any], Context, dict], Awaitable[dict | None] | dict | None]]]

    The resolved self.after_tool_callback field as a list of AfterToolCallback.

    This method is only for use by Agent Development Kit.

  property canonical_before_model_callbacks: list[Callable[[Context, LlmRequest], Awaitable[LlmResponse | None] | LlmResponse | None]]

    The resolved self.before_model_callback field as a list of _SingleBeforeModelCallback.

    This method is only for use by Agent Development Kit.

  property canonical_before_tool_callbacks: list[Callable[[BaseTool, dict[str, Any], Context], Awaitable[dict | None] | dict | None] | list[Callable[[BaseTool, dict[str, Any], Context], Awaitable[dict | None] | dict | None]]]

    The resolved self.before_tool_callback field as a list of BeforeToolCallback.

    This method is only for use by Agent Development Kit.

  property canonical_live_model: BaseLlm

    The resolved self.model field as BaseLlm for live mode.

    This method is only for use by Agent Development Kit.

  property canonical_model: BaseLlm

    The resolved self.model field as BaseLlm.

    This method is only for use by Agent Development Kit.

  property canonical_on_model_error_callbacks: list[Callable[[Context, LlmRequest, Exception], Awaitable[LlmResponse | None] | LlmResponse | None]]

    The resolved self.on_model_error_callback field as a list of _SingleOnModelErrorCallback.

    This method is only for use by Agent Development Kit.

  property canonical_on_tool_error_callbacks: list[Callable[[BaseTool, dict[str, Any], Context, Exception], Awaitable[dict | None] | dict | None] | list[Callable[[BaseTool, dict[str, Any], Context, Exception], Awaitable[dict | None] | dict | None]]]

    The resolved self.on_tool_error_callback field as a list of OnToolErrorCallback.

    This method is only for use by Agent Development Kit.

pydantic model google.adk.agents.LoopAgent

  Bases: `BaseAgent`

  A shell agent that run its sub-agents in a loop.

  When sub-agent generates an event with escalate or max_iterations are reached, the loop agent will stop.

  Show JSON schema

      {
         "title": "LoopAgent",
         "description": "A shell agent that run its sub-agents in a loop.\n\nWhen sub-agent generates an event with escalate or max_iterations are\nreached, the loop agent will stop.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            },
            "parent_agent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BaseAgent"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "sub_agents": {
               "items": {
                  "$ref": "#/$defs/BaseAgent"
               },
               "title": "Sub Agents",
               "type": "array"
            },
            "before_agent_callback": {
               "default": null,
               "title": "Before Agent Callback",
               "type": "null"
            },
            "after_agent_callback": {
               "default": null,
               "title": "After Agent Callback",
               "type": "null"
            },
            "max_iterations": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Max Iterations"
            }
         },
         "$defs": {
            "BaseAgent": {
               "additionalProperties": false,
               "description": "Base class for all agents in Agent Development Kit.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  },
                  "parent_agent": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/BaseAgent"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "sub_agents": {
                     "items": {
                        "$ref": "#/$defs/BaseAgent"
                     },
                     "title": "Sub Agents",
                     "type": "array"
                  },
                  "before_agent_callback": {
                     "default": null,
                     "title": "Before Agent Callback",
                     "type": "null"
                  },
                  "after_agent_callback": {
                     "default": null,
                     "title": "After Agent Callback",
                     "type": "null"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseAgent",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "deprecated": true,
         "required": [
            "name"
         ]
      }

  Fields:

    - `max_iterations (Optional[int])`

  Validators:

  field max_iterations: Optional[int] = None

    The maximum number of iterations to run the loop agent.

    If not set, the loop agent will run indefinitely until a sub-agent escalates.

class google.adk.agents.McpInstructionProvider(connection_params, prompt_name, errlog=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)

  Bases: `Callable`[[`ReadonlyContext`], `str` | `Awaitable`[`str`]]

  Fetches agent instructions from an MCP server.

  Initializes the McpInstructionProvider.

  Parameters:

    - connection_params – Parameters for connecting to the MCP server.

    - prompt_name – The name of the MCP Prompt to fetch.

    - errlog – TextIO stream for error logging.

pydantic model google.adk.agents.ParallelAgent

  Bases: `BaseAgent`

  A shell agent that runs its sub-agents in parallel in an isolated manner.

  This approach is beneficial for scenarios requiring multiple perspectives or attempts on a single task, such as:

  - Running different algorithms simultaneously.

  - Generating multiple responses for review by a subsequent evaluation agent.

  Show JSON schema

      {
         "title": "ParallelAgent",
         "description": "A shell agent that runs its sub-agents in parallel in an isolated manner.\n\nThis approach is beneficial for scenarios requiring multiple perspectives or\nattempts on a single task, such as:\n\n- Running different algorithms simultaneously.\n- Generating multiple responses for review by a subsequent evaluation agent.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            },
            "parent_agent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BaseAgent"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "sub_agents": {
               "items": {
                  "$ref": "#/$defs/BaseAgent"
               },
               "title": "Sub Agents",
               "type": "array"
            },
            "before_agent_callback": {
               "default": null,
               "title": "Before Agent Callback",
               "type": "null"
            },
            "after_agent_callback": {
               "default": null,
               "title": "After Agent Callback",
               "type": "null"
            }
         },
         "$defs": {
            "BaseAgent": {
               "additionalProperties": false,
               "description": "Base class for all agents in Agent Development Kit.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  },
                  "parent_agent": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/BaseAgent"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "sub_agents": {
                     "items": {
                        "$ref": "#/$defs/BaseAgent"
                     },
                     "title": "Sub Agents",
                     "type": "array"
                  },
                  "before_agent_callback": {
                     "default": null,
                     "title": "Before Agent Callback",
                     "type": "null"
                  },
                  "after_agent_callback": {
                     "default": null,
                     "title": "After Agent Callback",
                     "type": "null"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseAgent",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "deprecated": true,
         "required": [
            "name"
         ]
      }

  Fields:

  Validators:

pydantic model google.adk.agents.RunConfig

  Bases: `BaseModel`

  Configs for runtime behavior of agents.

  The configs here will be overridden by agent-specific configurations.

  Show JSON schema

      {
         "title": "RunConfig",
         "description": "Configs for runtime behavior of agents.\n\nThe configs here will be overridden by agent-specific configurations.",
         "type": "object",
         "properties": {
            "speech_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SpeechConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "response_modalities": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Response Modalities"
            },
            "avatar_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AvatarConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "save_input_blobs_as_artifacts": {
               "default": false,
               "deprecated": true,
               "description": "Whether or not to save the input blobs as artifacts. DEPRECATED: Use SaveFilesAsArtifactsPlugin instead for better control and flexibility. See google.adk.plugins.SaveFilesAsArtifactsPlugin.",
               "title": "Save Input Blobs As Artifacts",
               "type": "boolean"
            },
            "support_cfc": {
               "default": false,
               "title": "Support Cfc",
               "type": "boolean"
            },
            "streaming_mode": {
               "$ref": "#/$defs/StreamingMode",
               "default": null
            },
            "output_audio_transcription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ]
            },
            "input_audio_transcription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AudioTranscriptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ]
            },
            "realtime_input_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RealtimeInputConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "enable_affective_dialog": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Enable Affective Dialog"
            },
            "proactivity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ProactivityConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "session_resumption": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SessionResumptionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "context_window_compression": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ContextWindowCompressionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "save_live_blob": {
               "default": false,
               "title": "Save Live Blob",
               "type": "boolean"
            },
            "tool_thread_pool_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolThreadPoolConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "save_live_audio": {
               "default": false,
               "deprecated": true,
               "description": "DEPRECATED: Use save_live_blob instead. If set to True, it saves live video and audio data to session and artifact service.",
               "title": "Save Live Audio",
               "type": "boolean"
            },
            "max_llm_calls": {
               "default": 500,
               "title": "Max Llm Calls",
               "type": "integer"
            },
            "custom_metadata": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Custom Metadata"
            },
            "get_session_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GetSessionConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "$defs": {
            "ActivityHandling": {
               "description": "The different ways of handling user activity.",
               "enum": [
                  "ACTIVITY_HANDLING_UNSPECIFIED",
                  "START_OF_ACTIVITY_INTERRUPTS",
                  "NO_INTERRUPTION"
               ],
               "title": "ActivityHandling",
               "type": "string"
            },
            "AudioTranscriptionConfig": {
               "additionalProperties": false,
               "description": "The audio transcription configuration in Setup.",
               "properties": {
                  "languageCodes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The language codes of the audio. BCP-47 language code. If not set, the transcription will be in the language detected by the model. If set, the server will use the language code specified in the model config as a hint for the language of the audio\n      ",
                     "title": "Languagecodes"
                  }
               },
               "title": "AudioTranscriptionConfig",
               "type": "object"
            },
            "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"
            },
            "AvatarConfig": {
               "additionalProperties": false,
               "description": "Configures the avatar to be used in the session.",
               "properties": {
                  "avatarName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Pre-built avatar id.",
                     "title": "Avatarname"
                  },
                  "customizedAvatar": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CustomizedAvatar"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Customized avatar appearance with a reference image."
                  },
                  "audioBitrateBps": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The bitrate of compressed audio.",
                     "title": "Audiobitratebps"
                  },
                  "videoBitrateBps": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The bitrate of compressed video output.",
                     "title": "Videobitratebps"
                  }
               },
               "title": "AvatarConfig",
               "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"
            },
            "CustomizedAvatar": {
               "additionalProperties": false,
               "description": "Configures the customized avatar to be used in the session.",
               "properties": {
                  "imageMimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The mime type of the reference image, e.g., \"image/jpeg\".",
                     "title": "Imagemimetype"
                  },
                  "imageData": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The data of the reference image. The dimensions of the reference\n      image should be 9:16 (portrait) with a minimum resolution of 704x1280.",
                     "title": "Imagedata"
                  }
               },
               "title": "CustomizedAvatar",
               "type": "object"
            },
            "EndSensitivity": {
               "description": "End of speech sensitivity.",
               "enum": [
                  "END_SENSITIVITY_UNSPECIFIED",
                  "END_SENSITIVITY_HIGH",
                  "END_SENSITIVITY_LOW"
               ],
               "title": "EndSensitivity",
               "type": "string"
            },
            "GetSessionConfig": {
               "description": "The configuration of getting a session.\n\nAttributes:\n  num_recent_events: The limit of recent events to get for the session.\n    Optional: if None, the filter is not applied; if greater than 0, returns\n      at most given number of recent events; if 0, no events are returned.\n  after_timestamp: The earliest timestamp of events to get for the session.\n    Optional: if None, the filter is not applied; otherwise, returns events\n      with timestamp >= the given time.",
               "properties": {
                  "num_recent_events": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Num Recent Events"
                  },
                  "after_timestamp": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "After Timestamp"
                  }
               },
               "title": "GetSessionConfig",
               "type": "object"
            },
            "MultiSpeakerVoiceConfig": {
               "additionalProperties": false,
               "description": "Configuration for a multi-speaker text-to-speech request.",
               "properties": {
                  "speakerVoiceConfigs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/SpeakerVoiceConfig"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.",
                     "title": "Speakervoiceconfigs"
                  }
               },
               "title": "MultiSpeakerVoiceConfig",
               "type": "object"
            },
            "PrebuiltVoiceConfig": {
               "additionalProperties": false,
               "description": "Configuration for a prebuilt voice.",
               "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"
            },
            "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"
            },
            "ReplicatedVoiceConfig": {
               "additionalProperties": false,
               "description": "The configuration for the replicated voice to use.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The mimetype of the voice sample. The only currently supported\n      value is `audio/wav`. This represents 16-bit signed little-endian wav\n      data, with a 24kHz sampling rate.\n      ",
                     "title": "Mimetype"
                  },
                  "voiceSampleAudio": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The sample of the custom voice.\n      ",
                     "title": "Voicesampleaudio"
                  },
                  "consentAudio": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Recorded consent verifying ownership of the voice. This\n      represents 16-bit signed little-endian wav data, with a 24kHz sampling\n      rate.",
                     "title": "Consentaudio"
                  },
                  "voiceConsentSignature": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VoiceConsentSignature"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Signature of a previously verified consent audio. This should be\n      populated with a signature generated by the server for a previous\n      request containing the consent_audio field. When provided, the\n      signature is verified instead of the consent_audio field to reduce\n      latency. Requests will fail if the signature is invalid or expired."
                  }
               },
               "title": "ReplicatedVoiceConfig",
               "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": "Configuration for a single speaker in a multi-speaker setup.",
               "properties": {
                  "speaker": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The name of the speaker. This should be the same as the speaker name used in the prompt.",
                     "title": "Speaker"
                  },
                  "voiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The configuration for the voice of this speaker."
                  }
               },
               "title": "SpeakerVoiceConfig",
               "type": "object"
            },
            "SpeechConfig": {
               "additionalProperties": false,
               "description": "Config for speech generation and transcription.",
               "properties": {
                  "voiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration in case of single-voice output."
                  },
                  "languageCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The language code (ISO 639-1) for the speech synthesis.",
                     "title": "Languagecode"
                  },
                  "multiSpeakerVoiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/MultiSpeakerVoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`."
                  }
               },
               "title": "SpeechConfig",
               "type": "object"
            },
            "StartSensitivity": {
               "description": "Start of speech sensitivity.",
               "enum": [
                  "START_SENSITIVITY_UNSPECIFIED",
                  "START_SENSITIVITY_HIGH",
                  "START_SENSITIVITY_LOW"
               ],
               "title": "StartSensitivity",
               "type": "string"
            },
            "StreamingMode": {
               "description": "Streaming modes for agent execution.\n\nThis enum defines different streaming behaviors for how the agent returns\nevents as model response.",
               "enum": [
                  null,
                  "sse",
                  "bidi"
               ],
               "title": "StreamingMode"
            },
            "ToolThreadPoolConfig": {
               "additionalProperties": false,
               "description": "Configuration for the tool thread pool executor.\n\nAttributes:\n  max_workers: Maximum number of worker threads in the pool. Defaults to 4.",
               "properties": {
                  "max_workers": {
                     "default": 4,
                     "description": "Maximum number of worker threads in the pool.",
                     "minimum": 1,
                     "title": "Max Workers",
                     "type": "integer"
                  }
               },
               "title": "ToolThreadPoolConfig",
               "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",
                  "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"
               ],
               "title": "TurnCoverage",
               "type": "string"
            },
            "VoiceConfig": {
               "additionalProperties": false,
               "description": "The configuration for the voice to use.",
               "properties": {
                  "replicatedVoiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ReplicatedVoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration for a replicated voice, which is a clone of a\n      user's voice that can be used for speech synthesis. If this is unset, a\n      default voice is used."
                  },
                  "prebuiltVoiceConfig": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PrebuiltVoiceConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The configuration for a prebuilt voice."
                  }
               },
               "title": "VoiceConfig",
               "type": "object"
            },
            "VoiceConsentSignature": {
               "additionalProperties": false,
               "description": "The signature of the voice consent check.",
               "properties": {
                  "signature": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The signature string.\n      ",
                     "title": "Signature"
                  }
               },
               "title": "VoiceConsentSignature",
               "type": "object"
            }
         },
         "additionalProperties": false
      }

  Fields:

    - `avatar_config (google.genai.types.AvatarConfig | None)`

    - `context_window_compression (google.genai.types.ContextWindowCompressionConfig | None)`

    - `custom_metadata (dict[str, Any] | None)`

    - `enable_affective_dialog (bool | None)`

    - `get_session_config (google.adk.sessions.base_session_service.GetSessionConfig | None)`

    - `input_audio_transcription (google.genai.types.AudioTranscriptionConfig | None)`

    - `max_llm_calls (int)`

    - `output_audio_transcription (google.genai.types.AudioTranscriptionConfig | None)`

    - `proactivity (google.genai.types.ProactivityConfig | None)`

    - `realtime_input_config (google.genai.types.RealtimeInputConfig | None)`

    - `response_modalities (list[str] | None)`

    - `save_input_blobs_as_artifacts (bool)`

    - `save_live_audio (bool)`

    - `save_live_blob (bool)`

    - `session_resumption (google.genai.types.SessionResumptionConfig | None)`

    - `speech_config (google.genai.types.SpeechConfig | None)`

    - `streaming_mode (google.adk.agents.run_config.StreamingMode)`

    - `support_cfc (bool)`

    - `tool_thread_pool_config (google.adk.agents.run_config.ToolThreadPoolConfig | None)`

  Validators:

    - `check_for_deprecated_save_live_audio` » `all fields`

    - `validate_max_llm_calls` » `max_llm_calls`

  field avatar_config: Optional[types.AvatarConfig] = None

    Avatar configuration for the live agent.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field context_window_compression: Optional[types.ContextWindowCompressionConfig] = None

    Configuration for context window compression. If set, this will enable context window compression for LLM input.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field custom_metadata: Optional[dict[str, Any]] = None

    Custom metadata for the current invocation.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field enable_affective_dialog: Optional[bool] = None

    If enabled, the model will detect emotions and adapt its responses accordingly.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field get_session_config: Optional[GetSessionConfig] = None

    Configuration for controlling which events are fetched when loading a session.

    When set, the Runner will pass this configuration to the session service’s `get_session` method, allowing the caller to limit the events returned (e.g. via `num_recent_events` or `after_timestamp`). This is especially useful in combination with `EventsCompactionConfig` to avoid loading the full event history on every invocation.

    Example:

        from google.adk.agents.run_config import RunConfig
        from google.adk.sessions.base_session_service import GetSessionConfig

        run_config = RunConfig(
            get_session_config=GetSessionConfig(num_recent_events=50),
        )

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field input_audio_transcription: Optional[types.AudioTranscriptionConfig] [Optional]

    Input transcription for live agents with audio input from user.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field max_llm_calls: int = 500

    A limit on the total number of llm calls for a given run.

    Valid Values:

      - More than 0 and less than sys.maxsize: The bound on the number of llm calls is enforced, if the value is set in this range.

      - Less than or equal to 0: This allows for unbounded number of llm calls.

    Validated by:

      - `check_for_deprecated_save_live_audio`

      - `validate_max_llm_calls`

  field output_audio_transcription: Optional[types.AudioTranscriptionConfig] [Optional]

    Output transcription for live agents with audio response.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field proactivity: Optional[types.ProactivityConfig] = None

    Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field realtime_input_config: Optional[types.RealtimeInputConfig] = None

    Realtime input config for live agents with audio input from user.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field response_modalities: Optional[list[str]] = None

    The output modalities. If not set, it’s default to AUDIO.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field save_live_blob: bool = False

    Saves live video and audio data to session and artifact service.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field session_resumption: Optional[types.SessionResumptionConfig] = None

    Configures session resumption mechanism. Only support transparent session resumption mode now.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field speech_config: Optional[types.SpeechConfig] = None

    Speech configuration for the live agent.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field streaming_mode: StreamingMode = StreamingMode.NONE

    Streaming mode, None or StreamingMode.SSE or StreamingMode.BIDI.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field support_cfc: bool = False

    Whether to support CFC (Compositional Function Calling). Only applicable for StreamingMode.SSE. If it’s true. the LIVE API will be invoked. Since only LIVE API supports CFC

    Warning

    This feature is experimental and its API or behavior may change in future releases.

    Validated by:

      - `check_for_deprecated_save_live_audio`

  field tool_thread_pool_config: Optional[ToolThreadPoolConfig] = None

    Configuration for running tools in a thread pool for live mode.

    When set, tool executions will run in a separate thread pool executor instead of the main event loop. When None (default), tools run in the main event loop.

    This helps keep the event loop responsive for: - User interruptions to be processed immediately - Model responses to continue being received

    Both sync and async tools are supported. Async tools are run in a new event loop within the background thread, which helps catch blocking I/O mistakenly used inside async functions.

    IMPORTANT - GIL (Global Interpreter Lock) Considerations:

    Thread pool HELPS with (GIL is released): - Blocking I/O: time.sleep(), network calls, file I/O, database queries - C extensions: numpy, hashlib, image processing libraries - Async functions containing blocking I/O (common user mistake)

    Thread pool does NOT help with (GIL is held): - Pure Python CPU-bound code: loops, calculations, recursive algorithms - The GIL prevents true parallel execution for Python bytecode

    For CPU-intensive Python code, consider alternatives: - Use C extensions that release the GIL - Break work into chunks with periodic await asyncio.sleep(0) - Use multiprocessing (ProcessPoolExecutor) for true parallelism

    Example

    ```python from google.adk.agents.run_config import RunConfig, ToolThreadPoolConfig

    # Enable thread pool with default settings run_config = RunConfig(

    > tool_thread_pool_config=ToolThreadPoolConfig(),

    )

    # Enable thread pool with custom max_workers run_config = RunConfig(

    > tool_thread_pool_config=ToolThreadPoolConfig(max_workers=8),

    ## )

    Validated by:

      - `check_for_deprecated_save_live_audio`

  validator check_for_deprecated_save_live_audio » all fields

    If save_live_audio is passed, use it to set save_live_blob.

    Return type:

      `Any`

  validator validate_max_llm_calls » max_llm_calls
    Return type:

      `int`

  save_input_blobs_as_artifacts: bool

    Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.

    msg

      The deprecation message to be emitted.

    wrapped_property

      The property instance if the deprecated field is a computed field, or None.

    field_name

      The name of the field being deprecated.

  save_live_audio: bool

    Read-only data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.

    msg

      The deprecation message to be emitted.

    wrapped_property

      The property instance if the deprecated field is a computed field, or None.

    field_name

      The name of the field being deprecated.

pydantic model google.adk.agents.SequentialAgent

  Bases: `BaseAgent`

  A shell agent that runs its sub-agents in sequence.

  Show JSON schema

      {
         "title": "SequentialAgent",
         "description": "A shell agent that runs its sub-agents in sequence.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            },
            "parent_agent": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/BaseAgent"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "sub_agents": {
               "items": {
                  "$ref": "#/$defs/BaseAgent"
               },
               "title": "Sub Agents",
               "type": "array"
            },
            "before_agent_callback": {
               "default": null,
               "title": "Before Agent Callback",
               "type": "null"
            },
            "after_agent_callback": {
               "default": null,
               "title": "After Agent Callback",
               "type": "null"
            }
         },
         "$defs": {
            "BaseAgent": {
               "additionalProperties": false,
               "description": "Base class for all agents in Agent Development Kit.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  },
                  "parent_agent": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/BaseAgent"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "sub_agents": {
                     "items": {
                        "$ref": "#/$defs/BaseAgent"
                     },
                     "title": "Sub Agents",
                     "type": "array"
                  },
                  "before_agent_callback": {
                     "default": null,
                     "title": "Before Agent Callback",
                     "type": "null"
                  },
                  "after_agent_callback": {
                     "default": null,
                     "title": "After Agent Callback",
                     "type": "null"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseAgent",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "deprecated": true,
         "required": [
            "name"
         ]
      }

  Fields:

  Validators:

# google.adk.apps module

# google.adk.artifacts module

class google.adk.artifacts.BaseArtifactService

  Bases: `ABC`

  Abstract base class for artifact services.

  abstractmethod async delete_artifact(*, app_name, user_id, filename, session_id=None)

    Deletes an artifact.

    Return type:

      `None`

    Parameters:

      - app_name – The name of the application.

      - user_id – The ID of the user.

      - filename – The name of the artifact file.

      - session_id – The ID of the session. If None, delete the user-scoped artifact.

  abstractmethod async get_artifact_version(*, app_name, user_id, filename, session_id=None, version=None)

    Gets the metadata for a specific version of an artifact.

    Return type:

      `Optional`[`ArtifactVersion`]

    Parameters:

      - app_name – The name of the application.

      - user_id – The ID of the user.

      - filename – The name of the artifact file.

      - session_id – The ID of the session. If None, the artifact will be fetched from the user-scoped artifacts. Otherwise, it will be fetched from the specified session.

      - version – The version number of the artifact to retrieve. If None, the latest version will be returned.

    Returns:

      An ArtifactVersion object containing the metadata of the specified artifact version, or None if the artifact version is not found.

  abstractmethod async list_artifact_keys(*, app_name, user_id, session_id=None)

    Lists all the artifact filenames within a session.

    Return type:

      `list`[`str`]

    Parameters:

      - app_name – The name of the application.

      - user_id – The ID of the user.

      - session_id – The ID of the session.

    Returns:

      A list of artifact filenames. If session_id is provided, returns both session-scoped and user-scoped artifact filenames. If session_id is None, returns user-scoped artifact filenames.

  abstractmethod async list_artifact_versions(*, app_name, user_id, filename, session_id=None)

    Lists all versions and their metadata for a specific artifact.

    Return type:

      `list`[`ArtifactVersion`]

    Parameters:

      - app_name – The name of the application.

      - user_id – The ID of the user.

      - filename – The name of the artifact file.

      - session_id – The ID of the session. If None, lists versions of the user-scoped artifact. Otherwise, lists versions of the artifact within the specified session.

    Returns:

      A list of ArtifactVersion objects, each representing a version of the artifact and its associated metadata.

  abstractmethod async list_versions(*, app_name, user_id, filename, session_id=None)

    Lists all versions of an artifact.

    Return type:

      `list`[`int`]

    Parameters:

      - app_name – The name of the application.

      - user_id – The ID of the user.

      - filename – The name of the artifact file.

      - session_id – The ID of the session. If None, only list the user-scoped artifacts versions.

    Returns:

      A list of all available versions of the artifact.

  abstractmethod async load_artifact(*, app_name, user_id, filename, session_id=None, version=None)

    Gets an artifact from the artifact service storage.

    The artifact is a file identified by the app name, user ID, session ID, and filename.

    Return type:

      `Optional`[`Part`]

    Parameters:

      - app_name – The app name.

      - user_id – The user ID.

      - filename – The filename of the artifact.

      - session_id – The session ID. If None, load the user-scoped artifact.

      - version – The version of the artifact. If None, the latest version will be returned.

    Returns:

      The artifact or None if not found.

  abstractmethod async save_artifact(*, app_name, user_id, filename, artifact, session_id=None, custom_metadata=None)

    Saves an artifact to the artifact service storage.

    The artifact is a file identified by the app name, user ID, session ID, and filename. After saving the artifact, a revision ID is returned to identify the artifact version.

    Return type:

      `int`

    Parameters:

      - app_name – The app name.

      - user_id – The user ID.

      - filename – The filename of the artifact.

      - artifact – The artifact to save. Accepts a `types.Part` instance or a plain dictionary (camelCase or snake_case keys) which will be normalized via `ensure_part`. If the artifact consists of `file_data`, the artifact service assumes its content has been uploaded separately, and this method will associate the `file_data` with the artifact if necessary.

      - session_id – The session ID. If None, the artifact is user-scoped.

      - custom_metadata – custom metadata to associate with the artifact.

    Returns:

      The revision ID. The first version of the artifact has a revision ID of 0. This is incremented by 1 after each successful save.

# google.adk.auth module

# google.adk.code_executors module

pydantic model google.adk.code_executors.BaseCodeExecutor

  Bases: `BaseModel`

  Abstract base class for all code executors.

  The code executor allows the agent to execute code blocks from model responses and incorporate the execution results into the final response.

  optimize_data_file

    If true, extract and process data files from the model request and attach them to the code executor. Supported data file MimeTypes are [text/csv]. Default to False.

  stateful

    Whether the code executor is stateful. Default to False.

  error_retry_attempts

    The number of attempts to retry on consecutive code execution errors. Default to 2.

  code_block_delimiters

    The list of the enclosing delimiters to identify the code blocks.

  execution_result_delimiters

    The delimiters to format the code execution result.

  timeout_seconds

    The fallback timeout in seconds for the code execution.

  Show JSON schema

      {
         "title": "BaseCodeExecutor",
         "description": "Abstract base class for all code executors.\n\nThe code executor allows the agent to execute code blocks from model responses\nand incorporate the execution results into the final response.\n\nAttributes:\n  optimize_data_file: If true, extract and process data files from the model\n    request and attach them to the code executor. Supported data file\n    MimeTypes are [text/csv]. Default to False.\n  stateful: Whether the code executor is stateful. Default to False.\n  error_retry_attempts: The number of attempts to retry on consecutive code\n    execution errors. Default to 2.\n  code_block_delimiters: The list of the enclosing delimiters to identify the\n    code blocks.\n  execution_result_delimiters: The delimiters to format the code execution\n    result.\n  timeout_seconds: The fallback timeout in seconds for the code execution.",
         "type": "object",
         "properties": {
            "optimize_data_file": {
               "default": false,
               "title": "Optimize Data File",
               "type": "boolean"
            },
            "stateful": {
               "default": false,
               "title": "Stateful",
               "type": "boolean"
            },
            "error_retry_attempts": {
               "default": 2,
               "title": "Error Retry Attempts",
               "type": "integer"
            },
            "code_block_delimiters": {
               "default": [
                  [
                     "```tool_code\n",
                     "\n```"
                  ],
                  [
                     "```python\n",
                     "\n```"
                  ]
               ],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "type": "string"
                     },
                     {
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Code Block Delimiters",
               "type": "array"
            },
            "execution_result_delimiters": {
               "default": [
                  "```tool_output\n",
                  "\n```"
               ],
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "string"
                  }
               ],
               "title": "Execution Result Delimiters",
               "type": "array"
            },
            "timeout_seconds": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout Seconds"
            }
         }
      }

  Fields:

    - `code_block_delimiters (List[tuple[str, str]])`

    - `error_retry_attempts (int)`

    - `execution_result_delimiters (tuple[str, str])`

    - `optimize_data_file (bool)`

    - `stateful (bool)`

    - `timeout_seconds (int | None)`

  field code_block_delimiters: List[tuple[str, str]] = [('```tool_code\n', '\n```'), ('```python\n', '\n```')]

    The list of the enclosing delimiters to identify the code blocks.

    For example, the delimiter (’``python\n', '\n``’) can be used to identify code blocks with the following format:

        ```python
        print("hello")
        ```

  field error_retry_attempts: int = 2

    The number of attempts to retry on consecutive code execution errors. Default to 2.

  field execution_result_delimiters: tuple[str, str] = ('```tool_output\n', '\n```')

    The delimiters to format the code execution result.

  field optimize_data_file: bool = False

    If true, extract and process data files from the model request and attach them to the code executor.

    Supported data file MimeTypes are [text/csv]. Default to False.

  field stateful: bool = False

    Whether the code executor is stateful. Default to False.

  field timeout_seconds: Optional[int] = None

    The timeout in seconds for the code execution.

  abstractmethod execute_code(invocation_context, code_execution_input)

    Executes code and return the code execution result.

    Return type:

      `CodeExecutionResult`

    Parameters:

      - invocation_context – The invocation context of the code execution.

      - code_execution_input – The code execution input.

    Returns:

      The code execution result.

pydantic model google.adk.code_executors.BuiltInCodeExecutor

  Bases: `BaseCodeExecutor`

  A code executor that uses the Model’s built-in code executor.

  Currently only supports Gemini 2.0+ models, but will be expanded to other models.

  Show JSON schema

      {
         "title": "BuiltInCodeExecutor",
         "description": "A code executor that uses the Model's built-in code executor.\n\nCurrently only supports Gemini 2.0+ models, but will be expanded to\nother models.",
         "type": "object",
         "properties": {
            "optimize_data_file": {
               "default": false,
               "title": "Optimize Data File",
               "type": "boolean"
            },
            "stateful": {
               "default": false,
               "title": "Stateful",
               "type": "boolean"
            },
            "error_retry_attempts": {
               "default": 2,
               "title": "Error Retry Attempts",
               "type": "integer"
            },
            "code_block_delimiters": {
               "default": [
                  [
                     "```tool_code\n",
                     "\n```"
                  ],
                  [
                     "```python\n",
                     "\n```"
                  ]
               ],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "type": "string"
                     },
                     {
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Code Block Delimiters",
               "type": "array"
            },
            "execution_result_delimiters": {
               "default": [
                  "```tool_output\n",
                  "\n```"
               ],
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "string"
                  }
               ],
               "title": "Execution Result Delimiters",
               "type": "array"
            },
            "timeout_seconds": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout Seconds"
            }
         }
      }

  Fields:

  execute_code(invocation_context, code_execution_input)

    Executes code and return the code execution result.

    Return type:

      `CodeExecutionResult`

    Parameters:

      - invocation_context – The invocation context of the code execution.

      - code_execution_input – The code execution input.

    Returns:

      The code execution result.

  process_llm_request(llm_request)

    Pre-process the LLM request for Gemini 2.0+ models to use the code execution tool.

    Return type:

      `None`

class google.adk.code_executors.CodeExecutorContext(session_state)

  Bases: `object`

  The persistent context used to configure the code executor.

  Initializes the code executor context.

  Parameters:

    session_state – The session state to get the code executor context from.

  add_input_files(input_files)

    Adds the input files to the code executor context.

    Parameters:

      input_files – The input files to add to the code executor context.

  add_processed_file_names(file_names)

    Adds the processed file name to the session state.

    Parameters:

      file_names – The processed file names to add to the session state.

  clear_input_files()

    Removes the input files and processed file names to the code executor context.

  get_error_count(invocation_id)

    Gets the error count from the session state.

    Return type:

      `int`

    Parameters:

      invocation_id – The invocation ID to get the error count for.

    Returns:

      The error count for the given invocation ID.

  get_execution_id()

    Gets the session ID for the code executor.

    Return type:

      `Optional`[`str`]

    Returns:

      The session ID for the code executor context.

  get_input_files()

    Gets the code executor input file names from the session state.

    Return type:

      `list`[`File`]

    Returns:

      A list of input files in the code executor context.

  get_processed_file_names()

    Gets the processed file names from the session state.

    Return type:

      `list`[`str`]

    Returns:

      A list of processed file names in the code executor context.

  get_state_delta()

    Gets the state delta to update in the persistent session state.

    Return type:

      `dict`[`str`, `Any`]

    Returns:

      The state delta to update in the persistent session state.

  increment_error_count(invocation_id)

    Increments the error count from the session state.

    Parameters:

      invocation_id – The invocation ID to increment the error count for.

  reset_error_count(invocation_id)

    Resets the error count from the session state.

    Parameters:

      invocation_id – The invocation ID to reset the error count for.

  set_execution_id(session_id)

    Sets the session ID for the code executor.

    Parameters:

      session_id – The session ID for the code executor.

  update_code_execution_result(invocation_id, code, result_stdout, result_stderr)

    Updates the code execution result.

    Parameters:

      - invocation_id – The invocation ID to update the code execution result for.

      - code – The code to execute.

      - result_stdout – The standard output of the code execution.

      - result_stderr – The standard error of the code execution.

pydantic model google.adk.code_executors.UnsafeLocalCodeExecutor

  Bases: `BaseCodeExecutor`

  A code executor that unsafely execute code in the current local context.

  Initializes the UnsafeLocalCodeExecutor.

  Show JSON schema

      {
         "title": "UnsafeLocalCodeExecutor",
         "description": "A code executor that unsafely execute code in the current local context.",
         "type": "object",
         "properties": {
            "optimize_data_file": {
               "default": false,
               "title": "Optimize Data File",
               "type": "boolean"
            },
            "stateful": {
               "default": false,
               "title": "Stateful",
               "type": "boolean"
            },
            "error_retry_attempts": {
               "default": 2,
               "title": "Error Retry Attempts",
               "type": "integer"
            },
            "code_block_delimiters": {
               "default": [
                  [
                     "```tool_code\n",
                     "\n```"
                  ],
                  [
                     "```python\n",
                     "\n```"
                  ]
               ],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "type": "string"
                     },
                     {
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Code Block Delimiters",
               "type": "array"
            },
            "execution_result_delimiters": {
               "default": [
                  "```tool_output\n",
                  "\n```"
               ],
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "string"
                  }
               ],
               "title": "Execution Result Delimiters",
               "type": "array"
            },
            "timeout_seconds": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout Seconds"
            }
         }
      }

  Fields:

    - `optimize_data_file (bool)`

    - `stateful (bool)`

  field optimize_data_file: bool = False

    If true, extract and process data files from the model request and attach them to the code executor.

    Supported data file MimeTypes are [text/csv]. Default to False.

  field stateful: bool = False

    Whether the code executor is stateful. Default to False.

  execute_code(invocation_context, code_execution_input)

    Executes code and return the code execution result.

    Return type:

      `CodeExecutionResult`

    Parameters:

      - invocation_context – The invocation context of the code execution.

      - code_execution_input – The code execution input.

    Returns:

      The code execution result.

# google.adk.environment module

Agent environments.

class google.adk.environment.BaseEnvironment(*args, **kwargs)

  Bases: `ABC`

  Abstract base class for code execution environments.

  An environment provides the ability to execute shell commands, read files, and write files within a working directory. Concrete implementations include local subprocess execution, sandboxed execution, container environments, and cloud-hosted environments.

  Lifecycle:

    1. Construct the environment (`__init__`).

    2. Call `initialize()` before first use.

    3. Use `execute`, `read_file`, `write_file`.

    4. Call `close()` when done.

  async close()

    Release resources held by the environment.

    Called when the environment is no longer needed. The default implementation is a no-op. Sub-classes should ensure this method is idempotent.

    Return type:

      `None`

  abstractmethod async execute(command, *, timeout=None)

    Execute a shell command in the working directory.

    Return type:

      `ExecutionResult`

    Parameters:

      - command – The shell command string to execute.

      - timeout – Maximum execution time in seconds. `None` means no limit.

    Returns:

      An `ExecutionResult` with exit code, stdout, stderr, and timeout status.

  async initialize()

    Initialize the environment (e.g. create working directory).

    Called before first use. The default implementation is a no-op. Sub-classes should ensure this method is idempotent.

    Return type:

      `None`

  abstractmethod async read_file(path)

    Read a file from the environment filesystem.

    Return type:

      `bytes`

    Parameters:

      path – Absolute or working-dir-relative path to the file.

    Returns:

      The raw file contents as bytes.

    Raises:

      FileNotFoundError – If the file does not exist.

  abstract property working_dir: Path

    The absolute path to the environment’s working directory.

  abstractmethod async write_file(path, content)

    Write content to a file in the environment’s filesystem.

    Parent directories are created automatically if they do not exist.

    Return type:

      `None`

    Parameters:

      - path – Absolute or working-dir-relative path to the file.

      - content – The string or raw bytes to write.

class google.adk.environment.ExecutionResult(exit_code=0, stdout='', stderr='', timed_out=False)

  Bases: `object`

  Result of a command execution.

  exit_code: `int` = 0

    The exit code of the process.

  stderr: `str` = ''

    Standard error captured from the process.

  stdout: `str` = ''

    Standard output captured from the process.

  timed_out: `bool` = False

    Whether the execution exceeded the timeout.

class google.adk.environment.LocalEnvironment(*, working_dir=None, env_vars=None)

  Bases: `BaseEnvironment`

  Execute commands via local `asyncio` subprocesses.

  When `working_dir` is not specified, a temporary directory is created on `initialize()` and removed on `close()`.

  Create a local environment.

  Parameters:

    - working_dir – Absolute path to the workspace directory. If `None`, a temporary directory is created during `initialize()`.

    - env_vars – Extra environment variables merged into the subprocess environment.

  async close()

    Release resources held by the environment.

    Called when the environment is no longer needed. The default implementation is a no-op. Sub-classes should ensure this method is idempotent.

    Return type:

      `None`

  async execute(command, *, timeout=None)

    Execute a shell command in the working directory.

    Return type:

      `ExecutionResult`

    Parameters:

      - command – The shell command string to execute.

      - timeout – Maximum execution time in seconds. `None` means no limit.

    Returns:

      An `ExecutionResult` with exit code, stdout, stderr, and timeout status.

  async initialize()

    Initialize the environment (e.g. create working directory).

    Called before first use. The default implementation is a no-op. Sub-classes should ensure this method is idempotent.

    Return type:

      `None`

  async read_file(path)

    Read a file from the environment filesystem.

    Return type:

      `bytes`

    Parameters:

      path – Absolute or working-dir-relative path to the file.

    Returns:

      The raw file contents as bytes.

    Raises:

      FileNotFoundError – If the file does not exist.

  property working_dir: Path

    The absolute path to the environment’s working directory.

  async write_file(path, content)

    Write content to a file in the environment’s filesystem.

    Parent directories are created automatically if they do not exist.

    Return type:

      `None`

    Parameters:

      - path – Absolute or working-dir-relative path to the file.

      - content – The string or raw bytes to write.

# google.adk.errors module

# google.adk.evaluation module

class google.adk.evaluation.AgentEvaluator

  Bases: `object`

  An evaluator for Agents, mainly intended for helping with test cases.

  async static evaluate(agent_module, eval_dataset_file_path_or_dir, num_runs=2, agent_name=None, initial_session_file=None, print_detailed_results=True)

    Evaluates an Agent given eval data.

    Parameters:

      - agent_module – The path to python module that contains the definition of the agent. There is convention in place here, where the code is going to look for ‘root_agent’ or ‘get_agent_async’ in the loaded module.

      - eval_dataset_file_path_or_dir – The eval data set. This can be either a string representing full path to the file containing eval dataset, or a directory that is recursively explored for all files that have a .test.json suffix.

      - num_runs – Number of times all entries in the eval dataset should be assessed.

      - agent_name – The name of the agent.

      - initial_session_file – File that contains initial session state that is needed by all the evals in the eval dataset.

      - print_detailed_results – Whether to print detailed results for each metric evaluation.

  async static evaluate_eval_set(agent_module, eval_set, criteria=None, eval_config=None, num_runs=2, agent_name=None, print_detailed_results=True)

    Evaluates an agent using the given EvalSet.

    Parameters:

      - agent_module – The path to python module that contains the definition of the agent. There is convention in place here, where the code is going to look for ‘root_agent’ or get_agent_async in the loaded module.

      - eval_set – The eval set.

      - criteria – Evaluation criteria, a dictionary of metric names to their respective thresholds. This field is deprecated.

      - eval_config – The evaluation config.

      - num_runs – Number of times all entries in the eval dataset should be assessed.

      - agent_name – The name of the agent, if trying to evaluate something other than root agent. If left empty or none, then root agent is evaluated.

      - print_detailed_results – Whether to print detailed results for each metric evaluation.

  static find_config_for_test_file(test_file)

    Find the test_config.json file in the same folder as the test file.

    Return type:

      `EvalConfig`

  static migrate_eval_data_to_new_schema(old_eval_data_file, new_eval_data_file, initial_session_file=None)

    A utility for migrating eval data to new schema backed by EvalSet.

# google.adk.events module

pydantic model google.adk.events.Event

  Bases: `LlmResponse`

  Represents an event in a conversation between agents and users.

  It is used to store the content of the conversation, as well as the actions taken by the agents like function calls, etc.

  Initializes the event.

  Supports convenience kwargs routed to actions or node_info:

    message: ContentUnion -> content (alias, converted via t_content) state: dict -> actions.state_delta route: value -> actions.route node_path: str -> node_info.path

  Show JSON schema

      {
         "title": "Event",
         "description": "Represents an event in a conversation between agents and users.\n\nIt is used to store the content of the conversation, as well as the actions\ntaken by the agents like function calls, etc.",
         "type": "object",
         "properties": {
            "modelVersion": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Modelversion"
            },
            "content": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Content"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "groundingMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GroundingMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "partial": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Partial"
            },
            "turnComplete": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Turncomplete"
            },
            "finishReason": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FinishReason"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "errorCode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Errorcode"
            },
            "errorMessage": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Errormessage"
            },
            "interrupted": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Interrupted"
            },
            "customMetadata": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Custommetadata"
            },
            "usageMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GenerateContentResponseUsageMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "liveSessionResumptionUpdate": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveServerSessionResumptionUpdate"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "liveSessionId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Livesessionid"
            },
            "goAway": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LiveServerGoAway"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "inputTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Transcription"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "outputTranscription": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Transcription"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "avgLogprobs": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Avglogprobs"
            },
            "logprobsResult": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LogprobsResult"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "cacheMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CacheMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "citationMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CitationMetadata"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "interactionId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Interactionid"
            },
            "invocationId": {
               "default": "",
               "title": "Invocationid",
               "type": "string"
            },
            "author": {
               "default": "",
               "title": "Author",
               "type": "string"
            },
            "actions": {
               "$ref": "#/$defs/EventActions"
            },
            "output": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output"
            },
            "nodeInfo": {
               "$ref": "#/$defs/NodeInfo"
            },
            "longRunningToolIds": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array",
                     "uniqueItems": true
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Longrunningtoolids"
            },
            "branch": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Branch"
            },
            "isolationScope": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Isolationscope"
            },
            "id": {
               "default": "",
               "title": "Id",
               "type": "string"
            },
            "timestamp": {
               "title": "Timestamp",
               "type": "number"
            }
         },
         "$defs": {
            "APIKey": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "apiKey"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "in": {
                     "$ref": "#/$defs/APIKeyIn"
                  },
                  "name": {
                     "title": "Name",
                     "type": "string"
                  }
               },
               "required": [
                  "in",
                  "name"
               ],
               "title": "APIKey",
               "type": "object"
            },
            "APIKeyIn": {
               "enum": [
                  "query",
                  "header",
                  "cookie"
               ],
               "title": "APIKeyIn",
               "type": "string"
            },
            "AuthConfig": {
               "additionalProperties": true,
               "description": "The auth config sent by tool asking client to collect auth credentials and\n\nadk and client will help to fill in the response",
               "properties": {
                  "authScheme": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/APIKey"
                        },
                        {
                           "$ref": "#/$defs/HTTPBase"
                        },
                        {
                           "$ref": "#/$defs/OAuth2"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnect"
                        },
                        {
                           "$ref": "#/$defs/HTTPBearer"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnectWithConfig"
                        },
                        {
                           "$ref": "#/$defs/CustomAuthScheme"
                        }
                     ],
                     "title": "Authscheme"
                  },
                  "rawAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "exchangedAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "credentialKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Credentialkey"
                  }
               },
               "required": [
                  "authScheme"
               ],
               "title": "AuthConfig",
               "type": "object"
            },
            "AuthCredential": {
               "additionalProperties": true,
               "description": "Data class representing an authentication credential.\n\nTo exchange for the actual credential, please use\nCredentialExchanger.exchange_credential().\n\nExamples: API Key Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    api_key=\"1234\",\n)\n\nExample: HTTP Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"basic\",\n        credentials=HttpCredentials(username=\"user\", password=\"password\"),\n    ),\n)\n\nExample: OAuth2 Bearer Token in HTTP Header\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"bearer\",\n        credentials=HttpCredentials(token=\"eyAkaknabna....\"),\n    ),\n)\n\nExample: OAuth2 Auth with Authorization Code Flow\nAuthCredential(\n    auth_type=AuthCredentialTypes.OAUTH2,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n    ),\n)\n\nExample: OpenID Connect Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n        redirect_uri=\"https://example.com\",\n        scopes=[\"scope1\", \"scope2\"],\n    ),\n)\n\nExample: Auth with resource reference\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    resource_ref=\"projects/1234/locations/us-central1/resources/resource1\",\n)",
               "properties": {
                  "authType": {
                     "$ref": "#/$defs/AuthCredentialTypes"
                  },
                  "resourceRef": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Resourceref"
                  },
                  "apiKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Apikey"
                  },
                  "http": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/HttpAuth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "serviceAccount": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccount"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "oauth2": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuth2Auth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "required": [
                  "authType"
               ],
               "title": "AuthCredential",
               "type": "object"
            },
            "AuthCredentialTypes": {
               "description": "Represents the type of authentication credential.",
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect",
                  "serviceAccount"
               ],
               "title": "AuthCredentialTypes",
               "type": "string"
            },
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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"
            },
            "CacheMetadata": {
               "additionalProperties": false,
               "description": "Metadata for context cache associated with LLM responses.\n\nThis class stores cache identification, usage tracking, and lifecycle\ninformation for a particular cache instance. It can be in two states:\n\n1. Active cache state: cache_name is set, all fields populated\n2. Fingerprint-only state: cache_name is None, only fingerprint and\n   contents_count are set for prefix matching\n\nToken counts (cached and total) are available in the LlmResponse.usage_metadata\nand should be accessed from there to avoid duplication.\n\nAttributes:\n    cache_name: The full resource name of the cached content (e.g.,\n        'projects/123/locations/us-central1/cachedContents/456').\n        None when no active cache exists (fingerprint-only state).\n    expire_time: Unix timestamp when the cache expires. None when no\n        active cache exists.\n    fingerprint: Hash of cacheable contents (instruction + tools + contents).\n        Always present for prefix matching.\n    invocations_used: Number of invocations this cache has been used for.\n        None when no active cache exists.\n    contents_count: Number of contents. When active cache exists, this is\n        the count of cached contents. When no active cache exists, this is\n        the total count of contents in the request.\n    created_at: Unix timestamp when the cache was created. None when\n        no active cache exists.",
               "properties": {
                  "cache_name": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Full resource name of the cached content (None if no active cache)",
                     "title": "Cache Name"
                  },
                  "expire_time": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unix timestamp when cache expires (None if no active cache)",
                     "title": "Expire Time"
                  },
                  "fingerprint": {
                     "description": "Hash of cacheable contents used to detect changes",
                     "title": "Fingerprint",
                     "type": "string"
                  },
                  "invocations_used": {
                     "anyOf": [
                        {
                           "minimum": 0,
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Number of invocations this cache has been used for (None if no active cache)",
                     "title": "Invocations Used"
                  },
                  "contents_count": {
                     "description": "Number of contents (cached contents when active cache exists, total contents in request when no active cache)",
                     "minimum": 0,
                     "title": "Contents Count",
                     "type": "integer"
                  },
                  "created_at": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unix timestamp when cache was created (None if no active cache)",
                     "title": "Created At"
                  }
               },
               "required": [
                  "fingerprint",
                  "contents_count"
               ],
               "title": "CacheMetadata",
               "type": "object"
            },
            "Citation": {
               "additionalProperties": false,
               "description": "A citation for a piece of generatedcontent.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "endIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The end index of the citation in the content.",
                     "title": "Endindex"
                  },
                  "license": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The license of the source of the citation.",
                     "title": "License"
                  },
                  "publicationDate": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GoogleTypeDate"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The publication date of the source of the citation."
                  },
                  "startIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The start index of the citation in the content.",
                     "title": "Startindex"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The title of the source of the citation.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The URI of the source of the citation.",
                     "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "CustomAuthScheme": {
               "additionalProperties": true,
               "description": "A flexible model for custom authentication schemes.\n\nThe subclasses must define a `default` for the `type_` field, if using OAuth2\nuser consent flow, to ensure correct rehydration.",
               "properties": {
                  "type": {
                     "title": "Type",
                     "type": "string"
                  }
               },
               "required": [
                  "type"
               ],
               "title": "CustomAuthScheme",
               "type": "object"
            },
            "EventActions": {
               "additionalProperties": false,
               "description": "Represents the actions attached to an event.",
               "properties": {
                  "skipSummarization": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Skipsummarization"
                  },
                  "stateDelta": {
                     "additionalProperties": true,
                     "title": "Statedelta",
                     "type": "object"
                  },
                  "artifactDelta": {
                     "additionalProperties": {
                        "type": "integer"
                     },
                     "title": "Artifactdelta",
                     "type": "object"
                  },
                  "transferToAgent": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Transfertoagent"
                  },
                  "escalate": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Escalate"
                  },
                  "requestedAuthConfigs": {
                     "additionalProperties": {
                        "$ref": "#/$defs/AuthConfig"
                     },
                     "title": "Requestedauthconfigs",
                     "type": "object"
                  },
                  "requestedToolConfirmations": {
                     "additionalProperties": {
                        "$ref": "#/$defs/ToolConfirmation"
                     },
                     "title": "Requestedtoolconfirmations",
                     "type": "object"
                  },
                  "compaction": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/EventCompaction"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "endOfAgent": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Endofagent"
                  },
                  "agentState": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Agentstate"
                  },
                  "rewindBeforeInvocationId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Rewindbeforeinvocationid"
                  },
                  "route": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "integer"
                        },
                        {
                           "type": "string"
                        },
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "boolean"
                                 },
                                 {
                                    "type": "integer"
                                 },
                                 {
                                    "type": "string"
                                 }
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Route"
                  },
                  "renderUiWidgets": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/UiWidget"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Renderuiwidgets"
                  },
                  "setModelResponse": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Setmodelresponse"
                  }
               },
               "title": "EventActions",
               "type": "object"
            },
            "EventCompaction": {
               "additionalProperties": false,
               "description": "The compaction of the events.",
               "properties": {
                  "startTimestamp": {
                     "title": "Starttimestamp",
                     "type": "number"
                  },
                  "endTimestamp": {
                     "title": "Endtimestamp",
                     "type": "number"
                  },
                  "compactedContent": {
                     "$ref": "#/$defs/Content"
                  }
               },
               "required": [
                  "startTimestamp",
                  "endTimestamp",
                  "compactedContent"
               ],
               "title": "EventCompaction",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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",
                  "UNEXPECTED_TOOL_CALL",
                  "IMAGE_PROHIBITED_CONTENT",
                  "NO_IMAGE",
                  "IMAGE_RECITATION",
                  "IMAGE_OTHER"
               ],
               "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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"
            },
            "GenerateContentResponseUsageMetadata": {
               "additionalProperties": false,
               "description": "Usage metadata about the content generation request and response.\n\nThis message provides a detailed breakdown of token usage and other relevant\nmetrics. This data type is not supported in Gemini API.",
               "properties": {
                  "cacheTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown of the token count for each modality in the cached content.",
                     "title": "Cachetokensdetails"
                  },
                  "cachedContentTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens in the cached content that was used for this request.",
                     "title": "Cachedcontenttokencount"
                  },
                  "candidatesTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens in the generated candidates.",
                     "title": "Candidatestokencount"
                  },
                  "candidatesTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown of the token count for each modality in the generated candidates.",
                     "title": "Candidatestokensdetails"
                  },
                  "promptTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also 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. A detailed breakdown of the token count for each modality in the prompt.",
                     "title": "Prompttokensdetails"
                  },
                  "thoughtsTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens that were part of the model's generated \"thoughts\" output, if applicable.",
                     "title": "Thoughtstokencount"
                  },
                  "toolUsePromptTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.",
                     "title": "Tooluseprompttokencount"
                  },
                  "toolUsePromptTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.",
                     "title": "Tooluseprompttokensdetails"
                  },
                  "totalTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.",
                     "title": "Totaltokencount"
                  },
                  "trafficType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/TrafficType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The traffic type for this request."
                  }
               },
               "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. This\ndata type is not supported in Gemini API.",
               "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": "A piece of evidence that supports a claim made by the model.\n\nThis is used to show a citation for a claim made by the model. When grounding\nis enabled, the model returns a `GroundingChunk` that contains a reference to\nthe source of the information.",
               "properties": {
                  "image": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkImage"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from an image search result. See the `Image` message for details."
                  },
                  "maps": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMaps"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A `Maps` chunk is a piece of evidence that comes from Google Maps.\n\n      It contains information about a place, such as its name, address, and\n      reviews. This is used to provide the user with rich, location-based\n      information."
                  },
                  "retrievedContext": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkRetrievedContext"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details"
                  },
                  "web": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkWeb"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from a web page, typically from Google Search. See the `Web` message for details."
                  }
               },
               "title": "GroundingChunk",
               "type": "object"
            },
            "GroundingChunkCustomMetadata": {
               "additionalProperties": false,
               "description": "User provided metadata about the GroundingFact.\n\nThis data type is not supported in Vertex AI.",
               "properties": {
                  "key": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The key of the metadata.",
                     "title": "Key"
                  },
                  "numericValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.",
                     "title": "Numericvalue"
                  },
                  "stringListValue": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkStringList"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A list of string values for the metadata."
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The string value of the metadata.",
                     "title": "Stringvalue"
                  }
               },
               "title": "GroundingChunkCustomMetadata",
               "type": "object"
            },
            "GroundingChunkImage": {
               "additionalProperties": false,
               "description": "An `Image` chunk is a piece of evidence that comes from an image search result.\n\nIt contains the URI of the image search result and the URI of the image. This\nis used to provide the user with a link to the source of the information.",
               "properties": {
                  "sourceUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the image search result page.",
                     "title": "Sourceuri"
                  },
                  "imageUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the image.",
                     "title": "Imageuri"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the image search result page.",
                     "title": "Title"
                  },
                  "domain": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The domain of the image search result page.",
                     "title": "Domain"
                  }
               },
               "title": "GroundingChunkImage",
               "type": "object"
            },
            "GroundingChunkMaps": {
               "additionalProperties": false,
               "description": "A `Maps` chunk is a piece of evidence that comes from Google Maps.\n\nIt contains information about a place, such as its name, address, and reviews.\nThis is used to provide the user with rich, location-based information.",
               "properties": {
                  "placeAnswerSources": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSources"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The sources that were used to generate the place answer.\n\n      This includes review snippets and photos that were used to generate the\n      answer, as well as URIs to flag content."
                  },
                  "placeId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "This Place's resource name, in `places/{place_id}` format.\n\n      This can be used to look up the place in the Google Maps API.",
                     "title": "Placeid"
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The text of the place answer.",
                     "title": "Text"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the place.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the place.",
                     "title": "Uri"
                  },
                  "route": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsRoute"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. Route information."
                  }
               },
               "title": "GroundingChunkMaps",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSources": {
               "additionalProperties": false,
               "description": "The sources that were used to generate the place answer.\n\nThis includes review snippets and photos that were used to generate the\nanswer, as well as URIs to flag content.",
               "properties": {
                  "reviewSnippet": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Snippets of reviews that were used to generate the answer.",
                     "title": "Reviewsnippet"
                  },
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link where users can flag a problem with the generated answer.",
                     "title": "Flagcontenturi"
                  },
                  "reviewSnippets": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Snippets of reviews that were used to generate the answer.",
                     "title": "Reviewsnippets"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSources",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution": {
               "additionalProperties": false,
               "description": "Author attribution for a photo or review.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Name of the author of the Photo or Review.",
                     "title": "Displayname"
                  },
                  "photoUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Profile photo URI of the author of the Photo or Review.",
                     "title": "Photouri"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "URI of the author of the Photo or Review.",
                     "title": "Uri"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSourcesReviewSnippet": {
               "additionalProperties": false,
               "description": "Encapsulates a review snippet.",
               "properties": {
                  "authorAttribution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "This review's author."
                  },
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link where users can flag a problem with the review.",
                     "title": "Flagcontenturi"
                  },
                  "googleMapsUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link to show the review on Google Maps.",
                     "title": "Googlemapsuri"
                  },
                  "relativePublishTimeDescription": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country.",
                     "title": "Relativepublishtimedescription"
                  },
                  "review": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A reference representing this place review which may be used to look up this place review again.",
                     "title": "Review"
                  },
                  "reviewId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Id of the review referencing the place.",
                     "title": "Reviewid"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Title of the review.",
                     "title": "Title"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSourcesReviewSnippet",
               "type": "object"
            },
            "GroundingChunkMapsRoute": {
               "additionalProperties": false,
               "description": "Route information from Google Maps.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "distanceMeters": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total distance of the route, in meters.",
                     "title": "Distancemeters"
                  },
                  "duration": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total duration of the route.",
                     "title": "Duration"
                  },
                  "encodedPolyline": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "An encoded polyline of the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm",
                     "title": "Encodedpolyline"
                  }
               },
               "title": "GroundingChunkMapsRoute",
               "type": "object"
            },
            "GroundingChunkRetrievedContext": {
               "additionalProperties": false,
               "description": "Context retrieved from a data source to ground the model's response.\n\nThis is used when a retrieval tool fetches information from a user-provided\ncorpus or a public dataset.",
               "properties": {
                  "documentName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. This field is not supported in Gemini API.",
                     "title": "Documentname"
                  },
                  "ragChunk": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RagChunk"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used. This field is not supported in Gemini API."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The content of the retrieved data source.",
                     "title": "Text"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the retrieved data source.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the retrieved data source.",
                     "title": "Uri"
                  },
                  "customMetadata": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkCustomMetadata"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. User-provided metadata about the retrieved context. This field is not supported in Vertex AI.",
                     "title": "Custommetadata"
                  },
                  "fileSearchStore": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`. This field is not supported in Vertex AI.",
                     "title": "Filesearchstore"
                  },
                  "pageNumber": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Page number of the retrieved context. This field is not supported in Vertex AI.",
                     "title": "Pagenumber"
                  },
                  "mediaId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Media ID. This field is not supported in Vertex AI.",
                     "title": "Mediaid"
                  }
               },
               "title": "GroundingChunkRetrievedContext",
               "type": "object"
            },
            "GroundingChunkStringList": {
               "additionalProperties": false,
               "description": "A list of string values. This data type is not supported in Vertex AI.",
               "properties": {
                  "values": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The string values of the list.",
                     "title": "Values"
                  }
               },
               "title": "GroundingChunkStringList",
               "type": "object"
            },
            "GroundingChunkWeb": {
               "additionalProperties": false,
               "description": "A `Web` chunk is a piece of evidence that comes from a web page.\n\nIt contains the URI of the web page, the title of the page, and the domain of\nthe page. This is used to provide the user with a link to the source of the\ninformation.",
               "properties": {
                  "domain": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The domain of the web page that contains the evidence. This can be used to filter out low-quality sources. This field is not supported in Gemini API.",
                     "title": "Domain"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the web page that contains the evidence.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the web page that contains the evidence.",
                     "title": "Uri"
                  }
               },
               "title": "GroundingChunkWeb",
               "type": "object"
            },
            "GroundingMetadata": {
               "additionalProperties": false,
               "description": "Information for various kinds of grounding.",
               "properties": {
                  "imageSearchQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The image search queries that were used to generate the content. This field is populated only when the grounding source is Google Search with the Image Search search_type enabled.",
                     "title": "Imagesearchqueries"
                  },
                  "groundingChunks": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunk"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of supporting references retrieved from the grounding\n      source. This field is populated when the grounding source is Google\n      Search, Vertex AI Search, or Google Maps.\n      ",
                     "title": "Groundingchunks"
                  },
                  "groundingSupports": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingSupport"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of grounding support.",
                     "title": "Groundingsupports"
                  },
                  "retrievalMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetrievalMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Metadata related to retrieval in the grounding flow."
                  },
                  "searchEntryPoint": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/SearchEntryPoint"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Google search entry for the following-up web\n      searches."
                  },
                  "webSearchQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Web search queries for the following-up web search.",
                     "title": "Websearchqueries"
                  },
                  "googleMapsWidgetContextToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.",
                     "title": "Googlemapswidgetcontexttoken"
                  },
                  "retrievalQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The queries that were executed by the retrieval tools. This field is populated only when the grounding source is a retrieval tool, such as Vertex AI Search. This field is not supported in Gemini API.",
                     "title": "Retrievalqueries"
                  },
                  "sourceFlaggingUris": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingMetadataSourceFlaggingUri"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps. This field is not supported in Gemini API.",
                     "title": "Sourceflagginguris"
                  }
               },
               "title": "GroundingMetadata",
               "type": "object"
            },
            "GroundingMetadataSourceFlaggingUri": {
               "additionalProperties": false,
               "description": "A URI that can be used to flag a place or review for inappropriate content.\n\nThis is populated only when the grounding source is Google Maps. This data\ntype is not supported in Gemini API.",
               "properties": {
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI that can be used to flag the content.",
                     "title": "Flagcontenturi"
                  },
                  "sourceId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The ID of the place or review.",
                     "title": "Sourceid"
                  }
               },
               "title": "GroundingMetadataSourceFlaggingUri",
               "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.\n\n      Ranges from 0 to 1. 1 is the most confident. This list must have the\n      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\n      citations associated with the claim. For instance [1,3,4] means that\n      grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the\n      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."
                  },
                  "renderedParts": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "integer"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Indices into the `rendered_parts` field of the `GroundingMetadata` message. These indices specify which rendered parts are associated with this support message.",
                     "title": "Renderedparts"
                  }
               },
               "title": "GroundingSupport",
               "type": "object"
            },
            "HTTPBase": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  }
               },
               "required": [
                  "scheme"
               ],
               "title": "HTTPBase",
               "type": "object"
            },
            "HTTPBearer": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "const": "bearer",
                     "default": "bearer",
                     "title": "Scheme",
                     "type": "string"
                  },
                  "bearerFormat": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Bearerformat"
                  }
               },
               "title": "HTTPBearer",
               "type": "object"
            },
            "HttpAuth": {
               "additionalProperties": true,
               "description": "The credentials and metadata for HTTP authentication.",
               "properties": {
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  },
                  "credentials": {
                     "$ref": "#/$defs/HttpCredentials"
                  },
                  "additionalHeaders": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "type": "string"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Additionalheaders"
                  }
               },
               "required": [
                  "scheme",
                  "credentials"
               ],
               "title": "HttpAuth",
               "type": "object"
            },
            "HttpCredentials": {
               "additionalProperties": true,
               "description": "Represents the secret token value for HTTP authentication, like user name, password, oauth token, etc.",
               "properties": {
                  "username": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Username"
                  },
                  "password": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Password"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token"
                  }
               },
               "title": "HttpCredentials",
               "type": "object"
            },
            "Language": {
               "description": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "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"
            },
            "LogprobsResult": {
               "additionalProperties": false,
               "description": "The log probabilities of the tokens generated by the model.\n\nThis is useful for understanding the model's confidence in its predictions and\nfor debugging. For example, you can use log probabilities to identify when the\nmodel is making a less confident prediction or to explore alternative\nresponses that the model considered. A low log probability can also indicate\nthat the model is \"hallucinating\" or generating factually incorrect\ninformation.",
               "properties": {
                  "chosenCandidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultCandidate"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of the chosen candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps. Note that the chosen candidate might not be in `top_candidates`.",
                     "title": "Chosencandidates"
                  },
                  "topCandidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultTopCandidates"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of the top candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps.",
                     "title": "Topcandidates"
                  },
                  "logProbabilitySum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Sum of log probabilities for all tokens. This field is not supported in Vertex AI.",
                     "title": "Logprobabilitysum"
                  }
               },
               "title": "LogprobsResult",
               "type": "object"
            },
            "LogprobsResultCandidate": {
               "additionalProperties": false,
               "description": "A single token and its associated log probability.",
               "properties": {
                  "logProbability": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.",
                     "title": "Logprobability"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The token's string representation.",
                     "title": "Token"
                  },
                  "tokenId": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary.",
                     "title": "Tokenid"
                  }
               },
               "title": "LogprobsResultCandidate",
               "type": "object"
            },
            "LogprobsResultTopCandidates": {
               "additionalProperties": false,
               "description": "A list of the top candidate tokens and their log probabilities at each decoding step.\n\nThis can be used to see what other tokens the model considered.",
               "properties": {
                  "candidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultCandidate"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The list of candidate tokens, 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": "The number of tokens counted for this modality.",
                     "title": "Tokencount"
                  }
               },
               "title": "ModalityTokenCount",
               "type": "object"
            },
            "NodeInfo": {
               "description": "Workflow node metadata attached to an Event.",
               "properties": {
                  "path": {
                     "default": "",
                     "title": "Path",
                     "type": "string"
                  },
                  "outputFor": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Outputfor"
                  },
                  "messageAsOutput": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Messageasoutput"
                  }
               },
               "title": "NodeInfo",
               "type": "object"
            },
            "OAuth2": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "oauth2"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "flows": {
                     "$ref": "#/$defs/OAuthFlows"
                  }
               },
               "required": [
                  "flows"
               ],
               "title": "OAuth2",
               "type": "object"
            },
            "OAuth2Auth": {
               "additionalProperties": true,
               "description": "Represents credential value and its metadata for a OAuth2 credential.",
               "properties": {
                  "clientId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientid"
                  },
                  "clientSecret": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientsecret"
                  },
                  "authUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authuri"
                  },
                  "nonce": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Nonce"
                  },
                  "state": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State"
                  },
                  "redirectUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Redirecturi"
                  },
                  "authResponseUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authresponseuri"
                  },
                  "authCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authcode"
                  },
                  "accessToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Accesstoken"
                  },
                  "refreshToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshtoken"
                  },
                  "idToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Idtoken"
                  },
                  "expiresAt": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresat"
                  },
                  "expiresIn": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresin"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  },
                  "codeVerifier": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codeverifier"
                  },
                  "codeChallengeMethod": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codechallengemethod"
                  },
                  "tokenEndpointAuthMethod": {
                     "anyOf": [
                        {
                           "enum": [
                              "client_secret_basic",
                              "client_secret_post",
                              "client_secret_jwt",
                              "private_key_jwt"
                           ],
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": "client_secret_basic",
                     "title": "Tokenendpointauthmethod"
                  }
               },
               "title": "OAuth2Auth",
               "type": "object"
            },
            "OAuthFlowAuthorizationCode": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl",
                  "tokenUrl"
               ],
               "title": "OAuthFlowAuthorizationCode",
               "type": "object"
            },
            "OAuthFlowClientCredentials": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowClientCredentials",
               "type": "object"
            },
            "OAuthFlowImplicit": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl"
               ],
               "title": "OAuthFlowImplicit",
               "type": "object"
            },
            "OAuthFlowPassword": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowPassword",
               "type": "object"
            },
            "OAuthFlows": {
               "additionalProperties": true,
               "properties": {
                  "implicit": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowImplicit"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "password": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowPassword"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "clientCredentials": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowClientCredentials"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "authorizationCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowAuthorizationCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "title": "OAuthFlows",
               "type": "object"
            },
            "OpenIdConnect": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "openIdConnectUrl": {
                     "title": "Openidconnecturl",
                     "type": "string"
                  }
               },
               "required": [
                  "openIdConnectUrl"
               ],
               "title": "OpenIdConnect",
               "type": "object"
            },
            "OpenIdConnectWithConfig": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "authorization_endpoint": {
                     "title": "Authorization Endpoint",
                     "type": "string"
                  },
                  "token_endpoint": {
                     "title": "Token Endpoint",
                     "type": "string"
                  },
                  "userinfo_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Userinfo Endpoint"
                  },
                  "revocation_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Revocation Endpoint"
                  },
                  "token_endpoint_auth_methods_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token Endpoint Auth Methods Supported"
                  },
                  "grant_types_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Grant Types Supported"
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  }
               },
               "required": [
                  "authorization_endpoint",
                  "token_endpoint"
               ],
               "title": "OpenIdConnectWithConfig",
               "type": "object"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "RagChunk": {
               "additionalProperties": false,
               "description": "A RagChunk includes the content of a chunk of a RagFile, and associated metadata.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "pageSpan": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RagChunkPageSpan"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "If populated, represents where the chunk starts and ends in the document."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The content of the chunk.",
                     "title": "Text"
                  }
               },
               "title": "RagChunk",
               "type": "object"
            },
            "RagChunkPageSpan": {
               "additionalProperties": false,
               "description": "Represents where the chunk starts and ends in the document.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "firstPage": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Page where chunk starts in the document. Inclusive. 1-indexed.",
                     "title": "Firstpage"
                  },
                  "lastPage": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Page where chunk ends in the document. Inclusive. 1-indexed.",
                     "title": "Lastpage"
                  }
               },
               "title": "RagChunkPageSpan",
               "type": "object"
            },
            "RetrievalMetadata": {
               "additionalProperties": false,
               "description": "Metadata returned to client when grounding is enabled.",
               "properties": {
                  "googleSearchDynamicRetrievalScore": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Score indicating how likely information from google\n      search could help answer the prompt. The score is in the range [0, 1],\n      where 0 is the least likely and 1 is the most likely. This score is only\n      populated when google search grounding and dynamic retrieval is enabled.\n      It will be compared to the threshold to determine whether to trigger\n      Google search.",
                     "title": "Googlesearchdynamicretrievalscore"
                  }
               },
               "title": "RetrievalMetadata",
               "type": "object"
            },
            "SearchEntryPoint": {
               "additionalProperties": false,
               "description": "The entry point used to search for grounding sources.",
               "properties": {
                  "renderedContent": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Web content snippet that can be embedded in a web page\n      or an app webview.",
                     "title": "Renderedcontent"
                  },
                  "sdkBlob": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. JSON representing array of tuples.",
                     "title": "Sdkblob"
                  }
               },
               "title": "SearchEntryPoint",
               "type": "object"
            },
            "SecuritySchemeType": {
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect"
               ],
               "title": "SecuritySchemeType",
               "type": "string"
            },
            "Segment": {
               "additionalProperties": false,
               "description": "Segment of the content this support belongs to.",
               "properties": {
                  "startIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. Start index in the given Part, measured in bytes.\n\n      Offset from the start of the Part, inclusive, starting at zero.",
                     "title": "Startindex"
                  },
                  "endIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. End index in the given Part, measured in bytes.\n\n      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\n      Content object.",
                     "title": "Partindex"
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The text corresponding to the segment from the\n      response.",
                     "title": "Text"
                  }
               },
               "title": "Segment",
               "type": "object"
            },
            "ServiceAccount": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  service_account_credential: The service account credential (JSON key).\n  scopes: The OAuth2 scopes to request. Optional; when omitted with\n      ``use_default_credential=True``, defaults to the cloud-platform scope.\n  use_default_credential: Whether to use Application Default Credentials.\n  use_id_token: Whether to exchange for an ID token instead of an access\n      token. Required for service-to-service authentication with Cloud Run,\n      Cloud Functions, and other Google Cloud services that require identity\n      verification. When True, ``audience`` must also be set.\n  audience: The target audience for the ID token, typically the URL of the\n      receiving service (e.g. ``https://my-service-xyz.run.app``). Required\n      when ``use_id_token`` is True.",
               "properties": {
                  "serviceAccountCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccountCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  },
                  "useDefaultCredential": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Usedefaultcredential"
                  },
                  "useIdToken": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Useidtoken"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  }
               },
               "title": "ServiceAccount",
               "type": "object"
            },
            "ServiceAccountCredential": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  type: The type should be \"service_account\".\n  project_id: The project ID.\n  private_key_id: The ID of the private key.\n  private_key: The private key.\n  client_email: The client email.\n  client_id: The client ID.\n  auth_uri: The authorization URI.\n  token_uri: The token URI.\n  auth_provider_x509_cert_url: URL for auth provider's X.509 cert.\n  client_x509_cert_url: URL for the client's X.509 cert.\n  universe_domain: The universe domain.\n\nExample:\n\n    config = ServiceAccountCredential(\n        type_=\"service_account\",\n        project_id=\"your_project_id\",\n        private_key_id=\"your_private_key_id\",\n        private_key=\"-----BEGIN PRIVATE KEY-----...\",\n        client_email=\"...@....iam.gserviceaccount.com\",\n        client_id=\"your_client_id\",\n        auth_uri=\"https://accounts.google.com/o/oauth2/auth\",\n        token_uri=\"https://oauth2.googleapis.com/token\",\n        auth_provider_x509_cert_url=\"https://www.googleapis.com/oauth2/v1/certs\",\n        client_x509_cert_url=\"https://www.googleapis.com/robot/v1/metadata/x509/...\",\n        universe_domain=\"googleapis.com\"\n    )\n\n\n    config = ServiceAccountConfig.model_construct(**{\n        ...service account config dict\n    })",
               "properties": {
                  "type": {
                     "default": "",
                     "title": "Type",
                     "type": "string"
                  },
                  "projectId": {
                     "title": "Projectid",
                     "type": "string"
                  },
                  "privateKeyId": {
                     "title": "Privatekeyid",
                     "type": "string"
                  },
                  "privateKey": {
                     "title": "Privatekey",
                     "type": "string"
                  },
                  "clientEmail": {
                     "title": "Clientemail",
                     "type": "string"
                  },
                  "clientId": {
                     "title": "Clientid",
                     "type": "string"
                  },
                  "authUri": {
                     "title": "Authuri",
                     "type": "string"
                  },
                  "tokenUri": {
                     "title": "Tokenuri",
                     "type": "string"
                  },
                  "authProviderX509CertUrl": {
                     "title": "Authproviderx509Certurl",
                     "type": "string"
                  },
                  "clientX509CertUrl": {
                     "title": "Clientx509Certurl",
                     "type": "string"
                  },
                  "universeDomain": {
                     "title": "Universedomain",
                     "type": "string"
                  }
               },
               "required": [
                  "projectId",
                  "privateKeyId",
                  "privateKey",
                  "clientEmail",
                  "clientId",
                  "authUri",
                  "tokenUri",
                  "authProviderX509CertUrl",
                  "clientX509CertUrl",
                  "universeDomain"
               ],
               "title": "ServiceAccountCredential",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolConfirmation": {
               "additionalProperties": false,
               "description": "Represents a tool confirmation configuration.",
               "properties": {
                  "hint": {
                     "default": "",
                     "title": "Hint",
                     "type": "string"
                  },
                  "confirmed": {
                     "default": false,
                     "title": "Confirmed",
                     "type": "boolean"
                  },
                  "payload": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Payload"
                  }
               },
               "title": "ToolConfirmation",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "TrafficType": {
               "description": "Output only.\n\nThe traffic type for this request. This enum is not supported in Gemini API.",
               "enum": [
                  "TRAFFIC_TYPE_UNSPECIFIED",
                  "ON_DEMAND",
                  "ON_DEMAND_PRIORITY",
                  "ON_DEMAND_FLEX",
                  "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": "Optional. Transcription text.",
                     "title": "Text"
                  },
                  "finished": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The bool indicates the end of the transcription.",
                     "title": "Finished"
                  }
               },
               "title": "Transcription",
               "type": "object"
            },
            "UiWidget": {
               "additionalProperties": false,
               "description": "Rendering metadata for a UI widget associated with an event.\n\nWhen present on an Event.actions, the UI renders the widget using the\nspecified provider's renderer component.",
               "properties": {
                  "id": {
                     "title": "Id",
                     "type": "string"
                  },
                  "provider": {
                     "title": "Provider",
                     "type": "string"
                  },
                  "payload": {
                     "additionalProperties": true,
                     "title": "Payload",
                     "type": "object"
                  }
               },
               "required": [
                  "id",
                  "provider"
               ],
               "title": "UiWidget",
               "type": "object"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "startOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The start offset of the video.",
                     "title": "Startoffset"
                  }
               },
               "title": "VideoMetadata",
               "type": "object"
            }
         }
      }

  Fields:

    - `actions (google.adk.events.event_actions.EventActions)`

    - `author (str)`

    - `branch (str | None)`

    - `id (str)`

    - `invocation_id (str)`

    - `isolation_scope (str | None)`

    - `long_running_tool_ids (set[str] | None)`

    - `node_info (google.adk.events.event.NodeInfo)`

    - `output (Any | None)`

    - `timestamp (float)`

  field actions: EventActions [Optional]

    The actions taken by the agent.

  field author: str = ''

    ‘user’ or the name of the agent, indicating who appended the event to the session.

  field branch: str | None = None

    The branch of the event.

    The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3.

    Branch is used when multiple sub-agent shouldn’t see their peer agents’ conversation history.

  field id: str = ''

    The unique identifier of the event.

  field invocation_id: str = '' (alias 'invocationId')

    The invocation ID of the event. Should be non-empty before appending to a session.

  field isolation_scope: str | None = None (alias 'isolationScope')

    Scope tag indicating which logical context this event belongs to.

    When set, the LLM content-builder restricts session events visible to an agent to those whose `isolation_scope` matches the agent’s own scope. One usage today is the Task API: a delegated task agent is scoped under the originating function-call id (`<fc_id>`) so it sees only its own task’s events, isolated from the chat coordinator’s broader conversation.

    ⚠️ DO NOT USE THIS FIELD DIRECTLY. It is an internal mechanism that may change without notice. External code should not read, write, or rely on its semantics.

  field long_running_tool_ids: set[str] | None = None (alias 'longRunningToolIds')

    Set of ids of the long running function calls. Agent client will know from this field about which function call is long running. only valid for function call event

  field node_info: NodeInfo [Optional] (alias 'nodeInfo')

    Workflow node metadata (path, run_id, etc.).

  field output: Any | None = None

    Generic data output from a workflow node.

  field timestamp: float [Optional]

    The timestamp of the event.

  static new_id()
    Return type:

      `str`

  get_function_calls()

    Returns the function calls in the event.

    Return type:

      `list`[`FunctionCall`]

  get_function_responses()

    Returns the function responses in the event.

    Return type:

      `list`[`FunctionResponse`]

  has_trailing_code_execution_result()

    Returns whether the event has a trailing code execution result.

    Return type:

      `bool`

  is_final_response()

    Returns whether the event is the final response of an agent.

    NOTE: This method is ONLY for use by Agent Development Kit.

    Note that when multiple agents participate in one invocation, there could be one event has is_final_response() as True for each participating agent.

    Return type:

      `bool`

  model_post_init(_Event__context)

    Post initialization logic for the event.

  property message: Content | None

    Alias for content. Returns the user-facing message of the event.

  property node_name: str

    The name of the node that generated the event.

pydantic model google.adk.events.EventActions

  Bases: `BaseModel`

  Represents the actions attached to an event.

  Show JSON schema

      {
         "title": "EventActions",
         "description": "Represents the actions attached to an event.",
         "type": "object",
         "properties": {
            "skipSummarization": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Skipsummarization"
            },
            "stateDelta": {
               "additionalProperties": true,
               "title": "Statedelta",
               "type": "object"
            },
            "artifactDelta": {
               "additionalProperties": {
                  "type": "integer"
               },
               "title": "Artifactdelta",
               "type": "object"
            },
            "transferToAgent": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Transfertoagent"
            },
            "escalate": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Escalate"
            },
            "requestedAuthConfigs": {
               "additionalProperties": {
                  "$ref": "#/$defs/AuthConfig"
               },
               "title": "Requestedauthconfigs",
               "type": "object"
            },
            "requestedToolConfirmations": {
               "additionalProperties": {
                  "$ref": "#/$defs/ToolConfirmation"
               },
               "title": "Requestedtoolconfirmations",
               "type": "object"
            },
            "compaction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/EventCompaction"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "endOfAgent": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Endofagent"
            },
            "agentState": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Agentstate"
            },
            "rewindBeforeInvocationId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Rewindbeforeinvocationid"
            },
            "route": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "type": "boolean"
                           },
                           {
                              "type": "integer"
                           },
                           {
                              "type": "string"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Route"
            },
            "renderUiWidgets": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/UiWidget"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Renderuiwidgets"
            },
            "setModelResponse": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Setmodelresponse"
            }
         },
         "$defs": {
            "APIKey": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "apiKey"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "in": {
                     "$ref": "#/$defs/APIKeyIn"
                  },
                  "name": {
                     "title": "Name",
                     "type": "string"
                  }
               },
               "required": [
                  "in",
                  "name"
               ],
               "title": "APIKey",
               "type": "object"
            },
            "APIKeyIn": {
               "enum": [
                  "query",
                  "header",
                  "cookie"
               ],
               "title": "APIKeyIn",
               "type": "string"
            },
            "AuthConfig": {
               "additionalProperties": true,
               "description": "The auth config sent by tool asking client to collect auth credentials and\n\nadk and client will help to fill in the response",
               "properties": {
                  "authScheme": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/APIKey"
                        },
                        {
                           "$ref": "#/$defs/HTTPBase"
                        },
                        {
                           "$ref": "#/$defs/OAuth2"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnect"
                        },
                        {
                           "$ref": "#/$defs/HTTPBearer"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnectWithConfig"
                        },
                        {
                           "$ref": "#/$defs/CustomAuthScheme"
                        }
                     ],
                     "title": "Authscheme"
                  },
                  "rawAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "exchangedAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "credentialKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Credentialkey"
                  }
               },
               "required": [
                  "authScheme"
               ],
               "title": "AuthConfig",
               "type": "object"
            },
            "AuthCredential": {
               "additionalProperties": true,
               "description": "Data class representing an authentication credential.\n\nTo exchange for the actual credential, please use\nCredentialExchanger.exchange_credential().\n\nExamples: API Key Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    api_key=\"1234\",\n)\n\nExample: HTTP Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"basic\",\n        credentials=HttpCredentials(username=\"user\", password=\"password\"),\n    ),\n)\n\nExample: OAuth2 Bearer Token in HTTP Header\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"bearer\",\n        credentials=HttpCredentials(token=\"eyAkaknabna....\"),\n    ),\n)\n\nExample: OAuth2 Auth with Authorization Code Flow\nAuthCredential(\n    auth_type=AuthCredentialTypes.OAUTH2,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n    ),\n)\n\nExample: OpenID Connect Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n        redirect_uri=\"https://example.com\",\n        scopes=[\"scope1\", \"scope2\"],\n    ),\n)\n\nExample: Auth with resource reference\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    resource_ref=\"projects/1234/locations/us-central1/resources/resource1\",\n)",
               "properties": {
                  "authType": {
                     "$ref": "#/$defs/AuthCredentialTypes"
                  },
                  "resourceRef": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Resourceref"
                  },
                  "apiKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Apikey"
                  },
                  "http": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/HttpAuth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "serviceAccount": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccount"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "oauth2": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuth2Auth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "required": [
                  "authType"
               ],
               "title": "AuthCredential",
               "type": "object"
            },
            "AuthCredentialTypes": {
               "description": "Represents the type of authentication credential.",
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect",
                  "serviceAccount"
               ],
               "title": "AuthCredentialTypes",
               "type": "string"
            },
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "CustomAuthScheme": {
               "additionalProperties": true,
               "description": "A flexible model for custom authentication schemes.\n\nThe subclasses must define a `default` for the `type_` field, if using OAuth2\nuser consent flow, to ensure correct rehydration.",
               "properties": {
                  "type": {
                     "title": "Type",
                     "type": "string"
                  }
               },
               "required": [
                  "type"
               ],
               "title": "CustomAuthScheme",
               "type": "object"
            },
            "EventCompaction": {
               "additionalProperties": false,
               "description": "The compaction of the events.",
               "properties": {
                  "startTimestamp": {
                     "title": "Starttimestamp",
                     "type": "number"
                  },
                  "endTimestamp": {
                     "title": "Endtimestamp",
                     "type": "number"
                  },
                  "compactedContent": {
                     "$ref": "#/$defs/Content"
                  }
               },
               "required": [
                  "startTimestamp",
                  "endTimestamp",
                  "compactedContent"
               ],
               "title": "EventCompaction",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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"
            },
            "HTTPBase": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  }
               },
               "required": [
                  "scheme"
               ],
               "title": "HTTPBase",
               "type": "object"
            },
            "HTTPBearer": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "const": "bearer",
                     "default": "bearer",
                     "title": "Scheme",
                     "type": "string"
                  },
                  "bearerFormat": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Bearerformat"
                  }
               },
               "title": "HTTPBearer",
               "type": "object"
            },
            "HttpAuth": {
               "additionalProperties": true,
               "description": "The credentials and metadata for HTTP authentication.",
               "properties": {
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  },
                  "credentials": {
                     "$ref": "#/$defs/HttpCredentials"
                  },
                  "additionalHeaders": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "type": "string"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Additionalheaders"
                  }
               },
               "required": [
                  "scheme",
                  "credentials"
               ],
               "title": "HttpAuth",
               "type": "object"
            },
            "HttpCredentials": {
               "additionalProperties": true,
               "description": "Represents the secret token value for HTTP authentication, like user name, password, oauth token, etc.",
               "properties": {
                  "username": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Username"
                  },
                  "password": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Password"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token"
                  }
               },
               "title": "HttpCredentials",
               "type": "object"
            },
            "Language": {
               "description": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "OAuth2": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "oauth2"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "flows": {
                     "$ref": "#/$defs/OAuthFlows"
                  }
               },
               "required": [
                  "flows"
               ],
               "title": "OAuth2",
               "type": "object"
            },
            "OAuth2Auth": {
               "additionalProperties": true,
               "description": "Represents credential value and its metadata for a OAuth2 credential.",
               "properties": {
                  "clientId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientid"
                  },
                  "clientSecret": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientsecret"
                  },
                  "authUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authuri"
                  },
                  "nonce": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Nonce"
                  },
                  "state": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State"
                  },
                  "redirectUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Redirecturi"
                  },
                  "authResponseUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authresponseuri"
                  },
                  "authCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authcode"
                  },
                  "accessToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Accesstoken"
                  },
                  "refreshToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshtoken"
                  },
                  "idToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Idtoken"
                  },
                  "expiresAt": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresat"
                  },
                  "expiresIn": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresin"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  },
                  "codeVerifier": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codeverifier"
                  },
                  "codeChallengeMethod": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codechallengemethod"
                  },
                  "tokenEndpointAuthMethod": {
                     "anyOf": [
                        {
                           "enum": [
                              "client_secret_basic",
                              "client_secret_post",
                              "client_secret_jwt",
                              "private_key_jwt"
                           ],
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": "client_secret_basic",
                     "title": "Tokenendpointauthmethod"
                  }
               },
               "title": "OAuth2Auth",
               "type": "object"
            },
            "OAuthFlowAuthorizationCode": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl",
                  "tokenUrl"
               ],
               "title": "OAuthFlowAuthorizationCode",
               "type": "object"
            },
            "OAuthFlowClientCredentials": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowClientCredentials",
               "type": "object"
            },
            "OAuthFlowImplicit": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl"
               ],
               "title": "OAuthFlowImplicit",
               "type": "object"
            },
            "OAuthFlowPassword": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowPassword",
               "type": "object"
            },
            "OAuthFlows": {
               "additionalProperties": true,
               "properties": {
                  "implicit": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowImplicit"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "password": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowPassword"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "clientCredentials": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowClientCredentials"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "authorizationCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowAuthorizationCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "title": "OAuthFlows",
               "type": "object"
            },
            "OpenIdConnect": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "openIdConnectUrl": {
                     "title": "Openidconnecturl",
                     "type": "string"
                  }
               },
               "required": [
                  "openIdConnectUrl"
               ],
               "title": "OpenIdConnect",
               "type": "object"
            },
            "OpenIdConnectWithConfig": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "authorization_endpoint": {
                     "title": "Authorization Endpoint",
                     "type": "string"
                  },
                  "token_endpoint": {
                     "title": "Token Endpoint",
                     "type": "string"
                  },
                  "userinfo_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Userinfo Endpoint"
                  },
                  "revocation_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Revocation Endpoint"
                  },
                  "token_endpoint_auth_methods_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token Endpoint Auth Methods Supported"
                  },
                  "grant_types_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Grant Types Supported"
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  }
               },
               "required": [
                  "authorization_endpoint",
                  "token_endpoint"
               ],
               "title": "OpenIdConnectWithConfig",
               "type": "object"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "SecuritySchemeType": {
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect"
               ],
               "title": "SecuritySchemeType",
               "type": "string"
            },
            "ServiceAccount": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  service_account_credential: The service account credential (JSON key).\n  scopes: The OAuth2 scopes to request. Optional; when omitted with\n      ``use_default_credential=True``, defaults to the cloud-platform scope.\n  use_default_credential: Whether to use Application Default Credentials.\n  use_id_token: Whether to exchange for an ID token instead of an access\n      token. Required for service-to-service authentication with Cloud Run,\n      Cloud Functions, and other Google Cloud services that require identity\n      verification. When True, ``audience`` must also be set.\n  audience: The target audience for the ID token, typically the URL of the\n      receiving service (e.g. ``https://my-service-xyz.run.app``). Required\n      when ``use_id_token`` is True.",
               "properties": {
                  "serviceAccountCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccountCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  },
                  "useDefaultCredential": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Usedefaultcredential"
                  },
                  "useIdToken": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Useidtoken"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  }
               },
               "title": "ServiceAccount",
               "type": "object"
            },
            "ServiceAccountCredential": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  type: The type should be \"service_account\".\n  project_id: The project ID.\n  private_key_id: The ID of the private key.\n  private_key: The private key.\n  client_email: The client email.\n  client_id: The client ID.\n  auth_uri: The authorization URI.\n  token_uri: The token URI.\n  auth_provider_x509_cert_url: URL for auth provider's X.509 cert.\n  client_x509_cert_url: URL for the client's X.509 cert.\n  universe_domain: The universe domain.\n\nExample:\n\n    config = ServiceAccountCredential(\n        type_=\"service_account\",\n        project_id=\"your_project_id\",\n        private_key_id=\"your_private_key_id\",\n        private_key=\"-----BEGIN PRIVATE KEY-----...\",\n        client_email=\"...@....iam.gserviceaccount.com\",\n        client_id=\"your_client_id\",\n        auth_uri=\"https://accounts.google.com/o/oauth2/auth\",\n        token_uri=\"https://oauth2.googleapis.com/token\",\n        auth_provider_x509_cert_url=\"https://www.googleapis.com/oauth2/v1/certs\",\n        client_x509_cert_url=\"https://www.googleapis.com/robot/v1/metadata/x509/...\",\n        universe_domain=\"googleapis.com\"\n    )\n\n\n    config = ServiceAccountConfig.model_construct(**{\n        ...service account config dict\n    })",
               "properties": {
                  "type": {
                     "default": "",
                     "title": "Type",
                     "type": "string"
                  },
                  "projectId": {
                     "title": "Projectid",
                     "type": "string"
                  },
                  "privateKeyId": {
                     "title": "Privatekeyid",
                     "type": "string"
                  },
                  "privateKey": {
                     "title": "Privatekey",
                     "type": "string"
                  },
                  "clientEmail": {
                     "title": "Clientemail",
                     "type": "string"
                  },
                  "clientId": {
                     "title": "Clientid",
                     "type": "string"
                  },
                  "authUri": {
                     "title": "Authuri",
                     "type": "string"
                  },
                  "tokenUri": {
                     "title": "Tokenuri",
                     "type": "string"
                  },
                  "authProviderX509CertUrl": {
                     "title": "Authproviderx509Certurl",
                     "type": "string"
                  },
                  "clientX509CertUrl": {
                     "title": "Clientx509Certurl",
                     "type": "string"
                  },
                  "universeDomain": {
                     "title": "Universedomain",
                     "type": "string"
                  }
               },
               "required": [
                  "projectId",
                  "privateKeyId",
                  "privateKey",
                  "clientEmail",
                  "clientId",
                  "authUri",
                  "tokenUri",
                  "authProviderX509CertUrl",
                  "clientX509CertUrl",
                  "universeDomain"
               ],
               "title": "ServiceAccountCredential",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolConfirmation": {
               "additionalProperties": false,
               "description": "Represents a tool confirmation configuration.",
               "properties": {
                  "hint": {
                     "default": "",
                     "title": "Hint",
                     "type": "string"
                  },
                  "confirmed": {
                     "default": false,
                     "title": "Confirmed",
                     "type": "boolean"
                  },
                  "payload": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Payload"
                  }
               },
               "title": "ToolConfirmation",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "UiWidget": {
               "additionalProperties": false,
               "description": "Rendering metadata for a UI widget associated with an event.\n\nWhen present on an Event.actions, the UI renders the widget using the\nspecified provider's renderer component.",
               "properties": {
                  "id": {
                     "title": "Id",
                     "type": "string"
                  },
                  "provider": {
                     "title": "Provider",
                     "type": "string"
                  },
                  "payload": {
                     "additionalProperties": true,
                     "title": "Payload",
                     "type": "object"
                  }
               },
               "required": [
                  "id",
                  "provider"
               ],
               "title": "UiWidget",
               "type": "object"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "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:

    - `agent_state (dict[str, Any] | None)`

    - `artifact_delta (dict[str, int])`

    - `compaction (google.adk.events.event_actions.EventCompaction | None)`

    - `end_of_agent (bool | None)`

    - `escalate (bool | None)`

    - `render_ui_widgets (list[google.adk.events.ui_widget.UiWidget] | None)`

    - `requested_auth_configs (dict[str, google.adk.auth.auth_tool.AuthConfig])`

    - `requested_tool_confirmations (dict[str, google.adk.tools.tool_confirmation.ToolConfirmation])`

    - `rewind_before_invocation_id (str | None)`

    - `route (bool | int | str | list[bool | int | str] | None)`

    - `set_model_response (Any | None)`

    - `skip_summarization (bool | None)`

    - `state_delta (dict[str, Any])`

    - `transfer_to_agent (str | None)`

  field agent_state: Optional[dict[str, Any]] = None (alias 'agentState')

    The agent state at the current event, used for checkpoint and resume. This should only be set by ADK workflow.

  field artifact_delta: dict[str, int] [Optional] (alias 'artifactDelta')

    Indicates that the event is updating an artifact. key is the filename, value is the version.

  field compaction: Optional[EventCompaction] = None

    The compaction of the events.

  field end_of_agent: Optional[bool] = None (alias 'endOfAgent')

    If true, the current agent has finished its current run. Note that there can be multiple events with end_of_agent=True for the same agent within one invocation when there is a loop. This should only be set by ADK workflow.

  field escalate: Optional[bool] = None

    The agent is escalating to a higher level agent.

  field render_ui_widgets: Optional[list[UiWidget]] = None (alias 'renderUiWidgets')

    List of UI widgets to be rendered by the UI.

  field requested_auth_configs: dict[str, AuthConfig] [Optional] (alias 'requestedAuthConfigs')

    Authentication configurations requested by tool responses.

    This field will only be set by a tool response event indicating tool request auth credential. - Keys: The function call id. Since one function response event could contain multiple function responses that correspond to multiple function calls. Each function call could request different auth configs. This id is used to identify the function call. - Values: The requested auth config.

  field requested_tool_confirmations: dict[str, ToolConfirmation] [Optional] (alias 'requestedToolConfirmations')

    A dict of tool confirmation requested by this event, keyed by function call id.

  field rewind_before_invocation_id: Optional[str] = None (alias 'rewindBeforeInvocationId')

    The invocation id to rewind to. This is only set for rewind event.

  field route: Optional[Union[bool, int, str, list[Union[bool, int, str]]]] = None

    Route or list of routes for workflow graph edge matching.

  field set_model_response: Optional[Any] = None (alias 'setModelResponse')

    The model response structured output.

  field skip_summarization: Optional[bool] = None (alias 'skipSummarization')

    If true, it won’t call model to summarize function response.

    Only used for function_response event.

  field state_delta: dict[str, Any] [Optional] (alias 'stateDelta')

    Indicates that the event is updating the state with the given delta.

  field transfer_to_agent: Optional[str] = None (alias 'transferToAgent')

    If set, the event transfers to the specified agent.

pydantic model google.adk.events.RequestInput

  Bases: `BaseModel`

  Represents a request for input from the user.

  Show JSON schema

      {
         "title": "RequestInput",
         "description": "Represents a request for input from the user.",
         "type": "object",
         "properties": {
            "interruptId": {
               "description": "The ID of the interrupt, usually a function call ID. This is used to identify the interrupt that the input is for.",
               "title": "Interruptid",
               "type": "string"
            },
            "payload": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Payload"
            },
            "message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A message to display to the user when requesting input.",
               "title": "Message"
            },
            "responseSchema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The expected schema of the response. Accepts a Python type (e.g. a Pydantic BaseModel class), a generic alias (e.g. list[str]), or a raw JSON Schema dict. If None, it defaults to Any.",
               "title": "Responseschema"
            }
         },
         "$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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         }
      }

  Fields:

    - `interrupt_id (str)`

    - `message (str | None)`

    - `payload (Any | None)`

    - `response_schema (dict[Any, Any] | type | google.genai.types.Schema | types.GenericAlias | types.UnionType | _UnionGenericAlias | None)`

  field interrupt_id: str [Optional] (alias 'interruptId')

    The ID of the interrupt, usually a function call ID.

    Reusing the same interrupt_id across loop iterations (e.g. a rejection/retry cycle) is supported — the framework matches function calls and responses by count. Using unique IDs per iteration is still recommended for clarity in event logs.

    The ID of the interrupt, usually a function call ID. This is used to identify the interrupt that the input is for.

  field message: Optional[str] = None

    A message to display to the user when requesting input.

  field payload: Optional[Any] = None

    Custom payload to be provided for resuming.

  field response_schema: Optional[SchemaType] = None (alias 'responseSchema')

    The expected schema of the response.

    The expected schema of the response. Accepts a Python type (e.g. a Pydantic BaseModel class), a generic alias (e.g. list[str]), or a raw JSON Schema dict. If None, it defaults to Any.

# google.adk.examples module

class google.adk.examples.BaseExampleProvider

  Bases: `ABC`

  Base class for example providers.

  This class defines the interface for providing examples for a given query.

  abstractmethod get_examples(query)

    Returns a list of examples for a given query.

    Return type:

      `list`[`Example`]

    Parameters:

      query – The query to get examples for.

    Returns:

      A list of Example objects.

pydantic model google.adk.examples.Example

  Bases: `BaseModel`

  A few-shot example.

  input

    The input content for the example.

  output

    The expected output content for the example.

  Show JSON schema

      {
         "title": "Example",
         "description": "A few-shot example.\n\nAttributes:\n  input: The input content for the example.\n  output: The expected output content for the example.",
         "type": "object",
         "properties": {
            "input": {
               "$ref": "#/$defs/Content"
            },
            "output": {
               "items": {
                  "$ref": "#/$defs/Content"
               },
               "title": "Output",
               "type": "array"
            }
         },
         "$defs": {
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "startOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The start offset of the video.",
                     "title": "Startoffset"
                  }
               },
               "title": "VideoMetadata",
               "type": "object"
            }
         },
         "required": [
            "input",
            "output"
         ]
      }

  Fields:

    - `input (google.genai.types.Content)`

    - `output (list[google.genai.types.Content])`

  field input: types.Content [Required]
  field output: list[types.Content] [Required]

class google.adk.examples.VertexAiExampleStore(examples_store_name)

  Bases: `BaseExampleProvider`

  Provides examples from Vertex example store.

  Initializes the VertexAiExampleStore.

  Parameters:

    examples_store_name – The resource name of the vertex example store, in the format of `projects/{project}/locations/{location}/exampleStores/{example_store}`.

  get_examples(query)

    Returns a list of examples for a given query.

    Return type:

      `list`[`Example`]

    Parameters:

      query – The query to get examples for.

    Returns:

      A list of Example objects.

# google.adk.flows module

# google.adk.integrations.agent_identity module

class google.adk.integrations.agent_identity.GcpAuthProvider(client=None)

  Bases: `BaseAuthProvider`

  An auth provider that uses the Agent Identity Credentials service to generate access tokens.

  async get_auth_credential(auth_config, context=None)

    Retrieves credentials using the Agent Identity Credentials service.

    Return type:

      `AuthCredential`

    Parameters:

      - auth_config – The authentication configuration.

      - context – Optional context for the callback.

    Returns:

      An AuthCredential instance.

    Raises:

      - ValueError – If auth_scheme is not a GcpAuthProviderScheme.

      - RuntimeError – If credential retrieval or polling fails.

  property supported_auth_schemes: tuple[type[GcpAuthProviderScheme], ...]

    The AuthScheme types supported by this provider.

    Subclasses can override this to return a tuple of scheme types, enabling 1-parameter registration.

pydantic model google.adk.integrations.agent_identity.GcpAuthProviderScheme

  Bases: `CustomAuthScheme`

  The Agent Identity authentication scheme for Google Cloud Platform.

  name

    The name of the GCP Auth Provider resource to use.

  scopes

    Optional. A list of OAuth2 scopes to request.

  continue_uri

    Optional. A type of redirect URI. It is distinct from the standard OAuth2 redirect URI. Its purpose is to reauthenticate the user to prevent phishing attacks and to finalize the managed OAuth flow. The standard, Google-hosted OAuth2 redirect URI will redirect the user to this continue URI. The agent will include this URI in every 3-legged OAuth request sent to the upstream Agent Identity Credential service. Developers must ensure this URI is hosted (e.g. on GCP, a third-party cloud, on-prem), preferably alongside the agent client’s web server. TODO: Add public documentation link for more information once available.

  type_

    The type of the security scheme, always “gcpAuthProviderScheme”.

  Show JSON schema

      {
         "title": "GcpAuthProviderScheme",
         "description": "The Agent Identity authentication scheme for Google Cloud Platform.\n\nAttributes:\n  name: The name of the GCP Auth Provider resource to use.\n  scopes: Optional. A list of OAuth2 scopes to request.\n  continue_uri: Optional. A type of redirect URI. It is distinct from the\n    standard OAuth2 redirect URI. Its purpose is to reauthenticate the user to\n    prevent phishing attacks and to finalize the managed OAuth flow. The\n    standard, Google-hosted OAuth2 redirect URI will redirect the user to this\n    continue URI. The agent will include this URI in every 3-legged OAuth\n    request sent to the upstream Agent Identity Credential service. Developers\n    must ensure this URI is hosted (e.g. on GCP, a third-party cloud,\n    on-prem), preferably alongside the agent client's web server.\n    TODO: Add public documentation link for more information once available.\n  type_: The type of the security scheme, always \"gcpAuthProviderScheme\".",
         "type": "object",
         "properties": {
            "type": {
               "const": "gcpAuthProviderScheme",
               "default": "gcpAuthProviderScheme",
               "title": "Type",
               "type": "string"
            },
            "name": {
               "title": "Name",
               "type": "string"
            },
            "scopes": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scopes"
            },
            "continueUri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Continueuri"
            }
         },
         "additionalProperties": true,
         "required": [
            "name"
         ]
      }

  Fields:

    - `continue_uri (str | None)`

    - `name (str)`

    - `scopes (List[str] | None)`

    - `type_ (Literal['gcpAuthProviderScheme'])`

  field continue_uri: Optional[str] = None (alias 'continueUri')
  field name: str [Required]
  field scopes: Optional[List[str]] = None
  field type_: Literal['gcpAuthProviderScheme'] = 'gcpAuthProviderScheme' (alias 'type')

# google.adk.integrations.agent_registry module

class google.adk.integrations.agent_registry.AgentRegistry(project_id=None, location=None, header_provider=None)

  Bases: `object`

  Client for interacting with the Google Cloud Agent Registry service.

  Unlike a standard REST client library, this class provides higher-level abstractions for ADK integration. It surfaces the agent registry service methods along with helper methods like get_mcp_toolset and get_remote_a2a_agent that automatically resolve connection details and handle authentication to produce ready-to-use ADK components.

  Initializes the AgentRegistry client.

  Parameters:

    - project_id – The Google Cloud project ID.

    - location – The Google Cloud location (region).

    - header_provider – Optional provider for custom headers.

  get_agent_info(name)

    Retrieves detailed metadata of a specific A2A Agent.

    Return type:

      `Dict`[`str`, `Any`]

  get_endpoint(name)

    Retrieves details of a specific Endpoint.

    Return type:

      `Endpoint`

  get_mcp_server(name)

    Retrieves details of a specific MCP Server.

    Return type:

      `Dict`[`str`, `Any`]

  get_mcp_toolset(mcp_server_name, auth_scheme=None, auth_credential=None, *, continue_uri=None)

    Constructs an McpToolset from a registered MCP Server.

    If auth_scheme is omitted, it is automatically resolved from the server’s IAM bindings via GcpAuthProviderScheme.

    Return type:

      `McpToolset`

    Parameters:

      - mcp_server_name – Resource name of the MCP Server.

      - auth_scheme – Optional auth scheme. Resolved via bindings if omitted.

      - auth_credential – Optional auth credential.

      - continue_uri – Optional continue URI to override what is in the auth provider.

    Returns:

      An McpToolset for the MCP server.

  get_model_name(endpoint_name)

    Retrieves and parses an endpoint into a model resource name.

    Return type:

      `str`

    Parameters:

      endpoint_name – The full resource name of the endpoint.

    Returns:

      The resolved model resource name string (e.g. projects/…/locations/…/publishers/google/models/…).

  get_remote_a2a_agent(agent_name, *, httpx_client=None)

    Creates a RemoteA2aAgent instance for a registered A2A Agent.

    Return type:

      `RemoteA2aAgent`

  list_agents(filter_str=None, page_size=None, page_token=None)

    Fetches a list of registered A2A Agents.

    Return type:

      `Dict`[`str`, `Any`]

  list_endpoints(filter_str=None, page_size=None, page_token=None)

    Fetches a list of Endpoints.

    Return type:

      `Dict`[`str`, `Any`]

  list_mcp_servers(filter_str=None, page_size=None, page_token=None)

    Fetches a list of MCP Servers.

    Return type:

      `Dict`[`str`, `Any`]

# google.adk.integrations.api_registry module

class google.adk.integrations.api_registry.ApiRegistry(api_registry_project_id, location='global', header_provider=None)

  Bases: `object`

  Registry that provides McpToolsets for MCP servers registered in API Registry.

  Initialize the API Registry.

  Parameters:

    - api_registry_project_id – The project ID for the Google Cloud API Registry.

    - location – The location of the API Registry resources.

    - header_provider – Optional function to provide additional headers for MCP server calls.

  get_toolset(mcp_server_name, tool_filter=None, tool_name_prefix=None)

    Return the MCP Toolset based on the params.

    Return type:

      `McpToolset`

    Parameters:

      - mcp_server_name – Filter to select the MCP server name to get tools from.

      - tool_filter – Optional filter to select specific tools. Can be a list of tool names or a ToolPredicate function.

      - tool_name_prefix – Optional prefix to prepend to the names of the tools returned by the toolset.

    Returns:

      A toolset for the MCP server specified.

    Return type:

      McpToolset

# google.adk.integrations.bigquery module

BigQuery Integration.

This module provides tools and skills for interacting with BigQuery.

# google.adk.integrations.crewai module

class google.adk.integrations.crewai.CrewaiTool(tool, *, name, description='')

  Bases: `FunctionTool`

  Use this class to wrap a CrewAI tool.

  If the original tool name and description are not suitable, you can override them in the constructor.

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `CrewaiTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  async run_async(*, args, tool_context)

    Override run_async to handle CrewAI-specific parameter filtering.

    CrewAI tools use **kwargs pattern, so we need special parameter filtering logic that allows all parameters to pass through while removing only reserved parameters like ‘self’ and ‘tool_context’.

    Note: ‘tool_context’ is removed from the initial args dictionary to prevent duplicates, but is re-added if the function signature explicitly requires it as a parameter.

    Return type:

      `Any`

  tool: CrewaiBaseTool

    The wrapped CrewAI tool.

pydantic model google.adk.integrations.crewai.CrewaiToolConfig

  Bases: `BaseToolConfig`

  Show JSON schema

      {
         "title": "CrewaiToolConfig",
         "type": "object",
         "properties": {
            "tool": {
               "title": "Tool",
               "type": "string"
            },
            "name": {
               "default": "",
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "required": [
            "tool"
         ]
      }

  Fields:

    - `description (str)`

    - `name (str)`

    - `tool (str)`

  field description: str = ''

    The description of the tool.

  field name: str = ''

    The name of the tool.

  field tool: str [Required]

    The fully qualified path of the CrewAI tool instance.

# google.adk.integrations.firestore module

# google.adk.integrations.langchain module

class google.adk.integrations.langchain.LangchainTool(tool, name=None, description=None)

  Bases: `FunctionTool`

  Adapter class that wraps a Langchain tool for use with ADK.

  This adapter converts Langchain tools into a format compatible with Google’s generative AI function calling interface. It preserves the tool’s name, description, and functionality while adapting its schema.

  The original tool’s name and description can be overridden if needed.

  Parameters:

    - tool – A Langchain tool to wrap (BaseTool or a tool with a .run method)

    - name – Optional override for the tool’s name

    - description – Optional override for the tool’s description

  Examples:

      from langchain.tools import DuckDuckGoSearchTool
      from google.adk.integrations.langchain import LangchainTool

      search_tool = DuckDuckGoSearchTool()
      wrapped_tool = LangchainTool(search_tool)

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `LangchainTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

pydantic model google.adk.integrations.langchain.LangchainToolConfig

  Bases: `BaseToolConfig`

  Show JSON schema

      {
         "title": "LangchainToolConfig",
         "type": "object",
         "properties": {
            "tool": {
               "title": "Tool",
               "type": "string"
            },
            "name": {
               "default": "",
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "required": [
            "tool"
         ]
      }

  Fields:

    - `description (str)`

    - `name (str)`

    - `tool (str)`

  field description: str = ''

    The description of the tool.

  field name: str = ''

    The name of the tool.

  field tool: str [Required]

    The fully qualified path of the Langchain tool instance.

# google.adk.integrations.parameter_manager module

class google.adk.integrations.parameter_manager.ParameterManagerClient(service_account_json=None, auth_token=None, location=None)

  Bases: `object`

  A client for interacting with Google Cloud Parameter Manager.

  This class provides a simplified interface for retrieving parameters from Parameter Manager, handling authentication using either a service account JSON keyfile (passed as a string), a preexisting authorization token, or default credentials.

  _credentials

    Google Cloud credentials object (ServiceAccountCredentials or Credentials).

  _client

    Parameter Manager client instance.

  Initializes the ParameterManagerClient.

  If neither service_account_json nor auth_token is provided, default credentials are used.

  Parameters:

    - service_account_json – The content of a service account JSON keyfile (as a string), not the file path. Must be valid JSON.

    - auth_token – An existing Google Cloud authorization token.

    - location – The Google Cloud location (region) to use for the Parameter Manager service. If not provided, the global endpoint is used.

  Raises:

    - ValueError – If both ‘service_account_json’ and ‘auth_token’ are

    - provided. Also raised if the 'service_account_json' is not valid JSON. –

    - google.auth.exceptions.GoogleAuthError – If authentication fails.

  get_parameter(resource_name)

    Retrieves a rendered parameter value from Google Cloud Parameter Manager.

    Return type:

      `str`

    Parameters:

      resource_name – The full resource name of the parameter version, in the format “projects//locations//parameters//versions/”. Usually you want the “latest” version, e.g., “projects/my-project/locations/global/parameters/my-param/versions/latest”.

    Returns:

      The rendered parameter value as a string.

    Raises:

      google.api_core.exceptions.GoogleAPIError – If the Parameter Manager API returns an error (e.g., parameter not found, permission denied).

# google.adk.integrations.secret_manager module

class google.adk.integrations.secret_manager.SecretManagerClient(service_account_json=None, auth_token=None, location=None)

  Bases: `object`

  A client for interacting with Google Cloud Secret Manager.

  This class provides a simplified interface for retrieving secrets from Secret Manager, handling authentication using either a service account JSON keyfile (passed as a string) or a preexisting authorization token.

  _credentials

    Google Cloud credentials object (ServiceAccountCredentials or Credentials).

  _client

    Secret Manager client instance.

  Initializes the SecretManagerClient.

  Parameters:

    - service_account_json – The content of a service account JSON keyfile (as a string), not the file path. Must be valid JSON.

    - auth_token – An existing Google Cloud authorization token.

    - location – The Google Cloud location (region) to use for the Secret Manager service. If not provided, the global endpoint is used.

  Raises:

    - ValueError – If neither service_account_json nor auth_token is

    - provided, – or if both are provided. Also raised if the service_account_json is not valid JSON.

    - google.auth.exceptions.GoogleAuthError – If authentication fails.

  get_secret(resource_name)

    Retrieves a secret from Google Cloud Secret Manager.

    Return type:

      `str`

    Parameters:

      resource_name – The full resource name of the secret, in the format “projects//secrets//versions/*”. Usually you want the “latest” version, e.g., “projects/my-project/secrets/my-secret/versions/latest”.

    Returns:

      The secret payload as a string.

    Raises:

      - google.api_core.exceptions.GoogleAPIError – If the Secret Manager API returns an error (e.g., secret not found, permission denied).

      - Exception – For other unexpected errors.

# google.adk.integrations.skill_registry module

Skill Registry integrations.

class google.adk.integrations.skill_registry.GCPSkillRegistry(*, project_id=None, location=None)

  Bases: `SkillRegistry`

  GCP implementation of SkillRegistry using GCP Skill Registry API.

  Initializes the GCP Skill Registry.

  Parameters:

    - project_id – Optional GCP project ID. If omitted, loads from environment.

    - location – Optional GCP location. If omitted, loads from environment.

  async get_skill(*, name)

    Fetches a skill from the registry.

    Return type:

      `Skill`

    Parameters:

      name – The name of the skill.

    Returns:

      A Skill object.

  async search_skills(*, query)

    Searches for skills in the registry.

    Return type:

      `list`[`Frontmatter`]

    Parameters:

      query – The search query.

    Returns:

      A list of Frontmatter objects for discovery.

# google.adk.integrations.slack module

class google.adk.integrations.slack.SlackRunner(runner, slack_app)

  Bases: `object`

  Runner for ADK agents on Slack.

  async start(app_token)

    Starts the Slack app using Socket Mode.

# google.adk.integrations.vmaas module

Vertex AI Agent Engine Computer Use Sandbox integration.

This module provides a BaseComputer implementation that uses Vertex AI Agent Engine Computer Use Sandbox as the remote browser environment.

Example

```python from google.adk.integrations.vmaas import AgentEngineSandboxComputer from google.adk.tools.computer_use import ComputerUseToolset

computer = AgentEngineSandboxComputer(

  project_id=”my-project”, service_account_email=”sa@my-project.iam.gserviceaccount.com”,

) toolset = ComputerUseToolset(computer=computer) agent = Agent(tools=[toolset], …) ```

class google.adk.integrations.vmaas.AgentEngineSandboxComputer(*, project_id=None, location='us-central1', service_account_email=None, sandbox_name=None, sandbox_ttl_seconds=3600, search_engine_url='https://www.google.com', vertexai_client=None)

  Bases: `BaseComputer`

  Computer implementation using Vertex AI Agent Engine Sandbox.

  This class provides a remote browser environment backed by Vertex AI Computer Use Sandbox. It supports: - Auto-provisioning of agent engines and sandboxes - Bring-your-own-sandbox (BYOS) mode - Session-aware resource sharing via session_state property - Automatic token refresh on expiry

  When used with ComputerUseToolset, the session_state property is automatically bound to tool_context.state before each tool call, enabling state sharing across invocations and agent server instances.

  Example usage:

    ```python from google.adk.integrations.vmaas import AgentEngineSandboxComputer from google.adk.tools.computer_use import ComputerUseToolset

    computer = AgentEngineSandboxComputer(

      project_id=”my-project”, service_account_email=”sa@my-project.iam.gserviceaccount.com”,

    ) toolset = ComputerUseToolset(computer=computer) agent = Agent(tools=[toolset], …) ```

  Initialize the sandbox computer.

  Parameters:

    - project_id – GCP project ID. If None, uses Application Default Credentials project.

    - location – Vertex AI location (default: us-central1).

    - service_account_email – Service account email for token generation. Must have roles/iam.serviceAccountTokenCreator permission. If None, attempts to use ADC service account.

    - sandbox_name – Existing sandbox resource name (BYOS mode). If provided, the agent engine name is extracted from it. If None, creates new agent engine and sandbox on demand. Format: projects/{project}/locations/{location}/reasoningEngines/{id}/sandboxEnvironments/{id}

    - sandbox_ttl_seconds – TTL for auto-created sandboxes (default: 1 hour).

    - search_engine_url – URL to navigate to for search() method.

    - vertexai_client – Optional Vertex AI client instance. If None, creates one lazily using project_id and location.

  async click_at(x, y)

    Clicks at a specific x, y coordinate.

    Return type:

      `ComputerState`

  async close()

    Cleanup resources.

    Note: Sandboxes are cleaned up via TTL by the sandbox service. This method does not delete the sandbox to preserve state across agent restarts within the TTL window.

    Return type:

      `None`

  async current_state()

    Returns the current state.

    Return type:

      `ComputerState`

  async drag_and_drop(x, y, destination_x, destination_y)

    Drag and drop from one coordinate to another.

    Return type:

      `ComputerState`

  async environment()

    Returns the environment type.

    Return type:

      `ComputerEnvironment`

  async go_back()

    Navigates back in browser history.

    Return type:

      `ComputerState`

  async go_forward()

    Navigates forward in browser history.

    Return type:

      `ComputerState`

  async hover_at(x, y)

    Hovers at a specific x, y coordinate.

    Return type:

      `ComputerState`

  async initialize()

    Initialize the computer.

    This is a no-op for sandbox as provisioning happens lazily on first use.

    Return type:

      `None`

  async key_combination(keys)

    Presses a combination of keys.

    Return type:

      `ComputerState`

  async navigate(url)

    Navigates to a URL.

    Return type:

      `ComputerState`

  async open_web_browser()

    Opens the web browser.

    For sandbox, the browser is always running. This is effectively a no-op that returns the current state.

    Return type:

      `ComputerState`

  async prepare(tool_context)

    Bind session state for sandbox resource sharing.

    Return type:

      `None`

  async screen_size()

    Returns the screen size of the environment.

    Return type:

      `tuple`[`int`, `int`]

  async scroll_at(x, y, direction, magnitude)

    Scrolls at a specific coordinate.

    Return type:

      `ComputerState`

  async scroll_document(direction)

    Scrolls the entire webpage.

    Return type:

      `ComputerState`

  async search()

    Navigates to the search engine home page.

    Return type:

      `ComputerState`

  async type_text_at(x, y, text, press_enter=True, clear_before_typing=True)

    Types text at a specific x, y coordinate.

    Return type:

      `ComputerState`

  async wait(seconds)

    Waits for n seconds.

    Return type:

      `ComputerState`

class google.adk.integrations.vmaas.SandboxClient(vertexai_client, sandbox, access_token)

  Bases: `object`

  Client for interacting with Vertex AI Computer Use Sandbox via SDK.

  Initialize the sandbox client.

  Parameters:

    - vertexai_client – The Vertex AI client instance.

    - sandbox – The sandbox object from vertexai SDK (SandboxEnvironment).

    - access_token – The access token for authenticating with the sandbox.

  async click_at(x, y)

    Click at a specific coordinate.

    Return type:

      `None`

    Parameters:

      - x – The x-coordinate.

      - y – The y-coordinate.

  async drag_and_drop(x1, y1, x2, y2)

    Drag from one coordinate to another.

    Return type:

      `None`

    Parameters:

      - x1 – Starting x-coordinate.

      - y1 – Starting y-coordinate.

      - x2 – Ending x-coordinate.

      - y2 – Ending y-coordinate.

  async get_current_url(max_retries=3)

    Get the URL of the currently active tab.

    This method includes retry logic to handle transient errors that can occur during page navigation (e.g., “Execution context was destroyed”).

    Return type:

      `str` | `None`

    Parameters:

      max_retries – Maximum number of retry attempts (default: 3).

    Returns:

      The current URL, or None if no active tab.

  async get_screenshot(max_retries=3)

    Capture a screenshot of the current page.

    This method includes retry logic to handle transient errors that can occur during page navigation (e.g., “Execution context was destroyed”).

    Return type:

      `bytes`

    Parameters:

      max_retries – Maximum number of retry attempts (default: 3).

    Returns:

      The screenshot as PNG bytes.

  async go_back()

    Navigate back in browser history.

    Return type:

      `bool`

    Returns:

      True if navigation was successful, False if at beginning of history.

  async go_forward()

    Navigate forward in browser history.

    Return type:

      `bool`

    Returns:

      True if navigation was successful, False if at end of history.

  async health_check()

    Check if the sandbox is healthy.

    Return type:

      `bool`

    Returns:

      True if healthy, False otherwise.

  async hover_at(x, y)

    Hover at a specific coordinate.

    Return type:

      `None`

    Parameters:

      - x – The x-coordinate.

      - y – The y-coordinate.

  async key_combination(keys)

    Press a combination of keys.

    Return type:

      `None`

    Parameters:

      keys – List of keys to press (e.g., [“control”, “c”]).

  async make_cdp_batch_request(commands, stop_on_error=True)

    Execute multiple CDP commands.

    First tries the batch endpoint (/cdps), falls back to sequential execution if batch is not available.

    Return type:

      `list`[`dict`[`str`, `Any`]]

    Parameters:

      - commands – List of CDP commands, each with “command” and “params” keys.

      - stop_on_error – Whether to stop processing on first error.

    Returns:

      List of results for each command.

  async make_cdp_request(command, params=None)

    Make a single CDP request to the sandbox.

    Return type:

      `dict`[`str`, `Any`]

    Parameters:

      - command – The CDP command to execute (e.g., “Page.navigate”).

      - params – Optional parameters for the CDP command.

    Returns:

      The CDP command response.

    Raises:

      Exception – If the request fails.

  async navigate(url)

    Navigate to a URL.

    Return type:

      `dict`[`str`, `Any`]

    Parameters:

      url – The URL to navigate to.

    Returns:

      The CDP response.

  async scroll_at(x, y, direction, magnitude)

    Scroll at a specific coordinate.

    Return type:

      `None`

    Parameters:

      - x – The x-coordinate.

      - y – The y-coordinate.

      - direction – The scroll direction.

      - magnitude – The scroll amount in pixels.

  async type_text(text, press_enter=False, clear_before_typing=False)

    Type text at the currently focused element.

    Return type:

      `None`

    Parameters:

      - text – The text to type.

      - press_enter – Whether to press Enter after typing.

      - clear_before_typing – Whether to clear existing content first.

  async type_text_at(x, y, text, press_enter=False, clear_before_typing=False)

    Click at a coordinate and type text.

    Return type:

      `None`

    Parameters:

      - x – The x-coordinate to click.

      - y – The y-coordinate to click.

      - text – The text to type.

      - press_enter – Whether to press Enter after typing.

      - clear_before_typing – Whether to clear existing content first.

  update_access_token(access_token)

    Update the access token.

    Return type:

      `None`

    Parameters:

      access_token – The new access token.

# google.adk.labs.openai module

pydantic model google.adk.labs.openai.OpenAILlm

  Bases: `BaseLlm`

  Integration with OpenAI models.

  model

    The name of the OpenAI model.

  max_tokens

    The maximum number of tokens to generate.

  Show JSON schema

      {
         "title": "OpenAILlm",
         "description": "Integration with OpenAI models.\n\nAttributes:\n    model: The name of the OpenAI model.\n    max_tokens: The maximum number of tokens to generate.",
         "type": "object",
         "properties": {
            "model": {
               "default": "gpt-4o",
               "title": "Model",
               "type": "string"
            },
            "max_tokens": {
               "default": 4096,
               "title": "Max Tokens",
               "type": "integer"
            }
         }
      }

  Fields:

    - `max_tokens (int)`

    - `model (str)`

  field max_tokens: int = 4096
  field model: str = 'gpt-4o'

    The name of the LLM, e.g. gemini-2.5-flash or gemini-2.5-pro.

  classmethod supported_models()

    Returns a list of supported models in regex for LlmRegistry.

    Return type:

      `list`[`str`]

  async generate_content_async(llm_request, stream=False)

    Generates content for a single model turn.

    > This method handles Server-Sent Events (SSE) streaming for unidirectional content generation. For bidirectional streaming (e.g., Gemini Live API), use the connect() method instead.

    > Args:

    >   llm_request: LlmRequest, the request to send to the LLM. stream: bool = False, whether to enable SSE streaming mode.

    > Yields:

    >   LlmResponse objects representing the model’s response for one turn.

    >   Non-streaming mode (stream=False):

    >   > Yields exactly one LlmResponse containing the complete model output (text, function calls, bytes, etc.). This response has partial=False.

    >   Streaming mode (stream=True):

    >   > Yields multiple LlmResponse objects as chunks arrive:

    >   > - Intermediate chunks: partial=True (progressive updates)

    >   > - Final chunk: partial=False (aggregated content from entire turn, identical to stream=False output)

    >   > - Text consolidation: Consecutive text parts of the same type (thought/non-thought) SHOULD merge without separator, but client code must not rely on this - unconsolidated parts are unusual but also valid

    >   Common content in partial chunks:

    >   > All intermediate chunks have partial=True regardless of content type. Common examples include:

    >   > - Text: Streams incrementally as tokens arrive

    >   > - Function calls: May arrive in separate chunks

    >   > - Bytes (e.g., images): Typically arrive as single chunk, interleaved with text

    >   > - Thoughts: Stream incrementally when thinking_config is enabled

    >   Examples:

    >   1. Simple text streaming:

    >          LlmResponse(partial=True,  parts=["The weather"])
    >          LlmResponse(partial=True,  parts=[" in Tokyo is"])
    >          LlmResponse(partial=True,  parts=[" sunny."])
    >          LlmResponse(partial=False, parts=["The weather in Tokyo is sunny."])

    >   2. Text + function call:

    >          LlmResponse(partial=True,  parts=[Text("Let me check...")])
    >          LlmResponse(partial=True,  parts=[FunctionCall("get_weather", ...)])
    >          LlmResponse(partial=False, parts=[Text("Let me check..."),
    >                                            FunctionCall("get_weather", ...)])

    >   3. Parallel function calls across chunks:

    >          LlmResponse(partial=True,  parts=[Text("Checking both cities...")])
    >          LlmResponse(partial=True,  parts=[FunctionCall("get_weather", Tokyo)])
    >          LlmResponse(partial=True,  parts=[FunctionCall("get_weather", NYC)])
    >          LlmResponse(partial=False, parts=[Text("Checking both cities..."),
    >                                            FunctionCall("get_weather", Tokyo),
    >                                            FunctionCall("get_weather", NYC)])

    >   4. Text + bytes (image generation with gemini-2.5-flash-image):

    >          LlmResponse(partial=True,  parts=[Text("Here's an image of a dog.")])
    >          LlmResponse(partial=True,  parts=[Text("

    “)])

      LlmResponse(partial=True, parts=[Blob(image/png, 1.6MB)]) LlmResponse(partial=True, parts=[Text(“It carries a bone”)]) LlmResponse(partial=True, parts=[Text(” and running around.”)]) LlmResponse(partial=False, parts=[Text(“Here’s an image of a dog.

    “),

      > > Blob(image/png, 1.6MB), Text(“It carries a bone and running around.”)])

      > Note: Consecutive text parts before and after blob merge separately.

      5. Text with thinking (gemini-2.5-flash with thinking_config):

             LlmResponse(partial=True,  parts=[Thought("Let me analyze...")])
             LlmResponse(partial=True,  parts=[Thought("The user wants...")])
             LlmResponse(partial=True,  parts=[Text("Based on my analysis,")])
             LlmResponse(partial=True,  parts=[Text(" the answer is 42.")])
             LlmResponse(partial=False, parts=[Thought("Let me analyze...The user wants..."),
                                               Text("Based on my analysis, the answer is 42.")])

         Note: Consecutive parts of same type merge (thoughts→thought, text→text).

      Important: All yielded responses represent one logical model turn. The final response with partial=False should be identical to the response that would be received with stream=False.

    Return type:

      `AsyncGenerator`[`LlmResponse`, `None`]

# google.adk.memory module

class google.adk.memory.BaseMemoryService

  Bases: `ABC`

  Base class for memory services.

  The service provides functionality to ingest conversation history into memory so that it can be used for user queries.

  async add_events_to_memory(*, app_name, user_id, events, session_id=None, custom_metadata=None)

    Adds an explicit list of events to the memory service.

    This is intended for cases where callers want to persist only a subset of events (e.g., the latest turn), rather than re-ingesting the full session.

    Implementations should treat events as an incremental update (delta) and must not assume it represents the full session. Implementations may ignore session_id if it is not applicable.

    Return type:

      `None`

    Parameters:

      - app_name – The application name for memory scope.

      - user_id – The user ID for memory scope.

      - events – The events to add to memory.

      - session_id – Optional session ID for memory scope/partitioning.

      - custom_metadata – Optional, portable metadata for memory generation. Prefer this for service-specific fields (e.g., TTL) that may later become first-class API parameters. Supported keys are implementation-defined by each memory service.

  async add_memory(*, app_name, user_id, memories, custom_metadata=None)

    Adds explicit memory items directly to the memory service.

    This is intended for services that support direct memory writes in addition to event-based memory generation.

    Return type:

      `None`

    Parameters:

      - app_name – The application name for memory scope.

      - user_id – The user ID for memory scope.

      - memories – Explicit memory items to add.

      - custom_metadata – Optional, portable metadata for memory writes. Supported keys are implementation-defined by each memory service.

  abstractmethod async add_session_to_memory(session)

    Adds a session to the memory service.

    A session may be added multiple times during its lifetime.

    Return type:

      `None`

    Parameters:

      session – The session to add.

  abstractmethod async search_memory(*, app_name, user_id, query)

    Searches for sessions that match the query.

    Return type:

      `SearchMemoryResponse`

    Parameters:

      - app_name – The name of the application.

      - user_id – The id of the user.

      - query – The query to search for.

    Returns:

      A SearchMemoryResponse containing the matching memories.

# google.adk.models module

Defines the interface to support a model.

pydantic model google.adk.models.BaseLlm

  Bases: `BaseModel`

  The BaseLLM class.

  Show JSON schema

      {
         "title": "BaseLlm",
         "description": "The BaseLLM class.",
         "type": "object",
         "properties": {
            "model": {
               "title": "Model",
               "type": "string"
            }
         },
         "required": [
            "model"
         ]
      }

  Fields:

    - `model (str)`

  field model: str [Required]

    The name of the LLM, e.g. gemini-2.5-flash or gemini-2.5-pro.

  classmethod supported_models()

    Returns a list of supported models in regex for LlmRegistry.

    Return type:

      `list`[`str`]

  connect(llm_request)

    Creates a live connection to the LLM.

    Return type:

      `BaseLlmConnection`

    Parameters:

      llm_request – LlmRequest, the request to send to the LLM.

    Returns:

      BaseLlmConnection, the connection to the LLM.

  abstractmethod async generate_content_async(llm_request, stream=False)

    Generates content for a single model turn.

    > This method handles Server-Sent Events (SSE) streaming for unidirectional content generation. For bidirectional streaming (e.g., Gemini Live API), use the connect() method instead.

    > Args:

    >   llm_request: LlmRequest, the request to send to the LLM. stream: bool = False, whether to enable SSE streaming mode.

    > Yields:

    >   LlmResponse objects representing the model’s response for one turn.

    >   Non-streaming mode (stream=False):

    >   > Yields exactly one LlmResponse containing the complete model output (text, function calls, bytes, etc.). This response has partial=False.

    >   Streaming mode (stream=True):

    >   > Yields multiple LlmResponse objects as chunks arrive:

    >   > - Intermediate chunks: partial=True (progressive updates)

    >   > - Final chunk: partial=False (aggregated content from entire turn, identical to stream=False output)

    >   > - Text consolidation: Consecutive text parts of the same type (thought/non-thought) SHOULD merge without separator, but client code must not rely on this - unconsolidated parts are unusual but also valid

    >   Common content in partial chunks:

    >   > All intermediate chunks have partial=True regardless of content type. Common examples include:

    >   > - Text: Streams incrementally as tokens arrive

    >   > - Function calls: May arrive in separate chunks

    >   > - Bytes (e.g., images): Typically arrive as single chunk, interleaved with text

    >   > - Thoughts: Stream incrementally when thinking_config is enabled

    >   Examples:

    >   1. Simple text streaming:

    >          LlmResponse(partial=True,  parts=["The weather"])
    >          LlmResponse(partial=True,  parts=[" in Tokyo is"])
    >          LlmResponse(partial=True,  parts=[" sunny."])
    >          LlmResponse(partial=False, parts=["The weather in Tokyo is sunny."])

    >   2. Text + function call:

    >          LlmResponse(partial=True,  parts=[Text("Let me check...")])
    >          LlmResponse(partial=True,  parts=[FunctionCall("get_weather", ...)])
    >          LlmResponse(partial=False, parts=[Text("Let me check..."),
    >                                            FunctionCall("get_weather", ...)])

    >   3. Parallel function calls across chunks:

    >          LlmResponse(partial=True,  parts=[Text("Checking both cities...")])
    >          LlmResponse(partial=True,  parts=[FunctionCall("get_weather", Tokyo)])
    >          LlmResponse(partial=True,  parts=[FunctionCall("get_weather", NYC)])
    >          LlmResponse(partial=False, parts=[Text("Checking both cities..."),
    >                                            FunctionCall("get_weather", Tokyo),
    >                                            FunctionCall("get_weather", NYC)])

    >   4. Text + bytes (image generation with gemini-2.5-flash-image):

    >          LlmResponse(partial=True,  parts=[Text("Here's an image of a dog.")])
    >          LlmResponse(partial=True,  parts=[Text("

    “)])

      LlmResponse(partial=True, parts=[Blob(image/png, 1.6MB)]) LlmResponse(partial=True, parts=[Text(“It carries a bone”)]) LlmResponse(partial=True, parts=[Text(” and running around.”)]) LlmResponse(partial=False, parts=[Text(“Here’s an image of a dog.

    “),

      > > Blob(image/png, 1.6MB), Text(“It carries a bone and running around.”)])

      > Note: Consecutive text parts before and after blob merge separately.

      5. Text with thinking (gemini-2.5-flash with thinking_config):

             LlmResponse(partial=True,  parts=[Thought("Let me analyze...")])
             LlmResponse(partial=True,  parts=[Thought("The user wants...")])
             LlmResponse(partial=True,  parts=[Text("Based on my analysis,")])
             LlmResponse(partial=True,  parts=[Text(" the answer is 42.")])
             LlmResponse(partial=False, parts=[Thought("Let me analyze...The user wants..."),
                                               Text("Based on my analysis, the answer is 42.")])

         Note: Consecutive parts of same type merge (thoughts→thought, text→text).

      Important: All yielded responses represent one logical model turn. The final response with partial=False should be identical to the response that would be received with stream=False.

    Return type:

      `AsyncGenerator`[`LlmResponse`, `None`]

class google.adk.models.LLMRegistry

  Bases: `object`

  Registry for LLMs.

  static new_llm(model)

    Creates a new LLM instance.

    Return type:

      `BaseLlm`

    Parameters:

      model – The model name.

    Returns:

      The LLM instance.

  static register(llm_cls)

    Registers a new LLM class.

    Parameters:

      llm_cls – The class that implements the model.

  static resolve(model)

    Resolves the model to a BaseLlm subclass.

    Return type:

      `type`[`BaseLlm`]

    Parameters:

      model – The model name.

    Returns:

      The BaseLlm subclass.

    Raises:

      ValueError – If the model is not found.

# google.adk.optimization module

# google.adk.planners module

class google.adk.planners.BasePlanner

  Bases: `ABC`

  Abstract base class for all planners.

  The planner allows the agent to generate plans for the queries to guide its action.

  abstractmethod build_planning_instruction(readonly_context, llm_request)

    Builds the system instruction to be appended to the LLM request for planning.

    Return type:

      `Optional`[`str`]

    Parameters:

      - readonly_context – The readonly context of the invocation.

      - llm_request – The LLM request. Readonly.

    Returns:

      The planning system instruction, or None if no instruction is needed.

  abstractmethod process_planning_response(callback_context, response_parts)

    Processes the LLM response for planning.

    Return type:

      `Optional`[`List`[`Part`]]

    Parameters:

      - callback_context – The callback context of the invocation.

      - response_parts – The LLM response parts. Readonly.

    Returns:

      The processed response parts, or None if no processing is needed.

class google.adk.planners.BuiltInPlanner(*, thinking_config)

  Bases: `BasePlanner`

  The built-in planner that uses model’s built-in thinking features.

  thinking_config

    Config for model built-in thinking features. An error will be returned if this field is set for models that don’t support thinking.

  Initializes the built-in planner.

  Parameters:

    thinking_config – Config for model built-in thinking features. An error will be returned if this field is set for models that don’t support thinking.

  apply_thinking_config(llm_request)

    Applies the thinking config to the LLM request.

    Return type:

      `None`

    Parameters:

      llm_request – The LLM request to apply the thinking config to.

  build_planning_instruction(readonly_context, llm_request)

    Builds the system instruction to be appended to the LLM request for planning.

    Return type:

      `Optional`[`str`]

    Parameters:

      - readonly_context – The readonly context of the invocation.

      - llm_request – The LLM request. Readonly.

    Returns:

      The planning system instruction, or None if no instruction is needed.

  process_planning_response(callback_context, response_parts)

    Processes the LLM response for planning.

    Return type:

      `Optional`[`List`[`Part`]]

    Parameters:

      - callback_context – The callback context of the invocation.

      - response_parts – The LLM response parts. Readonly.

    Returns:

      The processed response parts, or None if no processing is needed.

  thinking_config: `ThinkingConfig`

    Config for model built-in thinking features. An error will be returned if this field is set for models that don’t support thinking.

class google.adk.planners.PlanReActPlanner

  Bases: `BasePlanner`

  Plan-Re-Act planner that constrains the LLM response to generate a plan before any action/observation.

  Note: this planner does not require the model to support built-in thinking features or setting the thinking config.

  build_planning_instruction(readonly_context, llm_request)

    Builds the system instruction to be appended to the LLM request for planning.

    Return type:

      `str`

    Parameters:

      - readonly_context – The readonly context of the invocation.

      - llm_request – The LLM request. Readonly.

    Returns:

      The planning system instruction, or None if no instruction is needed.

  process_planning_response(callback_context, response_parts)

    Processes the LLM response for planning.

    Return type:

      `Optional`[`List`[`Part`]]

    Parameters:

      - callback_context – The callback context of the invocation.

      - response_parts – The LLM response parts. Readonly.

    Returns:

      The processed response parts, or None if no processing is needed.

# google.adk.platform module

# google.adk.plugins module

class google.adk.plugins.BasePlugin(name)

  Bases: `ABC`

  Base class for creating plugins.

  Plugins provide a structured way to intercept and modify agent, tool, and LLM behaviors at critical execution points in a callback manner. While agent callbacks apply to a particular agent, plugins applies globally to all agents added in the runner. Plugins are best used for adding custom behaviors like logging, monitoring, caching, or modifying requests and responses at key stages.

  A plugin can implement one or more methods of callbacks, but should not implement the same method of callback for multiple times.

  Relation with [Agent callbacks](https://google.github.io/adk-docs/callbacks/):

  Execution Order Similar to Agent callbacks, Plugins are executed in the order they are registered. However, Plugin and Agent Callbacks are executed sequentially, with Plugins takes precedence over agent callbacks. When the callback in a plugin returns a value, it will short circuit all remaining plugins and agent callbacks, causing all remaining plugins and agent callbacks to be skipped.

  Change Propagation Plugins and agent callbacks can both modify the value of the input parameters, including agent input, tool input, and LLM request/response, etc. They work in the exactly same way. The modifications will be visible and passed to the next callback in the chain. For example, if a plugin modifies the tool input with before_tool_callback, the modified tool input will be passed to the before_tool_callback of the next plugin, and further passed to the agent callbacks if not short-circuited.

  To use a plugin, implement the desired callback methods and pass an instance of your custom plugin class to the ADK Runner.

  Examples

  A simple plugin that logs every tool call.

      >>> class ToolLoggerPlugin(BasePlugin):
      ..   def __init__(self):
      ..     super().__init__(name="tool_logger")
      ..
      ..   async def before_tool_callback(
      ..       self, *, tool: BaseTool, tool_args: dict[str, Any],
      tool_context:
      ToolContext
      ..   ):
      ..     print(f"[{self.name}] Calling tool '{tool.name}' with args:
      {tool_args}")
      ..
      ..   async def after_tool_callback(
      ..       self, *, tool: BaseTool, tool_args: dict, tool_context:
      ToolContext, result: dict
      ..   ):
      ..     print(f"[{self.name}] Tool '{tool.name}' finished with result:
      {result}")
      ..
      >>> # Add the plugin to ADK Runner
      >>> # runner = Runner(
      >>> #     ...
      >>> #     plugins=[ToolLoggerPlugin(), AgentPolicyPlugin()],
      >>> # )

  Initializes the plugin.

  Parameters:

    name – A unique identifier for this plugin instance.

  async after_agent_callback(*, agent, callback_context)

    Callback executed after an agent’s primary logic has completed.

    Return type:

      `Optional`[`Content`]

    Parameters:

      - agent – The agent that has just run.

      - callback_context – The context for the agent invocation.

    Returns:

      An optional types.Content object. The content to return to the user. When the content is present, the provided content will be used as agent response and appended to event history as agent response.

  async after_model_callback(*, callback_context, llm_response)

    Callback executed after a response is received from the model.

    This is the ideal place to log model responses, collect metrics on token usage, or perform post-processing on the raw LlmResponse.

    Return type:

      `Optional`[`LlmResponse`]

    Parameters:

      - callback_context – The context for the current agent call.

      - llm_response – The response object received from the model.

    Returns:

      An optional value. A non-None return may be used by the framework to modify or replace the response. Returning None allows the original response to be used.

  async after_run_callback(*, invocation_context)

    Callback executed after an ADK runner run has completed.

    This is the final callback in the ADK lifecycle, suitable for cleanup, final logging, or reporting tasks.

    Return type:

      `None`

    Parameters:

      invocation_context – The context for the entire invocation.

    Returns:

      None

  async after_tool_callback(*, tool, tool_args, tool_context, result)

    Callback executed after a tool has been called.

    This callback allows for inspecting, logging, or modifying the result returned by a tool.

    Return type:

      `Optional`[`dict`]

    Parameters:

      - tool – The tool instance that has just been executed.

      - tool_args – The original arguments that were passed to the tool.

      - tool_context – The context specific to the tool execution.

      - result – The dictionary returned by the tool invocation.

    Returns:

      An optional dictionary. If a dictionary is returned, it will replace the original result from the tool. This allows for post-processing or altering tool outputs. Returning None uses the original, unmodified result.

  async before_agent_callback(*, agent, callback_context)

    Callback executed before an agent’s primary logic is invoked.

    This callback can be used for logging, setup, or to short-circuit the agent’s execution by returning a value.

    Return type:

      `Optional`[`Content`]

    Parameters:

      - agent – The agent that is about to run.

      - callback_context – The context for the agent invocation.

    Returns:

      An optional types.Content object. If a value is returned, it will bypass the agent’s callbacks and its execution, and return this value directly. Returning None allows the agent to proceed normally.

  async before_model_callback(*, callback_context, llm_request)

    Callback executed before a request is sent to the model.

    This provides an opportunity to inspect, log, or modify the LlmRequest object. It can also be used to implement caching by returning a cached LlmResponse, which would skip the actual model call.

    Return type:

      `Optional`[`LlmResponse`]

    Parameters:

      - callback_context – The context for the current agent call.

      - llm_request – The prepared request object to be sent to the model.

    Returns:

      An optional value. The interpretation of a non-None trigger an early exit and returns the response immediately. Returning None allows the LLM request to proceed normally.

  async before_run_callback(*, invocation_context)

    Callback executed before the ADK runner runs.

    This is the first callback to be called in the lifecycle, ideal for global setup or initialization tasks.

    Return type:

      `Optional`[`Content`]

    Parameters:

      invocation_context – The context for the entire invocation, containing session information, the root agent, etc.

    Returns:

      An optional Event to be returned to the ADK. Returning a value to halt execution of the runner and ends the runner with that event. Return None to proceed normally.

  async before_tool_callback(*, tool, tool_args, tool_context)

    Callback executed before a tool is called.

    This callback is useful for logging tool usage, input validation, or modifying the arguments before they are passed to the tool.

    Return type:

      `Optional`[`dict`]

    Parameters:

      - tool – The tool instance that is about to be executed.

      - tool_args – The dictionary of arguments to be used for invoking the tool.

      - tool_context – The context specific to the tool execution.

    Returns:

      An optional dictionary. If a dictionary is returned, it will stop the tool execution and return this response immediately. Returning None uses the original, unmodified arguments.

  async close()

    Method executed when the runner is closed.

    This method is used for cleanup tasks such as closing network connections or releasing resources.

    Return type:

      `None`

  async on_event_callback(*, invocation_context, event)

    Callback executed when the runner produces an event.

    This is the ideal place to modify the event before it is persisted to the session service and yielded to the caller.

    Return type:

      `Optional`[`Event`]

    Parameters:

      - invocation_context – The context for the entire invocation.

      - event – The event raised by the runner.

    Returns:

      An optional value. A non-None return may be used by the framework to modify or replace the response. Returning None allows the original response to be used.

  async on_model_error_callback(*, callback_context, llm_request, error)

    Callback executed when a model call encounters an error.

    This callback provides an opportunity to handle model errors gracefully, potentially providing alternative responses or recovery mechanisms.

    Return type:

      `Optional`[`LlmResponse`]

    Parameters:

      - callback_context – The context for the current agent call.

      - llm_request – The request that was sent to the model when the error occurred.

      - error – The exception that was raised during model execution.

    Returns:

      An optional LlmResponse. If an LlmResponse is returned, it will be used instead of propagating the error. Returning None allows the original error to be raised.

  async on_tool_error_callback(*, tool, tool_args, tool_context, error)

    Callback executed when a tool call encounters an error.

    This callback provides an opportunity to handle tool errors gracefully, potentially providing alternative responses or recovery mechanisms.

    Return type:

      `Optional`[`dict`]

    Parameters:

      - tool – The tool instance that encountered an error.

      - tool_args – The arguments that were passed to the tool.

      - tool_context – The context specific to the tool execution.

      - error – The exception that was raised during tool execution.

    Returns:

      An optional dictionary. If a dictionary is returned, it will be used as the tool response instead of propagating the error. Returning None allows the original error to be raised.

  async on_user_message_callback(*, invocation_context, user_message)

    Callback executed when a user message is received before an invocation starts.

    This callback helps logging and modifying the user message before the runner starts the invocation.

    Return type:

      `Optional`[`Content`]

    Parameters:

      - invocation_context – The context for the entire invocation.

      - user_message – The message content input by user.

    Returns:

      An optional types.Content to be returned to the ADK. Returning a value to replace the user message. Returning None to proceed normally.

class google.adk.plugins.PluginManager(plugins=None, close_timeout=5.0)

  Bases: `object`

  Manages the registration and execution of plugins.

  The PluginManager is an internal class that orchestrates the invocation of plugin callbacks at key points in the SDK’s execution lifecycle. It maintains a list of registered plugins and ensures they are called in the order they were registered.

  The core execution logic implements an “early exit” strategy: if any plugin callback returns a non-None value, the execution of subsequent plugins for that specific event is halted, and the returned value is propagated up the call stack. This allows plugins to short-circuit operations like agent runs, tool calls, or model requests.

  Initializes the plugin service.

  Parameters:

    - plugins – An optional list of plugins to register upon initialization.

    - close_timeout – The timeout in seconds for each plugin’s close method.

  async close()

    Calls the close method on all registered plugins concurrently.

    Return type:

      `None`

    Raises:

      RuntimeError – If one or more plugins failed to close, containing details of all failures.

  get_plugin(plugin_name)

    Retrieves a registered plugin by its name.

    Return type:

      `Optional`[`BasePlugin`]

    Parameters:

      plugin_name – The name of the plugin to retrieve.

    Returns:

      The plugin instance if found; otherwise, None.

  register_plugin(plugin)

    Registers a new plugin.

    Return type:

      `None`

    Parameters:

      plugin – The plugin instance to register.

    Raises:

      ValueError – If a plugin with the same name is already registered.

  async run_after_agent_callback(*, agent, callback_context)

    Runs the after_agent_callback for all plugins.

    Return type:

      `Optional`[`Content`]

  async run_after_model_callback(*, callback_context, llm_response)

    Runs the after_model_callback for all plugins.

    Return type:

      `Optional`[`LlmResponse`]

  async run_after_run_callback(*, invocation_context)

    Runs the after_run_callback for all plugins.

    Return type:

      `None`

  async run_after_tool_callback(*, tool, tool_args, tool_context, result)

    Runs the after_tool_callback for all plugins.

    Return type:

      `Optional`[`dict`]

  async run_before_agent_callback(*, agent, callback_context)

    Runs the before_agent_callback for all plugins.

    Return type:

      `Optional`[`Content`]

  async run_before_model_callback(*, callback_context, llm_request)

    Runs the before_model_callback for all plugins.

    Return type:

      `Optional`[`LlmResponse`]

  async run_before_run_callback(*, invocation_context)

    Runs the before_run_callback for all plugins.

    Return type:

      `Optional`[`Content`]

  async run_before_tool_callback(*, tool, tool_args, tool_context)

    Runs the before_tool_callback for all plugins.

    Return type:

      `Optional`[`dict`]

  async run_on_event_callback(*, invocation_context, event)

    Runs the on_event_callback for all plugins.

    Return type:

      `Optional`[`Event`]

  async run_on_model_error_callback(*, callback_context, llm_request, error)

    Runs the on_model_error_callback for all plugins.

    Return type:

      `Optional`[`LlmResponse`]

  async run_on_tool_error_callback(*, tool, tool_args, tool_context, error)

    Runs the on_tool_error_callback for all plugins.

    Return type:

      `Optional`[`dict`]

  async run_on_user_message_callback(*, user_message, invocation_context)

    Runs the on_user_message_callback for all plugins.

    Return type:

      `Optional`[`Content`]

# google.adk.runners module

class google.adk.runners.InMemoryRunner(agent=None, *, node=None, app_name=None, plugins=None, app=None, plugin_close_timeout=5.0)

  Bases: `Runner`

  An in-memory Runner for testing and development.

  This runner uses in-memory implementations for artifact, session, and memory services, providing a lightweight and self-contained environment for agent execution.

  agent

    The root agent to run.

  app_name

    The application name of the runner. Defaults to ‘InMemoryRunner’.

  Initializes the InMemoryRunner.

  Parameters:

    - agent – The root agent to run.

    - node – The root node to run.

    - app_name – The application name of the runner. Defaults to ‘InMemoryRunner’.

    - plugins – Optional list of plugins for the runner.

    - app – Optional App instance.

    - plugin_close_timeout – The timeout in seconds for plugin close methods.

class google.adk.runners.Runner(*, app=None, app_name=None, agent=None, node=None, plugins=None, artifact_service=None, session_service, memory_service=None, credential_service=None, plugin_close_timeout=5.0, auto_create_session=False)

  Bases: `object`

  The Runner class is used to run agents.

  It manages the execution of an agent within a session, handling message processing, event generation, and interaction with various services like artifact storage, session management, and memory.

  app_name

    The application name of the runner.

  agent

    The root agent to run.

  artifact_service

    The artifact service for the runner.

  plugin_manager

    The plugin manager for the runner.

  session_service

    The session service for the runner.

  memory_service

    The memory service for the runner.

  credential_service

    The credential service for the runner.

  context_cache_config

    The context cache config for the runner.

  resumability_config

    The resumability config for the application.

  Initializes the Runner.

  Exactly one of app, agent, or node must be provided. When agent or node is provided, the Runner wraps it into an App internally. Providing app is the recommended way to create a runner. When app is provided, app_name can optionally override the app’s name.

  Parameters:

    - app – An App instance. Mutually exclusive with agent and node.

    - app_name – The application name. Required when agent is provided. Optional override for app.name when app is provided. Defaults to node.name when only node is provided.

    - agent – The root agent to run. Mutually exclusive with app and node.

    - node – The root node to run. Mutually exclusive with app and agent.

    - plugins – Deprecated. A list of plugins for the runner. Please use the app argument to provide plugins instead.

    - artifact_service – The artifact service for the runner.

    - session_service – The session service for the runner.

    - memory_service – The memory service for the runner.

    - credential_service – The credential service for the runner.

    - plugin_close_timeout – The timeout in seconds for plugin close methods.

    - auto_create_session – Whether to automatically create a session when not found. Defaults to False. If False, a missing session raises ValueError with a helpful message.

  Raises:

    ValueError – If more than one of app, agent, or node is provided, or if none is provided, or if agent is provided without app_name.

  Self = typing.Self
  agent: Optional[BaseAgent | 'BaseNode'] = None

    The root agent or node to run.

  app_name: str

    The app name of the runner.

  artifact_service: Optional[BaseArtifactService] = None

    The artifact service for the runner.

  async close()

    Closes the runner.

  context_cache_config: Optional[ContextCacheConfig] = None

    The context cache config for the runner.

  credential_service: Optional[BaseCredentialService] = None

    The credential service for the runner.

  memory_service: Optional[BaseMemoryService] = None

    The memory service for the runner.

  plugin_manager: PluginManager

    The plugin manager for the runner.

  resumability_config: Optional[ResumabilityConfig] = None

    The resumability config for the application.

  async rewind_async(*, user_id, session_id, rewind_before_invocation_id, run_config=None)

    Rewinds the session to before the specified invocation.

    Return type:

      `None`

  run(*, user_id, session_id, new_message, run_config=None)

    Runs the agent.

    Return type:

      `Generator`[`Event`, `None`, `None`]

    Note

    This sync interface is only for local testing and convenience purpose. Consider using run_async for production usage.

    If event compaction is enabled in the App configuration, it will be performed after all agent events for the current invocation have been yielded. The generator will only finish iterating after event compaction is complete.

    Parameters:

      - user_id – The user ID of the session.

      - session_id – The session ID of the session.

      - new_message – A new message to append to the session.

      - run_config – The run config for the agent.

    Yields:

      The events generated by the agent.

  async run_async(*, user_id, session_id, invocation_id=None, new_message=None, state_delta=None, run_config=None, yield_user_message=False)

    Main entry method to run the agent in this runner.

    If event compaction is enabled in the App configuration, it will be performed after all agent events for the current invocation have been yielded. The async generator will only finish iterating after event compaction is complete. However, this does not block new run_async calls for subsequent user queries, which can be started concurrently.

    Return type:

      `AsyncGenerator`[`Event`, `None`]

    Parameters:

      - user_id – The user ID of the session.

      - session_id – The session ID of the session.

      - invocation_id – The invocation ID of the session, set this to resume an interrupted invocation.

      - new_message – A new message to append to the session.

      - state_delta – Optional state changes to apply to the session.

      - run_config – The run config for the agent.

      - yield_user_message – If True, yield the user message event before agent/node events.

    Yields:

      The events generated by the agent.

    Raises:

      ValueError – If the session is not found; If both invocation_id and new_message are None.

  async run_debug(user_messages, *, user_id='debug_user_id', session_id='debug_session_id', run_config=None, quiet=False, verbose=False)

    Debug helper for quick agent experimentation and testing.

    This convenience method is designed for developers getting started with ADK who want to quickly test agents without dealing with session management, content formatting, or event streaming. It automatically handles common boilerplate while hiding complexity.

    IMPORTANT: This is for debugging and experimentation only. For production use, please use the standard run_async() method which provides full control over session management, event streaming, and error handling.

    Return type:

      `list`[`Event`]

    Parameters:

      - user_messages – Message(s) to send to the agent. Can be: - Single string: “What is 2+2?” - List of strings: [“Hello!”, “What’s my name?”]

      - user_id – User identifier. Defaults to “debug_user_id”.

      - session_id – Session identifier for conversation persistence. Defaults to “debug_session_id”. Reuse the same ID to continue a conversation.

      - run_config – Optional configuration for the agent execution.

      - quiet – If True, suppresses console output. Defaults to False (output shown).

      - verbose – If True, shows detailed tool calls and responses. Defaults to False for cleaner output showing only final agent responses.

    Returns:

      All events from all messages.

    Return type:

      list[Event]

    Raises:

      ValueError – If session creation/retrieval fails.

    Examples

    Quick debugging: >>> runner = InMemoryRunner(agent=my_agent) >>> await runner.run_debug(“What is 2+2?”)

    Multiple queries in conversation: >>> await runner.run_debug([“Hello!”, “What’s my name?”])

    Continue a debug session: >>> await runner.run_debug(“What did we discuss?”) # Continues default session

    Separate debug sessions: >>> await runner.run_debug(“Hi”, user_id=”alice”, session_id=”debug1”) >>> await runner.run_debug(“Hi”, user_id=”bob”, session_id=”debug2”)

    Capture events for inspection: >>> events = await runner.run_debug(“Analyze this”) >>> for event in events: … inspect_event(event)

    Note

    For production applications requiring: - Custom session/memory services (Spanner, Cloud SQL, etc.) - Fine-grained event processing and streaming - Error recovery and resumability - Performance optimization Please use run_async() with proper configuration.

  async run_live(*, user_id=None, session_id=None, live_request_queue, run_config=None, session=None)

    Runs the agent in live mode (experimental feature).

    The run_live method yields a stream of Event objects, but not all yielded events are saved to the session. Here’s a breakdown:

    Return type:

      `AsyncGenerator`[`Event`, `None`]

    Events Yielded to Callers: * Live Model Audio Events with Inline Data: Events containing raw

    > audio Blob data(inline_data).

    - Live Model Audio Events with File Data: Both input and output audio data are aggregated into an audio file saved into artifacts. The reference to the file is saved in the event as file_data.

    - Usage Metadata: Events containing token usage.

    - Transcription Events: Both partial and non-partial transcription events are yielded.

    - Function Call and Response Events: Always saved.

    - Other Control Events: Most control events are saved.

    Events Saved to the Session: * Live Model Audio Events with File Data: Both input and ouput audio

    > data are aggregated into an audio file saved into artifacts. The reference to the file is saved as event in the file_data to session if RunConfig.save_live_model_audio_to_session is True.

    - Usage Metadata Events: Saved to the session.

    - Non-Partial Transcription Events: Non-partial transcription events are saved.

    - Function Call and Response Events: Always saved.

    - Other Control Events: Most control events are saved.

    Events Not Saved to the Session: * Live Model Audio Events with Inline Data: Events containing raw

    > audio Blob data are not saved to the session.

    Parameters:

      - user_id – The user ID for the session. Required if session is None.

      - session_id – The session ID for the session. Required if session is None.

      - live_request_queue – The queue for live requests.

      - run_config – The run config for the agent.

      - session – The session to use. This parameter is deprecated, please use user_id and session_id instead.

    Yields:

      AsyncGenerator[Event, None] – An asynchronous generator that yields Event objects as they are produced by the agent during its live execution.

    Warning

    This feature is experimental and its API or behavior may change in future releases.

    Note

    Either session or both user_id and session_id must be provided.

  session_service: BaseSessionService

    The session service for the runner.

# google.adk.sessions module

class google.adk.sessions.BaseSessionService

  Bases: `ABC`

  Base class for session services.

  The service provides a set of methods for managing sessions and events.

  async append_event(session, event)

    Appends an event to a session object.

    Return type:

      `Event`

  abstractmethod async create_session(*, app_name, user_id, state=None, session_id=None)

    Creates a new session.

    Return type:

      `Session`

    Parameters:

      - app_name – the name of the app.

      - user_id – the id of the user.

      - state – the initial state of the session.

      - session_id – the client-provided id of the session. If not provided, a generated ID will be used.

    Returns:

      The newly created session instance.

    Return type:

      session

  abstractmethod async delete_session(*, app_name, user_id, session_id)

    Deletes a session.

    Return type:

      `None`

  async flush()

    Flushes any buffered events.

    For non-buffering implementations, this can be a no-op.

  abstractmethod async get_session(*, app_name, user_id, session_id, config=None)

    Gets a session.

    Return type:

      `Optional`[`Session`]

  abstractmethod async list_sessions(*, app_name, user_id=None)

    Lists all the sessions for a user.

    Return type:

      `ListSessionsResponse`

    Parameters:

      - app_name – The name of the app.

      - user_id – The ID of the user. If not provided, lists all sessions for all users.

    Returns:

      A ListSessionsResponse containing the sessions.

pydantic model google.adk.sessions.Session

  Bases: `BaseModel`

  Represents a series of interactions between a user and agents.

  Show JSON schema

      {
         "title": "Session",
         "description": "Represents a series of interactions between a user and agents.",
         "type": "object",
         "properties": {
            "id": {
               "title": "Id",
               "type": "string"
            },
            "appName": {
               "title": "Appname",
               "type": "string"
            },
            "userId": {
               "title": "Userid",
               "type": "string"
            },
            "state": {
               "additionalProperties": true,
               "title": "State",
               "type": "object"
            },
            "events": {
               "items": {
                  "$ref": "#/$defs/Event"
               },
               "title": "Events",
               "type": "array"
            },
            "lastUpdateTime": {
               "default": 0.0,
               "title": "Lastupdatetime",
               "type": "number"
            }
         },
         "$defs": {
            "APIKey": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "apiKey"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "in": {
                     "$ref": "#/$defs/APIKeyIn"
                  },
                  "name": {
                     "title": "Name",
                     "type": "string"
                  }
               },
               "required": [
                  "in",
                  "name"
               ],
               "title": "APIKey",
               "type": "object"
            },
            "APIKeyIn": {
               "enum": [
                  "query",
                  "header",
                  "cookie"
               ],
               "title": "APIKeyIn",
               "type": "string"
            },
            "AuthConfig": {
               "additionalProperties": true,
               "description": "The auth config sent by tool asking client to collect auth credentials and\n\nadk and client will help to fill in the response",
               "properties": {
                  "authScheme": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/APIKey"
                        },
                        {
                           "$ref": "#/$defs/HTTPBase"
                        },
                        {
                           "$ref": "#/$defs/OAuth2"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnect"
                        },
                        {
                           "$ref": "#/$defs/HTTPBearer"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnectWithConfig"
                        },
                        {
                           "$ref": "#/$defs/CustomAuthScheme"
                        }
                     ],
                     "title": "Authscheme"
                  },
                  "rawAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "exchangedAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "credentialKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Credentialkey"
                  }
               },
               "required": [
                  "authScheme"
               ],
               "title": "AuthConfig",
               "type": "object"
            },
            "AuthCredential": {
               "additionalProperties": true,
               "description": "Data class representing an authentication credential.\n\nTo exchange for the actual credential, please use\nCredentialExchanger.exchange_credential().\n\nExamples: API Key Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    api_key=\"1234\",\n)\n\nExample: HTTP Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"basic\",\n        credentials=HttpCredentials(username=\"user\", password=\"password\"),\n    ),\n)\n\nExample: OAuth2 Bearer Token in HTTP Header\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"bearer\",\n        credentials=HttpCredentials(token=\"eyAkaknabna....\"),\n    ),\n)\n\nExample: OAuth2 Auth with Authorization Code Flow\nAuthCredential(\n    auth_type=AuthCredentialTypes.OAUTH2,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n    ),\n)\n\nExample: OpenID Connect Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n        redirect_uri=\"https://example.com\",\n        scopes=[\"scope1\", \"scope2\"],\n    ),\n)\n\nExample: Auth with resource reference\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    resource_ref=\"projects/1234/locations/us-central1/resources/resource1\",\n)",
               "properties": {
                  "authType": {
                     "$ref": "#/$defs/AuthCredentialTypes"
                  },
                  "resourceRef": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Resourceref"
                  },
                  "apiKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Apikey"
                  },
                  "http": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/HttpAuth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "serviceAccount": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccount"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "oauth2": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuth2Auth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "required": [
                  "authType"
               ],
               "title": "AuthCredential",
               "type": "object"
            },
            "AuthCredentialTypes": {
               "description": "Represents the type of authentication credential.",
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect",
                  "serviceAccount"
               ],
               "title": "AuthCredentialTypes",
               "type": "string"
            },
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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"
            },
            "CacheMetadata": {
               "additionalProperties": false,
               "description": "Metadata for context cache associated with LLM responses.\n\nThis class stores cache identification, usage tracking, and lifecycle\ninformation for a particular cache instance. It can be in two states:\n\n1. Active cache state: cache_name is set, all fields populated\n2. Fingerprint-only state: cache_name is None, only fingerprint and\n   contents_count are set for prefix matching\n\nToken counts (cached and total) are available in the LlmResponse.usage_metadata\nand should be accessed from there to avoid duplication.\n\nAttributes:\n    cache_name: The full resource name of the cached content (e.g.,\n        'projects/123/locations/us-central1/cachedContents/456').\n        None when no active cache exists (fingerprint-only state).\n    expire_time: Unix timestamp when the cache expires. None when no\n        active cache exists.\n    fingerprint: Hash of cacheable contents (instruction + tools + contents).\n        Always present for prefix matching.\n    invocations_used: Number of invocations this cache has been used for.\n        None when no active cache exists.\n    contents_count: Number of contents. When active cache exists, this is\n        the count of cached contents. When no active cache exists, this is\n        the total count of contents in the request.\n    created_at: Unix timestamp when the cache was created. None when\n        no active cache exists.",
               "properties": {
                  "cache_name": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Full resource name of the cached content (None if no active cache)",
                     "title": "Cache Name"
                  },
                  "expire_time": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unix timestamp when cache expires (None if no active cache)",
                     "title": "Expire Time"
                  },
                  "fingerprint": {
                     "description": "Hash of cacheable contents used to detect changes",
                     "title": "Fingerprint",
                     "type": "string"
                  },
                  "invocations_used": {
                     "anyOf": [
                        {
                           "minimum": 0,
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Number of invocations this cache has been used for (None if no active cache)",
                     "title": "Invocations Used"
                  },
                  "contents_count": {
                     "description": "Number of contents (cached contents when active cache exists, total contents in request when no active cache)",
                     "minimum": 0,
                     "title": "Contents Count",
                     "type": "integer"
                  },
                  "created_at": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unix timestamp when cache was created (None if no active cache)",
                     "title": "Created At"
                  }
               },
               "required": [
                  "fingerprint",
                  "contents_count"
               ],
               "title": "CacheMetadata",
               "type": "object"
            },
            "Citation": {
               "additionalProperties": false,
               "description": "A citation for a piece of generatedcontent.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "endIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The end index of the citation in the content.",
                     "title": "Endindex"
                  },
                  "license": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The license of the source of the citation.",
                     "title": "License"
                  },
                  "publicationDate": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GoogleTypeDate"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The publication date of the source of the citation."
                  },
                  "startIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The start index of the citation in the content.",
                     "title": "Startindex"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The title of the source of the citation.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The URI of the source of the citation.",
                     "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "CustomAuthScheme": {
               "additionalProperties": true,
               "description": "A flexible model for custom authentication schemes.\n\nThe subclasses must define a `default` for the `type_` field, if using OAuth2\nuser consent flow, to ensure correct rehydration.",
               "properties": {
                  "type": {
                     "title": "Type",
                     "type": "string"
                  }
               },
               "required": [
                  "type"
               ],
               "title": "CustomAuthScheme",
               "type": "object"
            },
            "Event": {
               "description": "Represents an event in a conversation between agents and users.\n\nIt is used to store the content of the conversation, as well as the actions\ntaken by the agents like function calls, etc.",
               "properties": {
                  "modelVersion": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Modelversion"
                  },
                  "content": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Content"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "groundingMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "partial": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Partial"
                  },
                  "turnComplete": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Turncomplete"
                  },
                  "finishReason": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FinishReason"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "errorCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Errorcode"
                  },
                  "errorMessage": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Errormessage"
                  },
                  "interrupted": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Interrupted"
                  },
                  "customMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Custommetadata"
                  },
                  "usageMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GenerateContentResponseUsageMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "liveSessionResumptionUpdate": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/LiveServerSessionResumptionUpdate"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "liveSessionId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Livesessionid"
                  },
                  "goAway": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/LiveServerGoAway"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "inputTranscription": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Transcription"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "outputTranscription": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Transcription"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "avgLogprobs": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Avglogprobs"
                  },
                  "logprobsResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/LogprobsResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "cacheMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CacheMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "citationMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CitationMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "interactionId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Interactionid"
                  },
                  "invocationId": {
                     "default": "",
                     "title": "Invocationid",
                     "type": "string"
                  },
                  "author": {
                     "default": "",
                     "title": "Author",
                     "type": "string"
                  },
                  "actions": {
                     "$ref": "#/$defs/EventActions"
                  },
                  "output": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output"
                  },
                  "nodeInfo": {
                     "$ref": "#/$defs/NodeInfo"
                  },
                  "longRunningToolIds": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array",
                           "uniqueItems": true
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Longrunningtoolids"
                  },
                  "branch": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Branch"
                  },
                  "isolationScope": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Isolationscope"
                  },
                  "id": {
                     "default": "",
                     "title": "Id",
                     "type": "string"
                  },
                  "timestamp": {
                     "title": "Timestamp",
                     "type": "number"
                  }
               },
               "title": "Event",
               "type": "object"
            },
            "EventActions": {
               "additionalProperties": false,
               "description": "Represents the actions attached to an event.",
               "properties": {
                  "skipSummarization": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Skipsummarization"
                  },
                  "stateDelta": {
                     "additionalProperties": true,
                     "title": "Statedelta",
                     "type": "object"
                  },
                  "artifactDelta": {
                     "additionalProperties": {
                        "type": "integer"
                     },
                     "title": "Artifactdelta",
                     "type": "object"
                  },
                  "transferToAgent": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Transfertoagent"
                  },
                  "escalate": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Escalate"
                  },
                  "requestedAuthConfigs": {
                     "additionalProperties": {
                        "$ref": "#/$defs/AuthConfig"
                     },
                     "title": "Requestedauthconfigs",
                     "type": "object"
                  },
                  "requestedToolConfirmations": {
                     "additionalProperties": {
                        "$ref": "#/$defs/ToolConfirmation"
                     },
                     "title": "Requestedtoolconfirmations",
                     "type": "object"
                  },
                  "compaction": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/EventCompaction"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "endOfAgent": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Endofagent"
                  },
                  "agentState": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Agentstate"
                  },
                  "rewindBeforeInvocationId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Rewindbeforeinvocationid"
                  },
                  "route": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "integer"
                        },
                        {
                           "type": "string"
                        },
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "boolean"
                                 },
                                 {
                                    "type": "integer"
                                 },
                                 {
                                    "type": "string"
                                 }
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Route"
                  },
                  "renderUiWidgets": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/UiWidget"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Renderuiwidgets"
                  },
                  "setModelResponse": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Setmodelresponse"
                  }
               },
               "title": "EventActions",
               "type": "object"
            },
            "EventCompaction": {
               "additionalProperties": false,
               "description": "The compaction of the events.",
               "properties": {
                  "startTimestamp": {
                     "title": "Starttimestamp",
                     "type": "number"
                  },
                  "endTimestamp": {
                     "title": "Endtimestamp",
                     "type": "number"
                  },
                  "compactedContent": {
                     "$ref": "#/$defs/Content"
                  }
               },
               "required": [
                  "startTimestamp",
                  "endTimestamp",
                  "compactedContent"
               ],
               "title": "EventCompaction",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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",
                  "UNEXPECTED_TOOL_CALL",
                  "IMAGE_PROHIBITED_CONTENT",
                  "NO_IMAGE",
                  "IMAGE_RECITATION",
                  "IMAGE_OTHER"
               ],
               "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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"
            },
            "GenerateContentResponseUsageMetadata": {
               "additionalProperties": false,
               "description": "Usage metadata about the content generation request and response.\n\nThis message provides a detailed breakdown of token usage and other relevant\nmetrics. This data type is not supported in Gemini API.",
               "properties": {
                  "cacheTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown of the token count for each modality in the cached content.",
                     "title": "Cachetokensdetails"
                  },
                  "cachedContentTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens in the cached content that was used for this request.",
                     "title": "Cachedcontenttokencount"
                  },
                  "candidatesTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens in the generated candidates.",
                     "title": "Candidatestokencount"
                  },
                  "candidatesTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown of the token count for each modality in the generated candidates.",
                     "title": "Candidatestokensdetails"
                  },
                  "promptTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also 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. A detailed breakdown of the token count for each modality in the prompt.",
                     "title": "Prompttokensdetails"
                  },
                  "thoughtsTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens that were part of the model's generated \"thoughts\" output, if applicable.",
                     "title": "Thoughtstokencount"
                  },
                  "toolUsePromptTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.",
                     "title": "Tooluseprompttokencount"
                  },
                  "toolUsePromptTokensDetails": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/ModalityTokenCount"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.",
                     "title": "Tooluseprompttokensdetails"
                  },
                  "totalTokenCount": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.",
                     "title": "Totaltokencount"
                  },
                  "trafficType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/TrafficType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The traffic type for this request."
                  }
               },
               "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. This\ndata type is not supported in Gemini API.",
               "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": "A piece of evidence that supports a claim made by the model.\n\nThis is used to show a citation for a claim made by the model. When grounding\nis enabled, the model returns a `GroundingChunk` that contains a reference to\nthe source of the information.",
               "properties": {
                  "image": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkImage"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from an image search result. See the `Image` message for details."
                  },
                  "maps": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMaps"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A `Maps` chunk is a piece of evidence that comes from Google Maps.\n\n      It contains information about a place, such as its name, address, and\n      reviews. This is used to provide the user with rich, location-based\n      information."
                  },
                  "retrievedContext": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkRetrievedContext"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details"
                  },
                  "web": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkWeb"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A grounding chunk from a web page, typically from Google Search. See the `Web` message for details."
                  }
               },
               "title": "GroundingChunk",
               "type": "object"
            },
            "GroundingChunkCustomMetadata": {
               "additionalProperties": false,
               "description": "User provided metadata about the GroundingFact.\n\nThis data type is not supported in Vertex AI.",
               "properties": {
                  "key": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The key of the metadata.",
                     "title": "Key"
                  },
                  "numericValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used.",
                     "title": "Numericvalue"
                  },
                  "stringListValue": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkStringList"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A list of string values for the metadata."
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The string value of the metadata.",
                     "title": "Stringvalue"
                  }
               },
               "title": "GroundingChunkCustomMetadata",
               "type": "object"
            },
            "GroundingChunkImage": {
               "additionalProperties": false,
               "description": "An `Image` chunk is a piece of evidence that comes from an image search result.\n\nIt contains the URI of the image search result and the URI of the image. This\nis used to provide the user with a link to the source of the information.",
               "properties": {
                  "sourceUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the image search result page.",
                     "title": "Sourceuri"
                  },
                  "imageUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the image.",
                     "title": "Imageuri"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the image search result page.",
                     "title": "Title"
                  },
                  "domain": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The domain of the image search result page.",
                     "title": "Domain"
                  }
               },
               "title": "GroundingChunkImage",
               "type": "object"
            },
            "GroundingChunkMaps": {
               "additionalProperties": false,
               "description": "A `Maps` chunk is a piece of evidence that comes from Google Maps.\n\nIt contains information about a place, such as its name, address, and reviews.\nThis is used to provide the user with rich, location-based information.",
               "properties": {
                  "placeAnswerSources": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSources"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The sources that were used to generate the place answer.\n\n      This includes review snippets and photos that were used to generate the\n      answer, as well as URIs to flag content."
                  },
                  "placeId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "This Place's resource name, in `places/{place_id}` format.\n\n      This can be used to look up the place in the Google Maps API.",
                     "title": "Placeid"
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The text of the place answer.",
                     "title": "Text"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the place.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the place.",
                     "title": "Uri"
                  },
                  "route": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsRoute"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. Route information."
                  }
               },
               "title": "GroundingChunkMaps",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSources": {
               "additionalProperties": false,
               "description": "The sources that were used to generate the place answer.\n\nThis includes review snippets and photos that were used to generate the\nanswer, as well as URIs to flag content.",
               "properties": {
                  "reviewSnippet": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Snippets of reviews that were used to generate the answer.",
                     "title": "Reviewsnippet"
                  },
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link where users can flag a problem with the generated answer.",
                     "title": "Flagcontenturi"
                  },
                  "reviewSnippets": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Snippets of reviews that were used to generate the answer.",
                     "title": "Reviewsnippets"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSources",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution": {
               "additionalProperties": false,
               "description": "Author attribution for a photo or review.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Name of the author of the Photo or Review.",
                     "title": "Displayname"
                  },
                  "photoUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Profile photo URI of the author of the Photo or Review.",
                     "title": "Photouri"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "URI of the author of the Photo or Review.",
                     "title": "Uri"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution",
               "type": "object"
            },
            "GroundingChunkMapsPlaceAnswerSourcesReviewSnippet": {
               "additionalProperties": false,
               "description": "Encapsulates a review snippet.",
               "properties": {
                  "authorAttribution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "This review's author."
                  },
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link where users can flag a problem with the review.",
                     "title": "Flagcontenturi"
                  },
                  "googleMapsUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A link to show the review on Google Maps.",
                     "title": "Googlemapsuri"
                  },
                  "relativePublishTimeDescription": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country.",
                     "title": "Relativepublishtimedescription"
                  },
                  "review": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A reference representing this place review which may be used to look up this place review again.",
                     "title": "Review"
                  },
                  "reviewId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Id of the review referencing the place.",
                     "title": "Reviewid"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Title of the review.",
                     "title": "Title"
                  }
               },
               "title": "GroundingChunkMapsPlaceAnswerSourcesReviewSnippet",
               "type": "object"
            },
            "GroundingChunkMapsRoute": {
               "additionalProperties": false,
               "description": "Route information from Google Maps.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "distanceMeters": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total distance of the route, in meters.",
                     "title": "Distancemeters"
                  },
                  "duration": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The total duration of the route.",
                     "title": "Duration"
                  },
                  "encodedPolyline": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "An encoded polyline of the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm",
                     "title": "Encodedpolyline"
                  }
               },
               "title": "GroundingChunkMapsRoute",
               "type": "object"
            },
            "GroundingChunkRetrievedContext": {
               "additionalProperties": false,
               "description": "Context retrieved from a data source to ground the model's response.\n\nThis is used when a retrieval tool fetches information from a user-provided\ncorpus or a public dataset.",
               "properties": {
                  "documentName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. This field is not supported in Gemini API.",
                     "title": "Documentname"
                  },
                  "ragChunk": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RagChunk"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used. This field is not supported in Gemini API."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The content of the retrieved data source.",
                     "title": "Text"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the retrieved data source.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the retrieved data source.",
                     "title": "Uri"
                  },
                  "customMetadata": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunkCustomMetadata"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. User-provided metadata about the retrieved context. This field is not supported in Vertex AI.",
                     "title": "Custommetadata"
                  },
                  "fileSearchStore": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`. This field is not supported in Vertex AI.",
                     "title": "Filesearchstore"
                  },
                  "pageNumber": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Page number of the retrieved context. This field is not supported in Vertex AI.",
                     "title": "Pagenumber"
                  },
                  "mediaId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Media ID. This field is not supported in Vertex AI.",
                     "title": "Mediaid"
                  }
               },
               "title": "GroundingChunkRetrievedContext",
               "type": "object"
            },
            "GroundingChunkStringList": {
               "additionalProperties": false,
               "description": "A list of string values. This data type is not supported in Vertex AI.",
               "properties": {
                  "values": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The string values of the list.",
                     "title": "Values"
                  }
               },
               "title": "GroundingChunkStringList",
               "type": "object"
            },
            "GroundingChunkWeb": {
               "additionalProperties": false,
               "description": "A `Web` chunk is a piece of evidence that comes from a web page.\n\nIt contains the URI of the web page, the title of the page, and the domain of\nthe page. This is used to provide the user with a link to the source of the\ninformation.",
               "properties": {
                  "domain": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The domain of the web page that contains the evidence. This can be used to filter out low-quality sources. This field is not supported in Gemini API.",
                     "title": "Domain"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The title of the web page that contains the evidence.",
                     "title": "Title"
                  },
                  "uri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI of the web page that contains the evidence.",
                     "title": "Uri"
                  }
               },
               "title": "GroundingChunkWeb",
               "type": "object"
            },
            "GroundingMetadata": {
               "additionalProperties": false,
               "description": "Information for various kinds of grounding.",
               "properties": {
                  "imageSearchQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The image search queries that were used to generate the content. This field is populated only when the grounding source is Google Search with the Image Search search_type enabled.",
                     "title": "Imagesearchqueries"
                  },
                  "groundingChunks": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingChunk"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of supporting references retrieved from the grounding\n      source. This field is populated when the grounding source is Google\n      Search, Vertex AI Search, or Google Maps.\n      ",
                     "title": "Groundingchunks"
                  },
                  "groundingSupports": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingSupport"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of grounding support.",
                     "title": "Groundingsupports"
                  },
                  "retrievalMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetrievalMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Metadata related to retrieval in the grounding flow."
                  },
                  "searchEntryPoint": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/SearchEntryPoint"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Google search entry for the following-up web\n      searches."
                  },
                  "webSearchQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Web search queries for the following-up web search.",
                     "title": "Websearchqueries"
                  },
                  "googleMapsWidgetContextToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.",
                     "title": "Googlemapswidgetcontexttoken"
                  },
                  "retrievalQueries": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The queries that were executed by the retrieval tools. This field is populated only when the grounding source is a retrieval tool, such as Vertex AI Search. This field is not supported in Gemini API.",
                     "title": "Retrievalqueries"
                  },
                  "sourceFlaggingUris": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/GroundingMetadataSourceFlaggingUri"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps. This field is not supported in Gemini API.",
                     "title": "Sourceflagginguris"
                  }
               },
               "title": "GroundingMetadata",
               "type": "object"
            },
            "GroundingMetadataSourceFlaggingUri": {
               "additionalProperties": false,
               "description": "A URI that can be used to flag a place or review for inappropriate content.\n\nThis is populated only when the grounding source is Google Maps. This data\ntype is not supported in Gemini API.",
               "properties": {
                  "flagContentUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The URI that can be used to flag the content.",
                     "title": "Flagcontenturi"
                  },
                  "sourceId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The ID of the place or review.",
                     "title": "Sourceid"
                  }
               },
               "title": "GroundingMetadataSourceFlaggingUri",
               "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.\n\n      Ranges from 0 to 1. 1 is the most confident. This list must have the\n      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\n      citations associated with the claim. For instance [1,3,4] means that\n      grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the\n      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."
                  },
                  "renderedParts": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "integer"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Indices into the `rendered_parts` field of the `GroundingMetadata` message. These indices specify which rendered parts are associated with this support message.",
                     "title": "Renderedparts"
                  }
               },
               "title": "GroundingSupport",
               "type": "object"
            },
            "HTTPBase": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  }
               },
               "required": [
                  "scheme"
               ],
               "title": "HTTPBase",
               "type": "object"
            },
            "HTTPBearer": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "const": "bearer",
                     "default": "bearer",
                     "title": "Scheme",
                     "type": "string"
                  },
                  "bearerFormat": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Bearerformat"
                  }
               },
               "title": "HTTPBearer",
               "type": "object"
            },
            "HttpAuth": {
               "additionalProperties": true,
               "description": "The credentials and metadata for HTTP authentication.",
               "properties": {
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  },
                  "credentials": {
                     "$ref": "#/$defs/HttpCredentials"
                  },
                  "additionalHeaders": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "type": "string"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Additionalheaders"
                  }
               },
               "required": [
                  "scheme",
                  "credentials"
               ],
               "title": "HttpAuth",
               "type": "object"
            },
            "HttpCredentials": {
               "additionalProperties": true,
               "description": "Represents the secret token value for HTTP authentication, like user name, password, oauth token, etc.",
               "properties": {
                  "username": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Username"
                  },
                  "password": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Password"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token"
                  }
               },
               "title": "HttpCredentials",
               "type": "object"
            },
            "Language": {
               "description": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "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"
            },
            "LogprobsResult": {
               "additionalProperties": false,
               "description": "The log probabilities of the tokens generated by the model.\n\nThis is useful for understanding the model's confidence in its predictions and\nfor debugging. For example, you can use log probabilities to identify when the\nmodel is making a less confident prediction or to explore alternative\nresponses that the model considered. A low log probability can also indicate\nthat the model is \"hallucinating\" or generating factually incorrect\ninformation.",
               "properties": {
                  "chosenCandidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultCandidate"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of the chosen candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps. Note that the chosen candidate might not be in `top_candidates`.",
                     "title": "Chosencandidates"
                  },
                  "topCandidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultTopCandidates"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "A list of the top candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps.",
                     "title": "Topcandidates"
                  },
                  "logProbabilitySum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Sum of log probabilities for all tokens. This field is not supported in Vertex AI.",
                     "title": "Logprobabilitysum"
                  }
               },
               "title": "LogprobsResult",
               "type": "object"
            },
            "LogprobsResultCandidate": {
               "additionalProperties": false,
               "description": "A single token and its associated log probability.",
               "properties": {
                  "logProbability": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.",
                     "title": "Logprobability"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The token's string representation.",
                     "title": "Token"
                  },
                  "tokenId": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary.",
                     "title": "Tokenid"
                  }
               },
               "title": "LogprobsResultCandidate",
               "type": "object"
            },
            "LogprobsResultTopCandidates": {
               "additionalProperties": false,
               "description": "A list of the top candidate tokens and their log probabilities at each decoding step.\n\nThis can be used to see what other tokens the model considered.",
               "properties": {
                  "candidates": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/LogprobsResultCandidate"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The list of candidate tokens, 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": "The number of tokens counted for this modality.",
                     "title": "Tokencount"
                  }
               },
               "title": "ModalityTokenCount",
               "type": "object"
            },
            "NodeInfo": {
               "description": "Workflow node metadata attached to an Event.",
               "properties": {
                  "path": {
                     "default": "",
                     "title": "Path",
                     "type": "string"
                  },
                  "outputFor": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Outputfor"
                  },
                  "messageAsOutput": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Messageasoutput"
                  }
               },
               "title": "NodeInfo",
               "type": "object"
            },
            "OAuth2": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "oauth2"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "flows": {
                     "$ref": "#/$defs/OAuthFlows"
                  }
               },
               "required": [
                  "flows"
               ],
               "title": "OAuth2",
               "type": "object"
            },
            "OAuth2Auth": {
               "additionalProperties": true,
               "description": "Represents credential value and its metadata for a OAuth2 credential.",
               "properties": {
                  "clientId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientid"
                  },
                  "clientSecret": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientsecret"
                  },
                  "authUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authuri"
                  },
                  "nonce": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Nonce"
                  },
                  "state": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State"
                  },
                  "redirectUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Redirecturi"
                  },
                  "authResponseUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authresponseuri"
                  },
                  "authCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authcode"
                  },
                  "accessToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Accesstoken"
                  },
                  "refreshToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshtoken"
                  },
                  "idToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Idtoken"
                  },
                  "expiresAt": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresat"
                  },
                  "expiresIn": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresin"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  },
                  "codeVerifier": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codeverifier"
                  },
                  "codeChallengeMethod": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codechallengemethod"
                  },
                  "tokenEndpointAuthMethod": {
                     "anyOf": [
                        {
                           "enum": [
                              "client_secret_basic",
                              "client_secret_post",
                              "client_secret_jwt",
                              "private_key_jwt"
                           ],
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": "client_secret_basic",
                     "title": "Tokenendpointauthmethod"
                  }
               },
               "title": "OAuth2Auth",
               "type": "object"
            },
            "OAuthFlowAuthorizationCode": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl",
                  "tokenUrl"
               ],
               "title": "OAuthFlowAuthorizationCode",
               "type": "object"
            },
            "OAuthFlowClientCredentials": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowClientCredentials",
               "type": "object"
            },
            "OAuthFlowImplicit": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl"
               ],
               "title": "OAuthFlowImplicit",
               "type": "object"
            },
            "OAuthFlowPassword": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowPassword",
               "type": "object"
            },
            "OAuthFlows": {
               "additionalProperties": true,
               "properties": {
                  "implicit": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowImplicit"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "password": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowPassword"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "clientCredentials": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowClientCredentials"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "authorizationCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowAuthorizationCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "title": "OAuthFlows",
               "type": "object"
            },
            "OpenIdConnect": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "openIdConnectUrl": {
                     "title": "Openidconnecturl",
                     "type": "string"
                  }
               },
               "required": [
                  "openIdConnectUrl"
               ],
               "title": "OpenIdConnect",
               "type": "object"
            },
            "OpenIdConnectWithConfig": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "authorization_endpoint": {
                     "title": "Authorization Endpoint",
                     "type": "string"
                  },
                  "token_endpoint": {
                     "title": "Token Endpoint",
                     "type": "string"
                  },
                  "userinfo_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Userinfo Endpoint"
                  },
                  "revocation_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Revocation Endpoint"
                  },
                  "token_endpoint_auth_methods_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token Endpoint Auth Methods Supported"
                  },
                  "grant_types_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Grant Types Supported"
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  }
               },
               "required": [
                  "authorization_endpoint",
                  "token_endpoint"
               ],
               "title": "OpenIdConnectWithConfig",
               "type": "object"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "RagChunk": {
               "additionalProperties": false,
               "description": "A RagChunk includes the content of a chunk of a RagFile, and associated metadata.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "pageSpan": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RagChunkPageSpan"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "If populated, represents where the chunk starts and ends in the document."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The content of the chunk.",
                     "title": "Text"
                  }
               },
               "title": "RagChunk",
               "type": "object"
            },
            "RagChunkPageSpan": {
               "additionalProperties": false,
               "description": "Represents where the chunk starts and ends in the document.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "firstPage": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Page where chunk starts in the document. Inclusive. 1-indexed.",
                     "title": "Firstpage"
                  },
                  "lastPage": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Page where chunk ends in the document. Inclusive. 1-indexed.",
                     "title": "Lastpage"
                  }
               },
               "title": "RagChunkPageSpan",
               "type": "object"
            },
            "RetrievalMetadata": {
               "additionalProperties": false,
               "description": "Metadata returned to client when grounding is enabled.",
               "properties": {
                  "googleSearchDynamicRetrievalScore": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Score indicating how likely information from google\n      search could help answer the prompt. The score is in the range [0, 1],\n      where 0 is the least likely and 1 is the most likely. This score is only\n      populated when google search grounding and dynamic retrieval is enabled.\n      It will be compared to the threshold to determine whether to trigger\n      Google search.",
                     "title": "Googlesearchdynamicretrievalscore"
                  }
               },
               "title": "RetrievalMetadata",
               "type": "object"
            },
            "SearchEntryPoint": {
               "additionalProperties": false,
               "description": "The entry point used to search for grounding sources.",
               "properties": {
                  "renderedContent": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Web content snippet that can be embedded in a web page\n      or an app webview.",
                     "title": "Renderedcontent"
                  },
                  "sdkBlob": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. JSON representing array of tuples.",
                     "title": "Sdkblob"
                  }
               },
               "title": "SearchEntryPoint",
               "type": "object"
            },
            "SecuritySchemeType": {
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect"
               ],
               "title": "SecuritySchemeType",
               "type": "string"
            },
            "Segment": {
               "additionalProperties": false,
               "description": "Segment of the content this support belongs to.",
               "properties": {
                  "startIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. Start index in the given Part, measured in bytes.\n\n      Offset from the start of the Part, inclusive, starting at zero.",
                     "title": "Startindex"
                  },
                  "endIndex": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. End index in the given Part, measured in bytes.\n\n      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\n      Content object.",
                     "title": "Partindex"
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Output only. The text corresponding to the segment from the\n      response.",
                     "title": "Text"
                  }
               },
               "title": "Segment",
               "type": "object"
            },
            "ServiceAccount": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  service_account_credential: The service account credential (JSON key).\n  scopes: The OAuth2 scopes to request. Optional; when omitted with\n      ``use_default_credential=True``, defaults to the cloud-platform scope.\n  use_default_credential: Whether to use Application Default Credentials.\n  use_id_token: Whether to exchange for an ID token instead of an access\n      token. Required for service-to-service authentication with Cloud Run,\n      Cloud Functions, and other Google Cloud services that require identity\n      verification. When True, ``audience`` must also be set.\n  audience: The target audience for the ID token, typically the URL of the\n      receiving service (e.g. ``https://my-service-xyz.run.app``). Required\n      when ``use_id_token`` is True.",
               "properties": {
                  "serviceAccountCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccountCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  },
                  "useDefaultCredential": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Usedefaultcredential"
                  },
                  "useIdToken": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Useidtoken"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  }
               },
               "title": "ServiceAccount",
               "type": "object"
            },
            "ServiceAccountCredential": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  type: The type should be \"service_account\".\n  project_id: The project ID.\n  private_key_id: The ID of the private key.\n  private_key: The private key.\n  client_email: The client email.\n  client_id: The client ID.\n  auth_uri: The authorization URI.\n  token_uri: The token URI.\n  auth_provider_x509_cert_url: URL for auth provider's X.509 cert.\n  client_x509_cert_url: URL for the client's X.509 cert.\n  universe_domain: The universe domain.\n\nExample:\n\n    config = ServiceAccountCredential(\n        type_=\"service_account\",\n        project_id=\"your_project_id\",\n        private_key_id=\"your_private_key_id\",\n        private_key=\"-----BEGIN PRIVATE KEY-----...\",\n        client_email=\"...@....iam.gserviceaccount.com\",\n        client_id=\"your_client_id\",\n        auth_uri=\"https://accounts.google.com/o/oauth2/auth\",\n        token_uri=\"https://oauth2.googleapis.com/token\",\n        auth_provider_x509_cert_url=\"https://www.googleapis.com/oauth2/v1/certs\",\n        client_x509_cert_url=\"https://www.googleapis.com/robot/v1/metadata/x509/...\",\n        universe_domain=\"googleapis.com\"\n    )\n\n\n    config = ServiceAccountConfig.model_construct(**{\n        ...service account config dict\n    })",
               "properties": {
                  "type": {
                     "default": "",
                     "title": "Type",
                     "type": "string"
                  },
                  "projectId": {
                     "title": "Projectid",
                     "type": "string"
                  },
                  "privateKeyId": {
                     "title": "Privatekeyid",
                     "type": "string"
                  },
                  "privateKey": {
                     "title": "Privatekey",
                     "type": "string"
                  },
                  "clientEmail": {
                     "title": "Clientemail",
                     "type": "string"
                  },
                  "clientId": {
                     "title": "Clientid",
                     "type": "string"
                  },
                  "authUri": {
                     "title": "Authuri",
                     "type": "string"
                  },
                  "tokenUri": {
                     "title": "Tokenuri",
                     "type": "string"
                  },
                  "authProviderX509CertUrl": {
                     "title": "Authproviderx509Certurl",
                     "type": "string"
                  },
                  "clientX509CertUrl": {
                     "title": "Clientx509Certurl",
                     "type": "string"
                  },
                  "universeDomain": {
                     "title": "Universedomain",
                     "type": "string"
                  }
               },
               "required": [
                  "projectId",
                  "privateKeyId",
                  "privateKey",
                  "clientEmail",
                  "clientId",
                  "authUri",
                  "tokenUri",
                  "authProviderX509CertUrl",
                  "clientX509CertUrl",
                  "universeDomain"
               ],
               "title": "ServiceAccountCredential",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolConfirmation": {
               "additionalProperties": false,
               "description": "Represents a tool confirmation configuration.",
               "properties": {
                  "hint": {
                     "default": "",
                     "title": "Hint",
                     "type": "string"
                  },
                  "confirmed": {
                     "default": false,
                     "title": "Confirmed",
                     "type": "boolean"
                  },
                  "payload": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Payload"
                  }
               },
               "title": "ToolConfirmation",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "TrafficType": {
               "description": "Output only.\n\nThe traffic type for this request. This enum is not supported in Gemini API.",
               "enum": [
                  "TRAFFIC_TYPE_UNSPECIFIED",
                  "ON_DEMAND",
                  "ON_DEMAND_PRIORITY",
                  "ON_DEMAND_FLEX",
                  "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": "Optional. Transcription text.",
                     "title": "Text"
                  },
                  "finished": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The bool indicates the end of the transcription.",
                     "title": "Finished"
                  }
               },
               "title": "Transcription",
               "type": "object"
            },
            "UiWidget": {
               "additionalProperties": false,
               "description": "Rendering metadata for a UI widget associated with an event.\n\nWhen present on an Event.actions, the UI renders the widget using the\nspecified provider's renderer component.",
               "properties": {
                  "id": {
                     "title": "Id",
                     "type": "string"
                  },
                  "provider": {
                     "title": "Provider",
                     "type": "string"
                  },
                  "payload": {
                     "additionalProperties": true,
                     "title": "Payload",
                     "type": "object"
                  }
               },
               "required": [
                  "id",
                  "provider"
               ],
               "title": "UiWidget",
               "type": "object"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "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": [
            "id",
            "appName",
            "userId"
         ]
      }

  Fields:

    - `app_name (str)`

    - `events (list[google.adk.events.event.Event])`

    - `id (str)`

    - `last_update_time (float)`

    - `state (dict[str, Any])`

    - `user_id (str)`

  field app_name: str [Required] (alias 'appName')

    The name of the app.

  field events: list[Event] [Optional]

    The events of the session, e.g. user input, model response, function call/response, etc.

  field id: str [Required]

    The unique identifier of the session.

  field last_update_time: float = 0.0 (alias 'lastUpdateTime')

    The last update time of the session.

  field state: dict[str, Any] [Optional]

    The state of the session.

  field user_id: str [Required] (alias 'userId')

    The id of the user.

  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.

class google.adk.sessions.State(value, delta, schema=None)

  Bases: `object`

  A state dict that maintains the current value and the pending-commit delta.

  Parameters:

    - value – The current value of the state dict.

    - delta – The delta change to the current value that hasn’t been committed.

    - schema – Optional Pydantic model declaring the expected state keys and types. When set, mutations are validated against this schema.

  APP_PREFIX = 'app:'
  TEMP_PREFIX = 'temp:'
  USER_PREFIX = 'user:'
  get(key, default=None)

    Returns the value of the state dict for the given key.

    Return type:

      `Any`

  has_delta()

    Whether the state has pending delta.

    Return type:

      `bool`

  setdefault(key, default=None)

    Gets the value of a key, or sets it to a default if the key doesn’t exist.

    Return type:

      `Any`

  to_dict()

    Returns the state dict.

    Return type:

      `dict`[`str`, `Any`]

  update(delta)

    Updates the state dict with the given delta.

    Return type:

      `None`

exception google.adk.sessions.StateSchemaError

  Bases: `TypeError`

  Raised when a state mutation violates the declared state_schema.

# google.adk.skills module

Agent Development Kit - Skills.

pydantic model google.adk.skills.Frontmatter

  Bases: `BaseModel`

  L1 skill content: metadata parsed from SKILL.md for skill discovery.

  name

    Skill name in kebab-case or snake_case (required).

  description

    What the skill does and when the model should use it (required).

  license

    License for the skill (optional).

  compatibility

    Compatibility information for the skill (optional).

  allowed_tools

    A space-delimited list of tools that are pre-approved to run (optional, experimental). Accepts both `allowed_tools` and the YAML-friendly `allowed-tools` key. For more details, see https://agentskills.io/specification#allowed-tools-field.

  metadata

    Key-value pairs for client-specific properties (defaults to empty dict). For example, to include additional tools, use the `adk_additional_tools` key with a list of tools.

  Show JSON schema

      {
         "title": "Frontmatter",
         "description": "L1 skill content: metadata parsed from SKILL.md for skill discovery.\n\nAttributes:\n    name: Skill name in kebab-case or snake_case (required).\n    description: What the skill does and when the model should use it\n      (required).\n    license: License for the skill (optional).\n    compatibility: Compatibility information for the skill (optional).\n    allowed_tools: A space-delimited list of tools that are pre-approved to\n      run (optional, experimental). Accepts both ``allowed_tools`` and the\n      YAML-friendly ``allowed-tools`` key. For more details, see\n      https://agentskills.io/specification#allowed-tools-field.\n    metadata: Key-value pairs for client-specific properties (defaults to\n      empty dict). For example, to include additional tools, use the\n      ``adk_additional_tools`` key with a list of tools.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "title": "Description",
               "type": "string"
            },
            "license": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "License"
            },
            "compatibility": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Compatibility"
            },
            "allowed-tools": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Allowed-Tools"
            },
            "metadata": {
               "additionalProperties": true,
               "default": {},
               "title": "Metadata",
               "type": "object"
            }
         },
         "additionalProperties": true,
         "required": [
            "name",
            "description"
         ]
      }

  Fields:

    - `allowed_tools (str | None)`

    - `compatibility (str | None)`

    - `description (str)`

    - `license (str | None)`

    - `metadata (dict[str, Any])`

    - `name (str)`

  Validators:

    - `_validate_compatibility` » `compatibility`

    - `_validate_description` » `description`

    - `_validate_metadata` » `metadata`

    - `_validate_name` » `name`

  field allowed_tools: Optional[str] = None (alias 'allowed-tools')
  field compatibility: Optional[str] = None
    Validated by:

      - `_validate_compatibility`

  field description: str [Required]
    Validated by:

      - `_validate_description`

  field license: Optional[str] = None
  field metadata: dict[str, Any] = {}
    Validated by:

      - `_validate_metadata`

  field name: str [Required]
    Validated by:

      - `_validate_name`

pydantic model google.adk.skills.Resources

  Bases: `BaseModel`

  L3 skill content: additional instructions, assets, and scripts.

  references

    Additional markdown files with instructions, workflows, or guidance.

  assets

    Resource materials like database schemas, API documentation, templates, or examples.

  scripts

    Executable scripts that can be run via bash.

  Show JSON schema

      {
         "title": "Resources",
         "description": "L3 skill content: additional instructions, assets, and scripts.\n\nAttributes:\n    references: Additional markdown files with instructions, workflows, or\n      guidance.\n    assets: Resource materials like database schemas, API documentation,\n      templates, or examples.\n    scripts: Executable scripts that can be run via bash.",
         "type": "object",
         "properties": {
            "references": {
               "additionalProperties": {
                  "anyOf": [
                     {
                        "type": "string"
                     },
                     {
                        "format": "binary",
                        "type": "string"
                     }
                  ]
               },
               "default": {},
               "title": "References",
               "type": "object"
            },
            "assets": {
               "additionalProperties": {
                  "anyOf": [
                     {
                        "type": "string"
                     },
                     {
                        "format": "binary",
                        "type": "string"
                     }
                  ]
               },
               "default": {},
               "title": "Assets",
               "type": "object"
            },
            "scripts": {
               "additionalProperties": {
                  "$ref": "#/$defs/Script"
               },
               "default": {},
               "title": "Scripts",
               "type": "object"
            }
         },
         "$defs": {
            "Script": {
               "description": "Wrapper for script content.",
               "properties": {
                  "src": {
                     "title": "Src",
                     "type": "string"
                  }
               },
               "required": [
                  "src"
               ],
               "title": "Script",
               "type": "object"
            }
         }
      }

  Fields:

    - `assets (dict[str, str | bytes])`

    - `references (dict[str, str | bytes])`

    - `scripts (dict[str, google.adk.skills.models.Script])`

  field assets: dict[str, str | bytes] = {}
  field references: dict[str, str | bytes] = {}
  field scripts: dict[str, Script] = {}
  get_asset(asset_id)

    Get content of an asset file.

    Return type:

      `Union`[`str`, `bytes`, `None`]

    Parameters:

      asset_id – Unique path or name of the asset file.

    Returns:

      Asset content as string or bytes, or None if not found

  get_reference(reference_id)

    Get content of a reference file.

    Return type:

      `Union`[`str`, `bytes`, `None`]

    Parameters:

      reference_id – Unique path or name of the reference file.

    Returns:

      Reference content as string or bytes, or None if not found

  get_script(script_id)

    Get content of a script file.

    Return type:

      `Optional`[`Script`]

    Parameters:

      script_id – Unique path or name of the script file.

    Returns:

      Script object, or None if not found

  list_assets()

    List all available asset paths.

    Return type:

      `list`[`str`]

  list_references()

    List all available reference paths.

    Return type:

      `list`[`str`]

  list_scripts()

    List all available script paths.

    Return type:

      `list`[`str`]

pydantic model google.adk.skills.Script

  Bases: `BaseModel`

  Wrapper for script content.

  Show JSON schema

      {
         "title": "Script",
         "description": "Wrapper for script content.",
         "type": "object",
         "properties": {
            "src": {
               "title": "Src",
               "type": "string"
            }
         },
         "required": [
            "src"
         ]
      }

  Fields:

    - `src (str)`

  field src: str [Required]

pydantic model google.adk.skills.Skill

  Bases: `BaseModel`

  Complete skill representation including frontmatter, instructions, and resources.

  A skill combines: - L1: Frontmatter for discovery (name, description). - L2: Instructions from SKILL.md body, loaded when skill is triggered. - L3: Resources including additional instructions, assets, and scripts, loaded as needed.

  frontmatter

    Parsed skill frontmatter from SKILL.md.

  instructions

    L2 skill content: markdown instruction from SKILL.md body.

  resources

    L3 skill content: additional instructions, assets, and scripts.

  Show JSON schema

      {
         "title": "Skill",
         "description": "Complete skill representation including frontmatter, instructions, and resources.\n\nA skill combines:\n- L1: Frontmatter for discovery (name, description).\n- L2: Instructions from SKILL.md body, loaded when skill is triggered.\n- L3: Resources including additional instructions, assets, and scripts,\nloaded as needed.\n\nAttributes:\n    frontmatter: Parsed skill frontmatter from SKILL.md.\n    instructions: L2 skill content: markdown instruction from SKILL.md body.\n    resources: L3 skill content: additional instructions, assets, and scripts.",
         "type": "object",
         "properties": {
            "frontmatter": {
               "$ref": "#/$defs/Frontmatter"
            },
            "instructions": {
               "title": "Instructions",
               "type": "string"
            },
            "resources": {
               "$ref": "#/$defs/Resources",
               "default": {
                  "references": {},
                  "assets": {},
                  "scripts": {}
               }
            }
         },
         "$defs": {
            "Frontmatter": {
               "additionalProperties": true,
               "description": "L1 skill content: metadata parsed from SKILL.md for skill discovery.\n\nAttributes:\n    name: Skill name in kebab-case or snake_case (required).\n    description: What the skill does and when the model should use it\n      (required).\n    license: License for the skill (optional).\n    compatibility: Compatibility information for the skill (optional).\n    allowed_tools: A space-delimited list of tools that are pre-approved to\n      run (optional, experimental). Accepts both ``allowed_tools`` and the\n      YAML-friendly ``allowed-tools`` key. For more details, see\n      https://agentskills.io/specification#allowed-tools-field.\n    metadata: Key-value pairs for client-specific properties (defaults to\n      empty dict). For example, to include additional tools, use the\n      ``adk_additional_tools`` key with a list of tools.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "title": "Description",
                     "type": "string"
                  },
                  "license": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "License"
                  },
                  "compatibility": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Compatibility"
                  },
                  "allowed-tools": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Allowed-Tools"
                  },
                  "metadata": {
                     "additionalProperties": true,
                     "default": {},
                     "title": "Metadata",
                     "type": "object"
                  }
               },
               "required": [
                  "name",
                  "description"
               ],
               "title": "Frontmatter",
               "type": "object"
            },
            "Resources": {
               "description": "L3 skill content: additional instructions, assets, and scripts.\n\nAttributes:\n    references: Additional markdown files with instructions, workflows, or\n      guidance.\n    assets: Resource materials like database schemas, API documentation,\n      templates, or examples.\n    scripts: Executable scripts that can be run via bash.",
               "properties": {
                  "references": {
                     "additionalProperties": {
                        "anyOf": [
                           {
                              "type": "string"
                           },
                           {
                              "format": "binary",
                              "type": "string"
                           }
                        ]
                     },
                     "default": {},
                     "title": "References",
                     "type": "object"
                  },
                  "assets": {
                     "additionalProperties": {
                        "anyOf": [
                           {
                              "type": "string"
                           },
                           {
                              "format": "binary",
                              "type": "string"
                           }
                        ]
                     },
                     "default": {},
                     "title": "Assets",
                     "type": "object"
                  },
                  "scripts": {
                     "additionalProperties": {
                        "$ref": "#/$defs/Script"
                     },
                     "default": {},
                     "title": "Scripts",
                     "type": "object"
                  }
               },
               "title": "Resources",
               "type": "object"
            },
            "Script": {
               "description": "Wrapper for script content.",
               "properties": {
                  "src": {
                     "title": "Src",
                     "type": "string"
                  }
               },
               "required": [
                  "src"
               ],
               "title": "Script",
               "type": "object"
            }
         },
         "required": [
            "frontmatter",
            "instructions"
         ]
      }

  Fields:

    - `frontmatter (google.adk.skills.models.Frontmatter)`

    - `instructions (str)`

    - `resources (google.adk.skills.models.Resources)`

  field frontmatter: Frontmatter [Required]
  field instructions: str [Required]
  field resources: Resources = Resources(references={}, assets={}, scripts={})
  property description: str

    Convenience property to access skill description.

  property name: str

    Convenience property to access skill name.

class google.adk.skills.SkillRegistry

  Bases: `ABC`

  Interface for a skill registry.

  abstractmethod async get_skill(*, name)

    Fetches a skill from the registry.

    Return type:

      `Skill`

    Parameters:

      name – The name of the skill.

    Returns:

      A Skill object.

    Raises:

      Exception – If the skill with the specified name does not exist.

  abstractmethod async search_skills(*, query)

    Searches for skills in the registry.

    Return type:

      `list`[`Frontmatter`]

    Parameters:

      query – The search query.

    Returns:

      A list of Frontmatter objects for discovery.

  search_tool_description()

    Returns the description for the search_skills tool.

    Registries can define this to provide specialized instructions to the model on how to use their specific search capabilities.

    Return type:

      `str` | `None`

google.adk.skills.list_skills_in_dir(skills_base_path)

  List skills in a local directory.

  Return type:

    `dict`[`str`, `Frontmatter`]

  Parameters:

    skills_base_path – Path to the base directory containing skills.

  Returns:

    Dictionary mapping skill IDs to their frontmatter.

google.adk.skills.list_skills_in_gcs_dir(bucket_name, skills_base_path='', project_id=None, credentials=None)

  List skills in a GCS directory.

  Return type:

    `Dict`[`str`, `Frontmatter`]

  Parameters:

    - bucket_name – Name of the GCS bucket.

    - skills_base_path – Base directory within the bucket (e.g., ‘path/to/skills’).

  Returns:

    Dictionary mapping skill IDs to their frontmatter.

google.adk.skills.load_skill_from_dir(skill_dir)

  Load a complete skill from a directory.

  Return type:

    `Skill`

  Parameters:

    skill_dir – Path to the skill directory.

  Returns:

    Skill object with all components loaded.

  Raises:

    - FileNotFoundError – If the skill directory or SKILL.md is not found.

    - ValueError – If SKILL.md is invalid or the skill name does not match the directory name.

google.adk.skills.load_skill_from_gcs_dir(bucket_name, skill_id, skills_base_path='', project_id=None, credentials=None)

  Load a complete skill from a GCS directory.

  Return type:

    `Skill`

  Parameters:

    - bucket_name – Name of the GCS bucket.

    - skill_id – The ID of the skill (directory name).

    - skills_base_path – Base directory within the bucket (e.g., ‘path/to/skills’).

    - project_id – Project ID to use for GCS client.

    - credentials – Credentials to use for GCS client.

  Returns:

    Skill object with all components loaded.

  Raises:

    - FileNotFoundError – If the skill directory or SKILL.md is not found.

    - ValueError – If SKILL.md is invalid or the skill name does not match the directory name.

# google.adk.telemetry module

google.adk.telemetry.trace_call_llm(invocation_context, event_id, llm_request, llm_response, span=None)

  Traces a call to the LLM.

  This function records details about the LLM request and response as attributes on the current OpenTelemetry span.

  Parameters:

    - invocation_context – The invocation context for the current agent run.

    - event_id – The ID of the event.

    - llm_request – The LLM request object.

    - llm_response – The LLM response object.

google.adk.telemetry.trace_merged_tool_calls(response_event_id, function_response_event)

  Traces merged tool call events.

  Calling this function is not needed for telemetry purposes. This is provided for preventing /debug/trace requests (typically sent by web UI).

  Parameters:

    - response_event_id – The ID of the response event.

    - function_response_event – The merged response event.

google.adk.telemetry.trace_send_data(invocation_context, event_id, data)

  Traces the sending of data to the agent.

  This function records details about the data sent to the agent as attributes on the current OpenTelemetry span.

  Parameters:

    - invocation_context – The invocation context for the current agent run.

    - event_id – The ID of the event.

    - data – A list of content objects.

google.adk.telemetry.trace_tool_call(tool, args, function_response_event, error=None, span=None)

  Traces tool call.

  Parameters:

    - tool – The tool that was called.

    - args – The arguments to the tool call.

    - function_response_event – The event with the function response details.

    - error – The exception raised during tool execution, if any.

    - span – The span to record attributes on. If None, uses current span.

# google.adk.tools module

class google.adk.tools.APIHubToolset(*, apihub_resource_name, access_token=None, service_account_json=None, name='', description='', lazy_load_spec=False, auth_scheme=None, auth_credential=None, apihub_client=None, tool_filter=None)

  Bases: `BaseToolset`

  APIHubTool generates tools from a given API Hub resource.

  Examples:

      apihub_toolset = APIHubToolset(
          apihub_resource_name="projects/test-project/locations/us-central1/apis/test-api",
          service_account_json="...",
          tool_filter=lambda tool, ctx=None: tool.name in ('my_tool',
          'my_other_tool')
      )

      # Get all available tools
      agent = LlmAgent(tools=apihub_toolset)

  apihub_resource_name is the resource name from API Hub. It must include API name, and can optionally include API version and spec name.

  - If apihub_resource_name includes a spec resource name, the content of that spec will be used for generating the tools.

  - If apihub_resource_name includes only an api or a version name, the first spec of the first version of that API will be used.

  Initializes the APIHubTool with the given parameters.

  Examples:

      apihub_toolset = APIHubToolset(
          apihub_resource_name="projects/test-project/locations/us-central1/apis/test-api",
          service_account_json="...",
      )

      # Get all available tools
      agent = LlmAgent(tools=[apihub_toolset])

      apihub_toolset = APIHubToolset(
          apihub_resource_name="projects/test-project/locations/us-central1/apis/test-api",
          service_account_json="...",
          tool_filter = ['my_tool']
      )
      # Get a specific tool
      agent = LlmAgent(tools=[
          ...,
          apihub_toolset,
      ])

  apihub_resource_name is the resource name from API Hub. It must include API name, and can optionally include API version and spec name.

  - If apihub_resource_name includes a spec resource name, the content of that spec will be used for generating the tools.

  - If apihub_resource_name includes only an api or a version name, the first spec of the first version of that API will be used.

  Example:

  - projects/xxx/locations/us-central1/apis/apiname/…

  - https://console.cloud.google.com/apigee/api-hub/apis/apiname?project=xxx

  Parameters:

    - apihub_resource_name – The resource name of the API in API Hub. Example: `projects/test-project/locations/us-central1/apis/test-api`.

    - access_token – Google Access token. Generate with gcloud cli `gcloud auth print-access-token`. Used for fetching API Specs from API Hub.

    - service_account_json – The service account config as a json string. Required if not using default service credential. It is used for creating the API Hub client and fetching the API Specs from API Hub.

    - apihub_client – Optional custom API Hub client.

    - name – Name of the toolset. Optional.

    - description – Description of the toolset. Optional.

    - auth_scheme – Auth scheme that applies to all the tool in the toolset.

    - auth_credential – Auth credential that applies to all the tool in the toolset.

    - lazy_load_spec – If True, the spec will be loaded lazily when needed. Otherwise, the spec will be loaded immediately and the tools will be generated during initialization.

    - tool_filter – The filter used to filter the tools in the toolset. It can be either a tool predicate or a list of tool names of the tools to expose.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Retrieves all available tools.

    Return type:

      `List`[`RestApiTool`]

    Returns:

      A list of all available RestApiTool objects.

class google.adk.tools.AgentTool(agent, skip_summarization=False, *, include_plugins=True, propagate_grounding_metadata=False)

  Bases: `BaseTool`

  A tool that wraps an agent.

  This tool allows an agent to be called as a tool within a larger application. The agent’s input schema is used to define the tool’s input parameters, and the agent’s output is returned as the tool’s result.

  agent

    The agent to wrap.

  skip_summarization

    Whether to skip summarization of the agent output.

  include_plugins

    Whether to propagate plugins from the parent runner context to the agent’s runner. When True (default), the agent will inherit all plugins from its parent. Set to False to run the agent with an isolated plugin environment.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `AgentTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  populate_name()
    Return type:

      `Any`

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.ApiRegistry(api_registry_project_id, location='global', header_provider=None)

  Bases: `object`

  Registry that provides McpToolsets for MCP servers registered in API Registry.

  Initialize the API Registry.

  Parameters:

    - api_registry_project_id – The project ID for the Google Cloud API Registry.

    - location – The location of the API Registry resources.

    - header_provider – Optional function to provide additional headers for MCP server calls.

  get_toolset(mcp_server_name, tool_filter=None, tool_name_prefix=None)

    Return the MCP Toolset based on the params.

    Return type:

      `McpToolset`

    Parameters:

      - mcp_server_name – Filter to select the MCP server name to get tools from.

      - tool_filter – Optional filter to select specific tools. Can be a list of tool names or a ToolPredicate function.

      - tool_name_prefix – Optional prefix to prepend to the names of the tools returned by the toolset.

    Returns:

      A toolset for the MCP server specified.

    Return type:

      McpToolset

pydantic model google.adk.tools.AuthToolArguments

  Bases: `BaseModelWithConfig`

  the arguments for the special long running function tool that is used to

  request end user credentials.

  Show JSON schema

      {
         "title": "AuthToolArguments",
         "description": "the arguments for the special long running function tool that is used to\n\nrequest end user credentials.",
         "type": "object",
         "properties": {
            "functionCallId": {
               "title": "Functioncallid",
               "type": "string"
            },
            "authConfig": {
               "$ref": "#/$defs/AuthConfig"
            }
         },
         "$defs": {
            "APIKey": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "apiKey"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "in": {
                     "$ref": "#/$defs/APIKeyIn"
                  },
                  "name": {
                     "title": "Name",
                     "type": "string"
                  }
               },
               "required": [
                  "in",
                  "name"
               ],
               "title": "APIKey",
               "type": "object"
            },
            "APIKeyIn": {
               "enum": [
                  "query",
                  "header",
                  "cookie"
               ],
               "title": "APIKeyIn",
               "type": "string"
            },
            "AuthConfig": {
               "additionalProperties": true,
               "description": "The auth config sent by tool asking client to collect auth credentials and\n\nadk and client will help to fill in the response",
               "properties": {
                  "authScheme": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/APIKey"
                        },
                        {
                           "$ref": "#/$defs/HTTPBase"
                        },
                        {
                           "$ref": "#/$defs/OAuth2"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnect"
                        },
                        {
                           "$ref": "#/$defs/HTTPBearer"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnectWithConfig"
                        },
                        {
                           "$ref": "#/$defs/CustomAuthScheme"
                        }
                     ],
                     "title": "Authscheme"
                  },
                  "rawAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "exchangedAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "credentialKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Credentialkey"
                  }
               },
               "required": [
                  "authScheme"
               ],
               "title": "AuthConfig",
               "type": "object"
            },
            "AuthCredential": {
               "additionalProperties": true,
               "description": "Data class representing an authentication credential.\n\nTo exchange for the actual credential, please use\nCredentialExchanger.exchange_credential().\n\nExamples: API Key Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    api_key=\"1234\",\n)\n\nExample: HTTP Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"basic\",\n        credentials=HttpCredentials(username=\"user\", password=\"password\"),\n    ),\n)\n\nExample: OAuth2 Bearer Token in HTTP Header\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"bearer\",\n        credentials=HttpCredentials(token=\"eyAkaknabna....\"),\n    ),\n)\n\nExample: OAuth2 Auth with Authorization Code Flow\nAuthCredential(\n    auth_type=AuthCredentialTypes.OAUTH2,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n    ),\n)\n\nExample: OpenID Connect Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n        redirect_uri=\"https://example.com\",\n        scopes=[\"scope1\", \"scope2\"],\n    ),\n)\n\nExample: Auth with resource reference\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    resource_ref=\"projects/1234/locations/us-central1/resources/resource1\",\n)",
               "properties": {
                  "authType": {
                     "$ref": "#/$defs/AuthCredentialTypes"
                  },
                  "resourceRef": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Resourceref"
                  },
                  "apiKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Apikey"
                  },
                  "http": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/HttpAuth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "serviceAccount": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccount"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "oauth2": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuth2Auth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "required": [
                  "authType"
               ],
               "title": "AuthCredential",
               "type": "object"
            },
            "AuthCredentialTypes": {
               "description": "Represents the type of authentication credential.",
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect",
                  "serviceAccount"
               ],
               "title": "AuthCredentialTypes",
               "type": "string"
            },
            "CustomAuthScheme": {
               "additionalProperties": true,
               "description": "A flexible model for custom authentication schemes.\n\nThe subclasses must define a `default` for the `type_` field, if using OAuth2\nuser consent flow, to ensure correct rehydration.",
               "properties": {
                  "type": {
                     "title": "Type",
                     "type": "string"
                  }
               },
               "required": [
                  "type"
               ],
               "title": "CustomAuthScheme",
               "type": "object"
            },
            "HTTPBase": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  }
               },
               "required": [
                  "scheme"
               ],
               "title": "HTTPBase",
               "type": "object"
            },
            "HTTPBearer": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "const": "bearer",
                     "default": "bearer",
                     "title": "Scheme",
                     "type": "string"
                  },
                  "bearerFormat": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Bearerformat"
                  }
               },
               "title": "HTTPBearer",
               "type": "object"
            },
            "HttpAuth": {
               "additionalProperties": true,
               "description": "The credentials and metadata for HTTP authentication.",
               "properties": {
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  },
                  "credentials": {
                     "$ref": "#/$defs/HttpCredentials"
                  },
                  "additionalHeaders": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "type": "string"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Additionalheaders"
                  }
               },
               "required": [
                  "scheme",
                  "credentials"
               ],
               "title": "HttpAuth",
               "type": "object"
            },
            "HttpCredentials": {
               "additionalProperties": true,
               "description": "Represents the secret token value for HTTP authentication, like user name, password, oauth token, etc.",
               "properties": {
                  "username": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Username"
                  },
                  "password": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Password"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token"
                  }
               },
               "title": "HttpCredentials",
               "type": "object"
            },
            "OAuth2": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "oauth2"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "flows": {
                     "$ref": "#/$defs/OAuthFlows"
                  }
               },
               "required": [
                  "flows"
               ],
               "title": "OAuth2",
               "type": "object"
            },
            "OAuth2Auth": {
               "additionalProperties": true,
               "description": "Represents credential value and its metadata for a OAuth2 credential.",
               "properties": {
                  "clientId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientid"
                  },
                  "clientSecret": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientsecret"
                  },
                  "authUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authuri"
                  },
                  "nonce": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Nonce"
                  },
                  "state": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State"
                  },
                  "redirectUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Redirecturi"
                  },
                  "authResponseUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authresponseuri"
                  },
                  "authCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authcode"
                  },
                  "accessToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Accesstoken"
                  },
                  "refreshToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshtoken"
                  },
                  "idToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Idtoken"
                  },
                  "expiresAt": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresat"
                  },
                  "expiresIn": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresin"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  },
                  "codeVerifier": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codeverifier"
                  },
                  "codeChallengeMethod": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codechallengemethod"
                  },
                  "tokenEndpointAuthMethod": {
                     "anyOf": [
                        {
                           "enum": [
                              "client_secret_basic",
                              "client_secret_post",
                              "client_secret_jwt",
                              "private_key_jwt"
                           ],
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": "client_secret_basic",
                     "title": "Tokenendpointauthmethod"
                  }
               },
               "title": "OAuth2Auth",
               "type": "object"
            },
            "OAuthFlowAuthorizationCode": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl",
                  "tokenUrl"
               ],
               "title": "OAuthFlowAuthorizationCode",
               "type": "object"
            },
            "OAuthFlowClientCredentials": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowClientCredentials",
               "type": "object"
            },
            "OAuthFlowImplicit": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl"
               ],
               "title": "OAuthFlowImplicit",
               "type": "object"
            },
            "OAuthFlowPassword": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowPassword",
               "type": "object"
            },
            "OAuthFlows": {
               "additionalProperties": true,
               "properties": {
                  "implicit": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowImplicit"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "password": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowPassword"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "clientCredentials": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowClientCredentials"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "authorizationCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowAuthorizationCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "title": "OAuthFlows",
               "type": "object"
            },
            "OpenIdConnect": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "openIdConnectUrl": {
                     "title": "Openidconnecturl",
                     "type": "string"
                  }
               },
               "required": [
                  "openIdConnectUrl"
               ],
               "title": "OpenIdConnect",
               "type": "object"
            },
            "OpenIdConnectWithConfig": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "authorization_endpoint": {
                     "title": "Authorization Endpoint",
                     "type": "string"
                  },
                  "token_endpoint": {
                     "title": "Token Endpoint",
                     "type": "string"
                  },
                  "userinfo_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Userinfo Endpoint"
                  },
                  "revocation_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Revocation Endpoint"
                  },
                  "token_endpoint_auth_methods_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token Endpoint Auth Methods Supported"
                  },
                  "grant_types_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Grant Types Supported"
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  }
               },
               "required": [
                  "authorization_endpoint",
                  "token_endpoint"
               ],
               "title": "OpenIdConnectWithConfig",
               "type": "object"
            },
            "SecuritySchemeType": {
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect"
               ],
               "title": "SecuritySchemeType",
               "type": "string"
            },
            "ServiceAccount": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  service_account_credential: The service account credential (JSON key).\n  scopes: The OAuth2 scopes to request. Optional; when omitted with\n      ``use_default_credential=True``, defaults to the cloud-platform scope.\n  use_default_credential: Whether to use Application Default Credentials.\n  use_id_token: Whether to exchange for an ID token instead of an access\n      token. Required for service-to-service authentication with Cloud Run,\n      Cloud Functions, and other Google Cloud services that require identity\n      verification. When True, ``audience`` must also be set.\n  audience: The target audience for the ID token, typically the URL of the\n      receiving service (e.g. ``https://my-service-xyz.run.app``). Required\n      when ``use_id_token`` is True.",
               "properties": {
                  "serviceAccountCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccountCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  },
                  "useDefaultCredential": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Usedefaultcredential"
                  },
                  "useIdToken": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Useidtoken"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  }
               },
               "title": "ServiceAccount",
               "type": "object"
            },
            "ServiceAccountCredential": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  type: The type should be \"service_account\".\n  project_id: The project ID.\n  private_key_id: The ID of the private key.\n  private_key: The private key.\n  client_email: The client email.\n  client_id: The client ID.\n  auth_uri: The authorization URI.\n  token_uri: The token URI.\n  auth_provider_x509_cert_url: URL for auth provider's X.509 cert.\n  client_x509_cert_url: URL for the client's X.509 cert.\n  universe_domain: The universe domain.\n\nExample:\n\n    config = ServiceAccountCredential(\n        type_=\"service_account\",\n        project_id=\"your_project_id\",\n        private_key_id=\"your_private_key_id\",\n        private_key=\"-----BEGIN PRIVATE KEY-----...\",\n        client_email=\"...@....iam.gserviceaccount.com\",\n        client_id=\"your_client_id\",\n        auth_uri=\"https://accounts.google.com/o/oauth2/auth\",\n        token_uri=\"https://oauth2.googleapis.com/token\",\n        auth_provider_x509_cert_url=\"https://www.googleapis.com/oauth2/v1/certs\",\n        client_x509_cert_url=\"https://www.googleapis.com/robot/v1/metadata/x509/...\",\n        universe_domain=\"googleapis.com\"\n    )\n\n\n    config = ServiceAccountConfig.model_construct(**{\n        ...service account config dict\n    })",
               "properties": {
                  "type": {
                     "default": "",
                     "title": "Type",
                     "type": "string"
                  },
                  "projectId": {
                     "title": "Projectid",
                     "type": "string"
                  },
                  "privateKeyId": {
                     "title": "Privatekeyid",
                     "type": "string"
                  },
                  "privateKey": {
                     "title": "Privatekey",
                     "type": "string"
                  },
                  "clientEmail": {
                     "title": "Clientemail",
                     "type": "string"
                  },
                  "clientId": {
                     "title": "Clientid",
                     "type": "string"
                  },
                  "authUri": {
                     "title": "Authuri",
                     "type": "string"
                  },
                  "tokenUri": {
                     "title": "Tokenuri",
                     "type": "string"
                  },
                  "authProviderX509CertUrl": {
                     "title": "Authproviderx509Certurl",
                     "type": "string"
                  },
                  "clientX509CertUrl": {
                     "title": "Clientx509Certurl",
                     "type": "string"
                  },
                  "universeDomain": {
                     "title": "Universedomain",
                     "type": "string"
                  }
               },
               "required": [
                  "projectId",
                  "privateKeyId",
                  "privateKey",
                  "clientEmail",
                  "clientId",
                  "authUri",
                  "tokenUri",
                  "authProviderX509CertUrl",
                  "clientX509CertUrl",
                  "universeDomain"
               ],
               "title": "ServiceAccountCredential",
               "type": "object"
            }
         },
         "additionalProperties": true,
         "required": [
            "functionCallId",
            "authConfig"
         ]
      }

  Fields:

    - `auth_config (google.adk.auth.auth_tool.AuthConfig)`

    - `function_call_id (str)`

  field auth_config: AuthConfig [Required] (alias 'authConfig')
  field function_call_id: str [Required] (alias 'functionCallId')

class google.adk.tools.BaseTool(*, name, description, is_long_running=False, custom_metadata=None)

  Bases: `ABC`

  The base class for all tools.

  custom_metadata: `Optional`[`dict`[`str`, `Any`]] = None

    The custom metadata of the BaseTool.

    An optional key-value pair for storing and retrieving tool-specific metadata, such as tool manifests, etc.

    NOTE: the entire dict must be JSON serializable.

  description: `str`

    The description of the tool.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `TypeVar`(`SelfTool`, bound= BaseTool)

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  is_long_running: `bool` = False

    Whether the tool is a long running operation, which typically returns a resource id first and finishes the operation later.

  name: `str`

    The name of the tool.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.DiscoveryEngineSearchTool(data_store_id=None, data_store_specs=None, search_engine_id=None, filter=None, max_results=None, *, search_result_mode=None, location=None)

  Bases: `FunctionTool`

  Tool for searching the discovery engine.

  Initializes the DiscoveryEngineSearchTool.

  Parameters:

    - data_store_id – The Vertex AI search data store resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}”.

    - data_store_specs – Specifications that define the specific DataStores to be searched. It should only be set if engine is used.

    - search_engine_id – The Vertex AI search engine resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/engines/{engine}”.

    - filter – The filter to be applied to the search request. Default is None.

    - max_results – The maximum number of results to return. Default is None.

    - search_result_mode – The search result mode. When None (default), automatically detects the correct mode by trying CHUNKS first and falling back to DOCUMENTS if the datastore requires it. Set explicitly to CHUNKS or DOCUMENTS to skip auto-detection.

    - location –

      Optional endpoint location override. Examples: “global”, “us”, “eu”. If not specified, location is inferred

      > from data_store_id or search_engine_id and defaults to “global”.

  discovery_engine_search(query)

    Search through Vertex AI Search’s discovery engine search API.

    Return type:

      `dict`[`str`, `Any`]

    Parameters:

      query – The search query.

    Returns:

      A dictionary containing the status of the request and the list of search results, which contains the title, url and content.

class google.adk.tools.ExampleTool(examples)

  Bases: `BaseTool`

  A tool that adds (few-shot) examples to the LLM request.

  examples

    The examples to add to the LLM request.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `ExampleTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

class google.adk.tools.FunctionTool(func, *, require_confirmation=False)

  Bases: `BaseTool`

  A tool that wraps a user-defined Python function.

  func

    The function to wrap.

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.LongRunningFunctionTool(func)

  Bases: `FunctionTool`

  A function tool that returns the result asynchronously.

  This tool is used for long-running operations that may take a significant amount of time to complete. The framework will call the function. Once the function returns, the response will be returned asynchronously to the framework which is identified by the function_call_id.

  Example: ``python tool = LongRunningFunctionTool(a_long_running_function) ``

  is_long_running

    Whether the tool is a long running operation.

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

class google.adk.tools.MCPToolset(*args, **kwargs)

  Bases: `McpToolset`

  Deprecated name, use McpToolset instead.

  Initializes the McpToolset.

  Parameters:

    - connection_params – The connection parameters to the MCP server. Can be: `StdioConnectionParams` for using local mcp server (e.g. using `npx` or `python3`); or `SseConnectionParams` for a local/remote SSE server; or `StreamableHTTPConnectionParams` for local/remote Streamable http server. Note, `StdioServerParameters` is also supported for using local mcp server (e.g. using `npx` or `python3` ), but it does not support timeout, and we recommend to use `StdioConnectionParams` instead when timeout is needed.

    - tool_filter – Optional filter to select specific tools. Can be either: - A list of tool names to include - A ToolPredicate function for custom filtering logic

    - tool_name_prefix – A prefix to be added to the name of each tool in this toolset.

    - errlog – TextIO stream for error logging.

    - auth_scheme – The auth scheme of the tool for tool calling

    - auth_credential – The auth credential of the tool for tool calling

    - require_confirmation – Whether tools in this toolset require confirmation. Can be a single boolean or a callable to apply to all tools.

    - header_provider – A callable that takes a ReadonlyContext and returns a dictionary of headers to be used for the MCP session.

    - progress_callback – Optional callback to receive progress notifications from MCP server during long-running tool execution. Can be either: - A `ProgressFnT` callback that receives (progress, total, message). This callback will be shared by all tools in the toolset. - A `ProgressCallbackFactory` that creates per-tool callbacks. The factory receives (tool_name, callback_context, **kwargs) and returns a ProgressFnT or None. This allows different tools to have different progress handling logic and access/modify session state via the CallbackContext. The **kwargs parameter allows for future extensibility.

    - use_mcp_resources – Whether the agent should have access to MCP resources. This will add a load_mcp_resource tool to the toolset and include available resources in the agent context. Defaults to False.

    - sampling_callback – Optional callback to handle sampling requests from the MCP server.

    - sampling_capabilities – Optional capabilities for sampling.

    - credential_key – A user specified key used to load and save this credential in a credential service. Used with auth_scheme.

class google.adk.tools.McpToolset(*, connection_params, tool_filter=None, tool_name_prefix=None, errlog=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, auth_scheme=None, auth_credential=None, require_confirmation=False, header_provider=None, progress_callback=None, use_mcp_resources=False, sampling_callback=None, sampling_capabilities=None, credential_key=None)

  Bases: `BaseToolset`

  Connects to a MCP Server, and retrieves MCP Tools into ADK Tools.

  This toolset manages the connection to an MCP server and provides tools that can be used by an agent. It properly implements the BaseToolset interface for easy integration with the agent framework.

  Usage:

      toolset = McpToolset(
          connection_params=StdioServerParameters(
              command='npx',
              args=["-y", "@modelcontextprotocol/server-filesystem"],
          ),
          tool_filter=['read_file', 'list_directory']  # Optional: filter specific
          tools
      )

      # Use in an agent
      agent = LlmAgent(
          model='gemini-2.5-flash',
          name='enterprise_assistant',
          instruction='Help user accessing their file systems',
          tools=[toolset],
      )

      # Cleanup is handled automatically by the agent framework
      # But you can also manually close if needed:
      # await toolset.close()

  Initializes the McpToolset.

  Parameters:

    - connection_params – The connection parameters to the MCP server. Can be: `StdioConnectionParams` for using local mcp server (e.g. using `npx` or `python3`); or `SseConnectionParams` for a local/remote SSE server; or `StreamableHTTPConnectionParams` for local/remote Streamable http server. Note, `StdioServerParameters` is also supported for using local mcp server (e.g. using `npx` or `python3` ), but it does not support timeout, and we recommend to use `StdioConnectionParams` instead when timeout is needed.

    - tool_filter – Optional filter to select specific tools. Can be either: - A list of tool names to include - A ToolPredicate function for custom filtering logic

    - tool_name_prefix – A prefix to be added to the name of each tool in this toolset.

    - errlog – TextIO stream for error logging.

    - auth_scheme – The auth scheme of the tool for tool calling

    - auth_credential – The auth credential of the tool for tool calling

    - require_confirmation – Whether tools in this toolset require confirmation. Can be a single boolean or a callable to apply to all tools.

    - header_provider – A callable that takes a ReadonlyContext and returns a dictionary of headers to be used for the MCP session.

    - progress_callback – Optional callback to receive progress notifications from MCP server during long-running tool execution. Can be either: - A `ProgressFnT` callback that receives (progress, total, message). This callback will be shared by all tools in the toolset. - A `ProgressCallbackFactory` that creates per-tool callbacks. The factory receives (tool_name, callback_context, **kwargs) and returns a ProgressFnT or None. This allows different tools to have different progress handling logic and access/modify session state via the CallbackContext. The **kwargs parameter allows for future extensibility.

    - use_mcp_resources – Whether the agent should have access to MCP resources. This will add a load_mcp_resource tool to the toolset and include available resources in the agent context. Defaults to False.

    - sampling_callback – Optional callback to handle sampling requests from the MCP server.

    - sampling_capabilities – Optional capabilities for sampling.

    - credential_key – A user specified key used to load and save this credential in a credential service. Used with auth_scheme.

  async close()

    Performs cleanup and releases resources held by the toolset.

    This method closes the MCP session and cleans up all associated resources. It’s designed to be safe to call multiple times and handles cleanup errors gracefully to avoid blocking application shutdown.

    Return type:

      `None`

  classmethod from_config(config, config_abs_path)

    Creates an McpToolset from a configuration object.

    Return type:

      `McpToolset`

  get_auth_config()

    Returns the auth config for this toolset.

    ADK will populate exchanged_auth_credential on this config before calling get_tools(). The toolset can then access the ready-to-use credential via self._auth_config.exchanged_auth_credential.

    Return type:

      `Optional`[`AuthConfig`]

  async get_resource_info(name, readonly_context=None)

    Returns metadata about a specific resource (name, MIME type, etc.).

    Return type:

      `dict`[`str`, `Any`]

  async get_tools(readonly_context=None)

    Return all tools in the toolset based on the provided context.

    Return type:

      `List`[`BaseTool`]

    Parameters:

      readonly_context – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools available under the specified context.

    Return type:

      List[BaseTool]

  async list_resources(readonly_context=None)

    Returns a list of resource names available on the MCP server.

    Return type:

      `list`[`str`]

  async read_resource(name, readonly_context=None)

    Fetches and returns a list of contents of the named resource.

    Return type:

      `Any`

    Parameters:

      - name – The name of the resource to fetch.

      - readonly_context – Context used to provide headers for the MCP session.

    Returns:

      List of contents of the resource.

class google.adk.tools.SearchResultMode(value)

  Bases: `Enum`

  Search result mode for discovery engine search.

  CHUNKS = 'CHUNKS'

    Results as chunks (default). Works for unstructured data.

  DOCUMENTS = 'DOCUMENTS'

    Results as documents. Required for structured datastores.

google.adk.tools.ToolContext

  alias of `Context`

class google.adk.tools.TransferToAgentTool(agent_names)

  Bases: `FunctionTool`

  A specialized FunctionTool for agent transfer with enum constraints.

  This tool enhances the base transfer_to_agent function by adding JSON Schema enum constraints to the agent_name parameter. This prevents LLMs from hallucinating invalid agent names by restricting choices to only valid agents.

  agent_names

    List of valid agent names that can be transferred to.

  Initialize the TransferToAgentTool.

  Parameters:

    agent_names – List of valid agent names that can be transferred to.

class google.adk.tools.VertexAiSearchTool(*, data_store_id=None, data_store_specs=None, search_engine_id=None, filter=None, max_results=None, bypass_multi_tools_limit=False)

  Bases: `BaseTool`

  A built-in tool using Vertex AI Search.

  data_store_id

    The Vertex AI search data store resource ID.

  search_engine_id

    The Vertex AI search engine resource ID.

  To dynamically customize the search configuration at runtime (e.g., set filter based on user context), subclass this tool and override the _build_vertex_ai_search_config method.

  Example

  ```python class DynamicFilterSearchTool(VertexAiSearchTool):

  > def _build_vertex_ai_search_config(

  >   self, ctx: ReadonlyContext

  > ) -> types.VertexAISearch:

  >   user_id = ctx.state.get(‘user_id’) return types.VertexAISearch(

  >   > datastore=self.data_store_id, engine=self.search_engine_id, filter=f”user_id = ‘{user_id}’”, max_results=self.max_results,

  >   )

  ```

  Initializes the Vertex AI Search tool.

  Parameters:

    - data_store_id – The Vertex AI search data store resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}”.

    - data_store_specs – Specifications that define the specific DataStores to be searched. It should only be set if engine is used.

    - search_engine_id – The Vertex AI search engine resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/engines/{engine}”.

    - filter – The filter to apply to the search results.

    - max_results – The maximum number of results to return.

    - bypass_multi_tools_limit – Whether to bypass the multi tools limitation, so that the tool can be used with other tools in the same agent.

  Raises:

    - ValueError – If both data_store_id and search_engine_id are not specified

    - or both are specified. –

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

google.adk.tools.exit_loop(tool_context)

  Exits the loop.

  Call this function only when you are instructed to do so.

google.adk.tools.transfer_to_agent(agent_name, tool_context)

  Transfer the question to another agent.

  This tool hands off control to another agent when it’s more suitable to answer the user’s question according to the agent’s description.

  Return type:

    `None`

  Note

  For most use cases, you should use TransferToAgentTool instead of this function directly. TransferToAgentTool provides additional enum constraints that prevent LLMs from hallucinating invalid agent names.

  Parameters:

    agent_name – the agent name to transfer to.

# google.adk.tools.agent_simulator module

google.adk.tools.agent_simulator.AgentSimulatorFactory

  alias of `EnvironmentSimulationFactory`

# google.adk.tools.agent_tool module

class google.adk.tools.agent_tool.AgentTool(agent, skip_summarization=False, *, include_plugins=True, propagate_grounding_metadata=False)

  Bases: `BaseTool`

  A tool that wraps an agent.

  This tool allows an agent to be called as a tool within a larger application. The agent’s input schema is used to define the tool’s input parameters, and the agent’s output is returned as the tool’s result.

  agent

    The agent to wrap.

  skip_summarization

    Whether to skip summarization of the agent output.

  include_plugins

    Whether to propagate plugins from the parent runner context to the agent’s runner. When True (default), the agent will inherit all plugins from its parent. Set to False to run the agent with an isolated plugin environment.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `AgentTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  populate_name()
    Return type:

      `Any`

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

pydantic model google.adk.tools.agent_tool.AgentToolConfig

  Bases: `BaseToolConfig`

  The config for the AgentTool.

  Show JSON schema

      {
         "title": "AgentToolConfig",
         "description": "The config for the AgentTool.",
         "type": "object",
         "properties": {
            "agent": {
               "$ref": "#/$defs/AgentRefConfig"
            },
            "skip_summarization": {
               "default": false,
               "title": "Skip Summarization",
               "type": "boolean"
            },
            "include_plugins": {
               "default": true,
               "title": "Include Plugins",
               "type": "boolean"
            }
         },
         "$defs": {
            "AgentRefConfig": {
               "additionalProperties": false,
               "description": "The config for the reference to another agent.",
               "properties": {
                  "config_path": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Config Path"
                  },
                  "code": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Code"
                  }
               },
               "title": "AgentRefConfig",
               "type": "object"
            }
         },
         "additionalProperties": false,
         "required": [
            "agent"
         ]
      }

  Fields:

    - `agent (google.adk.agents.common_configs.AgentRefConfig)`

    - `include_plugins (bool)`

    - `skip_summarization (bool)`

  field agent: AgentRefConfig [Required]

    The reference to the agent instance.

  field include_plugins: bool = True

    Whether to include plugins from parent runner context.

  field skip_summarization: bool = False

    Whether to skip summarization of the agent output.

# google.adk.tools.api_registry module

# google.adk.tools.apihub_tool module

class google.adk.tools.apihub_tool.APIHubToolset(*, apihub_resource_name, access_token=None, service_account_json=None, name='', description='', lazy_load_spec=False, auth_scheme=None, auth_credential=None, apihub_client=None, tool_filter=None)

  Bases: `BaseToolset`

  APIHubTool generates tools from a given API Hub resource.

  Examples:

      apihub_toolset = APIHubToolset(
          apihub_resource_name="projects/test-project/locations/us-central1/apis/test-api",
          service_account_json="...",
          tool_filter=lambda tool, ctx=None: tool.name in ('my_tool',
          'my_other_tool')
      )

      # Get all available tools
      agent = LlmAgent(tools=apihub_toolset)

  apihub_resource_name is the resource name from API Hub. It must include API name, and can optionally include API version and spec name.

  - If apihub_resource_name includes a spec resource name, the content of that spec will be used for generating the tools.

  - If apihub_resource_name includes only an api or a version name, the first spec of the first version of that API will be used.

  Initializes the APIHubTool with the given parameters.

  Examples:

      apihub_toolset = APIHubToolset(
          apihub_resource_name="projects/test-project/locations/us-central1/apis/test-api",
          service_account_json="...",
      )

      # Get all available tools
      agent = LlmAgent(tools=[apihub_toolset])

      apihub_toolset = APIHubToolset(
          apihub_resource_name="projects/test-project/locations/us-central1/apis/test-api",
          service_account_json="...",
          tool_filter = ['my_tool']
      )
      # Get a specific tool
      agent = LlmAgent(tools=[
          ...,
          apihub_toolset,
      ])

  apihub_resource_name is the resource name from API Hub. It must include API name, and can optionally include API version and spec name.

  - If apihub_resource_name includes a spec resource name, the content of that spec will be used for generating the tools.

  - If apihub_resource_name includes only an api or a version name, the first spec of the first version of that API will be used.

  Example:

  - projects/xxx/locations/us-central1/apis/apiname/…

  - https://console.cloud.google.com/apigee/api-hub/apis/apiname?project=xxx

  Parameters:

    - apihub_resource_name – The resource name of the API in API Hub. Example: `projects/test-project/locations/us-central1/apis/test-api`.

    - access_token – Google Access token. Generate with gcloud cli `gcloud auth print-access-token`. Used for fetching API Specs from API Hub.

    - service_account_json – The service account config as a json string. Required if not using default service credential. It is used for creating the API Hub client and fetching the API Specs from API Hub.

    - apihub_client – Optional custom API Hub client.

    - name – Name of the toolset. Optional.

    - description – Description of the toolset. Optional.

    - auth_scheme – Auth scheme that applies to all the tool in the toolset.

    - auth_credential – Auth credential that applies to all the tool in the toolset.

    - lazy_load_spec – If True, the spec will be loaded lazily when needed. Otherwise, the spec will be loaded immediately and the tools will be generated during initialization.

    - tool_filter – The filter used to filter the tools in the toolset. It can be either a tool predicate or a list of tool names of the tools to expose.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Retrieves all available tools.

    Return type:

      `List`[`RestApiTool`]

    Returns:

      A list of all available RestApiTool objects.

# google.adk.tools.application_integration_tool module

class google.adk.tools.application_integration_tool.ApplicationIntegrationToolset(project, location, connection_template_override=None, integration=None, triggers=None, connection=None, entity_operations=None, actions=None, tool_name_prefix='', tool_instructions='', service_account_json=None, auth_scheme=None, auth_credential=None, tool_filter=None)

  Bases: `BaseToolset`

  ApplicationIntegrationToolset generates tools from a given Application Integration or Integration Connector resource.

  Example Usage:

      # Get all available tools for an integration with api trigger
      application_integration_toolset = ApplicationIntegrationToolset(
          project="test-project",
          location="us-central1"
          integration="test-integration",
          triggers=["api_trigger/test_trigger"],
          service_account_credentials={...},
      )

      # Get all available tools for a connection using entity operations and
      # actions
      # Note: Find the list of supported entity operations and actions for a
      # connection using integration connector apis:
      # https://cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.connectionSchemaMetadata
      application_integration_toolset = ApplicationIntegrationToolset(
          project="test-project",
          location="us-central1"
          connection="test-connection",
          entity_operations=["EntityId1": ["LIST","CREATE"], "EntityId2": []],
          #empty list for actions means all operations on the entity are supported
          actions=["action1"],
          service_account_credentials={...},
      )

      # Feed the toolset to agent
      agent = LlmAgent(tools=[
          ...,
          application_integration_toolset,
      ])

  Args:

  Parameters:

    - project – The GCP project ID.

    - location – The GCP location.

    - connection_template_override – Overrides ExecuteConnection default integration name.

    - integration – The integration name.

    - triggers – The list of trigger names in the integration.

    - connection – The connection name.

    - entity_operations – The entity operations supported by the connection.

    - actions – The actions supported by the connection.

    - tool_name_prefix – The name prefix of the generated tools.

    - tool_instructions – The instructions for the tool.

    - service_account_json – The service account configuration as a dictionary. Required if not using default service credential. Used for fetching the Application Integration or Integration Connector resource.

    - tool_filter – The filter used to filter the tools in the toolset. It can be either a tool predicate or a list of tool names of the tools to expose.

  Raises:

    - ValueError – If none of the following conditions are met: - `integration` is provided. - `connection` is provided and at least one of `entity_operations` or `actions` is provided.

    - Exception – If there is an error during the initialization of the integration or connection client.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Return type:

      `None`

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Return all tools in the toolset based on the provided context.

    Return type:

      `List`[`RestApiTool`]

    Parameters:

      readonly_context (ReadonlyContext, optional) – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools available under the specified context.

    Return type:

      list[BaseTool]

class google.adk.tools.application_integration_tool.IntegrationConnectorTool(name, description, connection_name, connection_host, connection_service_name, entity, operation, action, rest_api_tool, auth_scheme=None, auth_credential=None)

  Bases: `BaseTool`

  A tool that wraps a RestApiTool to interact with a specific Application Integration endpoint.

  This tool adds Application Integration specific context like connection details, entity, operation, and action to the underlying REST API call handled by RestApiTool. It prepares the arguments and then delegates the actual API call execution to the contained RestApiTool instance.

  - Generates request params and body

  - Attaches auth credentials to API call.

  Example:

      # Each API operation in the spec will be turned into its own tool
      # Name of the tool is the operationId of that operation, in snake case
      operations = OperationGenerator().parse(openapi_spec_dict)
      tool = [RestApiTool.from_parsed_operation(o) for o in operations]

  Initializes the ApplicationIntegrationTool.

  Parameters:

    - name – The name of the tool, typically derived from the API operation. Should be unique and adhere to Gemini function naming conventions (e.g., less than 64 characters).

    - description – A description of what the tool does, usually based on the API operation’s summary or description.

    - connection_name – The name of the Integration Connector connection.

    - connection_host – The hostname or IP address for the connection.

    - connection_service_name – The specific service name within the host.

    - entity – The Integration Connector entity being targeted.

    - operation – The specific operation being performed on the entity.

    - action – The action associated with the operation (e.g., ‘execute’).

    - rest_api_tool – An initialized RestApiTool instance that handles the underlying REST API communication based on an OpenAPI specification operation. This tool will be called by ApplicationIntegrationTool with added connection and context arguments. tool = [RestApiTool.from_parsed_operation(o) for o in operations]

  EXCLUDE_FIELDS = ['connection_name', 'service_name', 'host', 'entity', 'operation', 'action', 'dynamic_auth_config']
  OPTIONAL_FIELDS = ['page_size', 'page_token', 'filter', 'sortByColumns']
  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Dict`[`str`, `Any`]

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.authenticated_function_tool module

class google.adk.tools.authenticated_function_tool.AuthenticatedFunctionTool(*, func, auth_config=None, response_for_auth_required=None)

  Bases: `FunctionTool`

  A FunctionTool that handles authentication before the actual tool logic gets called. Functions can accept a special credential argument which is the credential ready for use.(Experimental)

  Initializes the AuthenticatedFunctionTool.

  Parameters:

    - func – The function to be called.

    - auth_config – The authentication configuration.

    - response_for_auth_required – The response to return when the tool is requesting auth credential from the client. There could be two case, the tool doesn’t configure any credentials (auth_config.raw_auth_credential is missing) or the credentials configured is not enough to authenticate the tool (e.g. an OAuth client id and client secret are configured) and needs client input (e.g. client need to involve the end user in an oauth flow and get back the oauth response.)

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.base_authenticated_tool module

class google.adk.tools.base_authenticated_tool.BaseAuthenticatedTool(*, name, description, auth_config=None, response_for_auth_required=None)

  Bases: `BaseTool`

  A base tool class that handles authentication before the actual tool logic gets called. Functions can accept a special credential argument which is the credential ready for use.(Experimental)

  Parameters:

    - name – The name of the tool.

    - description – The description of the tool.

    - auth_config – The auth configuration of the tool.

    - response_for_auth_required – The response to return when the tool is requesting auth credential from the client. There could be two case, the tool doesn’t configure any credentials (auth_config.raw_auth_credential is missing) or the credentials configured is not enough to authenticate the tool (e.g. an OAuth client id and client secret are configured) and needs client input (e.g. client need to involve the end user in an oauth flow and get back the oauth response.)

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.base_tool module

class google.adk.tools.base_tool.BaseTool(*, name, description, is_long_running=False, custom_metadata=None)

  Bases: `ABC`

  The base class for all tools.

  custom_metadata: `Optional`[`dict`[`str`, `Any`]] = None

    The custom metadata of the BaseTool.

    An optional key-value pair for storing and retrieving tool-specific metadata, such as tool manifests, etc.

    NOTE: the entire dict must be JSON serializable.

  description: `str`

    The description of the tool.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `TypeVar`(`SelfTool`, bound= BaseTool)

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  is_long_running: `bool` = False

    Whether the tool is a long running operation, which typically returns a resource id first and finishes the operation later.

  name: `str`

    The name of the tool.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.base_toolset module

class google.adk.tools.base_toolset.BaseToolset(*, tool_filter=None, tool_name_prefix=None)

  Bases: `ABC`

  Base class for toolset.

  A toolset is a collection of tools that can be used by an agent.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Return type:

      `None`

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  classmethod from_config(config, config_abs_path)

    Creates a toolset instance from a config.

    Return type:

      `TypeVar`(`SelfToolset`, bound= BaseToolset)

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The toolset instance.

  get_auth_config()

    Returns the auth config for this toolset. ADK will make sure the ‘exchanged_auth_credential’ field in the config is populated with ready-to-use credential (e.g. oauth token for OAuth flow) before calling get_tools method or execute any tools returned by this toolset. Thus toolset can use this credential either for tool listing or tool calling. If tool calling needs a different credential from ADK client, call tool_context.request_credential in the tool.

    Toolsets that support authentication should override this method to return an AuthConfig constructed from their auth_scheme, auth_credential, and optional credential_key parameters.

    Return type:

      `Optional`[`AuthConfig`]

    Returns:

      AuthConfig if the toolset has authentication configured, None otherwise.

  abstractmethod async get_tools(readonly_context=None)

    Return all tools in the toolset based on the provided context.

    Return type:

      `list`[`BaseTool`]

    Parameters:

      readonly_context (ReadonlyContext, optional) – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools available under the specified context.

    Return type:

      list[BaseTool]

  final async get_tools_with_prefix(readonly_context=None)

    Return all tools with optional prefix applied to tool names.

    This method calls get_tools() and applies prefixing if tool_name_prefix is provided.

    Return type:

      `list`[`BaseTool`]

    Parameters:

      readonly_context (ReadonlyContext, optional) – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools with prefixed names if tool_name_prefix is provided.

    Return type:

      list[BaseTool]

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this toolset. This method will be called before each tool processes the llm request.

    Return type:

      `None`

    Use cases: - Instead of let each tool process the llm request, we can let the toolset

    > process the llm request. e.g. ComputerUseToolset can add computer use tool to the llm request.

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

class google.adk.tools.base_toolset.ToolPredicate(*args, **kwargs)

  Bases: `Protocol`

  Base class for a predicate that defines the interface to decide whether a

  tool should be exposed to LLM. Toolset implementer could consider whether to accept such instance in the toolset’s constructor and apply the predicate in get_tools method.

# google.adk.tools.bash_tool module

Tool to execute bash commands.

class google.adk.tools.bash_tool.BashToolPolicy(allowed_command_prefixes=('*',), blocked_operators=(), timeout_seconds=30, max_memory_bytes=None, max_file_size_bytes=None, max_child_processes=None)

  Bases: `object`

  Configuration for allowed bash commands and resource limits.

  Set allowed_command_prefixes to (“*”,) to allow all commands (default), or explicitly list allowed prefixes.

  Values for max_memory_bytes, max_file_size_bytes, and max_child_processes will be enforced upon the spawned subprocess.

  allowed_command_prefixes: `tuple`[`str`, `...`] = ('*',)
  blocked_operators: `tuple`[`str`, `...`] = ()
  max_child_processes: `Optional`[`int`] = None
  max_file_size_bytes: `Optional`[`int`] = None
  max_memory_bytes: `Optional`[`int`] = None
  timeout_seconds: `Optional`[`int`] = 30

class google.adk.tools.bash_tool.ExecuteBashTool(*, workspace=None, policy=None)

  Bases: `BaseTool`

  Tool to execute a validated bash command within a workspace directory.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.bigquery module

BigQuery Tools.

BigQuery Tools under this module are hand crafted and customized while the tools under google.adk.tools.google_api_tool are auto generated based on API definition. The rationales to have customized tool are:

1. BigQuery APIs have functions overlaps and LLM can’t tell what tool to use

2. BigQuery APIs have a lot of parameters with some rarely used, which are not LLM-friendly

3. We want to provide more high-level tools like forecasting, RAG, segmentation, etc.

4. We want to provide extra access guardrails in those tools. For example, execute_sql can’t arbitrarily mutate existing data.

# google.adk.tools.bigtable module

Bigtable Tools (Experimental).

Bigtable tools under this module are hand crafted and customized while the tools under google.adk.tools.google_api_tool are auto generated based on API definition. The rationales to have customized tool are:

1. A dedicated Bigtable toolset to provide an easier, integrated way to interact with Bigtable for building AI Agent applications quickly. 2. We want to provide extra access guardrails and controls in those tools. 3. Use Bigtable Toolset for more customization and control to interact with Bigtable tables.

pydantic model google.adk.tools.bigtable.BigtableCredentialsConfig

  Bases: `BaseGoogleCredentialsConfig`

  Bigtable Credentials Configuration for Google API tools (Experimental).

  Please do not use this in production, as it may be deprecated later.

  Show JSON schema

      {
         "title": "BigtableCredentialsConfig",
         "type": "object",
         "properties": {
            "credentials": {
               "default": null,
               "title": "Credentials"
            },
            "external_access_token_key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "External Access Token Key"
            },
            "client_id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Id"
            },
            "client_secret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Secret"
            },
            "scopes": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scopes"
            }
         },
         "additionalProperties": false
      }

  Fields:

  Validators:

    - `__post_init__` » `all fields`

  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.

class google.adk.tools.bigtable.BigtableToolset(*, tool_filter=None, credentials_config=None, bigtable_tool_settings=None)

  Bases: `BaseToolset`

  Bigtable Toolset contains tools for interacting with Bigtable data and metadata.

  The tool names are:

    - bigtable_list_instances

    - bigtable_get_instance_info

    - bigtable_list_tables

    - bigtable_get_table_info

    - bigtable_list_clusters

    - bigtable_get_cluster_info

    - bigtable_execute_sql

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

  async get_tools(readonly_context=None)

    Get tools from the toolset.

    Return type:

      `List`[`BaseTool`]

# google.adk.tools.computer_use module

# google.adk.tools.crewai_tool module

class google.adk.tools.crewai_tool.CrewaiTool(tool, *, name, description='')

  Bases: `FunctionTool`

  Use this class to wrap a CrewAI tool.

  If the original tool name and description are not suitable, you can override them in the constructor.

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

  description: str

    The description of the tool.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `CrewaiTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  name: str

    The name of the tool.

  async run_async(*, args, tool_context)

    Override run_async to handle CrewAI-specific parameter filtering.

    CrewAI tools use **kwargs pattern, so we need special parameter filtering logic that allows all parameters to pass through while removing only reserved parameters like ‘self’ and ‘tool_context’.

    Note: ‘tool_context’ is removed from the initial args dictionary to prevent duplicates, but is re-added if the function signature explicitly requires it as a parameter.

    Return type:

      `Any`

  tool: CrewaiBaseTool

    The wrapped CrewAI tool.

pydantic model google.adk.tools.crewai_tool.CrewaiToolConfig

  Bases: `BaseToolConfig`

  Show JSON schema

      {
         "title": "CrewaiToolConfig",
         "type": "object",
         "properties": {
            "tool": {
               "title": "Tool",
               "type": "string"
            },
            "name": {
               "default": "",
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "required": [
            "tool"
         ]
      }

  Fields:

    - `description (str)`

    - `name (str)`

    - `tool (str)`

  field description: str = ''

    The description of the tool.

  field name: str = ''

    The name of the tool.

  field tool: str [Required]

    The fully qualified path of the CrewAI tool instance.

# google.adk.tools.data_agent module

Data Agent Tools.

pydantic model google.adk.tools.data_agent.DataAgentCredentialsConfig

  Bases: `BaseGoogleCredentialsConfig`

  Data Agent Credentials Configuration for Google API tools.

  Show JSON schema

      {
         "title": "DataAgentCredentialsConfig",
         "type": "object",
         "properties": {
            "credentials": {
               "default": null,
               "title": "Credentials"
            },
            "external_access_token_key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "External Access Token Key"
            },
            "client_id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Id"
            },
            "client_secret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Secret"
            },
            "scopes": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scopes"
            }
         },
         "additionalProperties": false
      }

  Fields:

  Validators:

    - `__post_init__` » `all fields`

  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.

class google.adk.tools.data_agent.DataAgentToolset(*, tool_filter=None, credentials_config=None, data_agent_tool_config=None)

  Bases: `BaseToolset`

  Data Agent Toolset contains tools for interacting with data agents.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Return all tools in the toolset based on the provided context.

    Return type:

      `List`[`BaseTool`]

    Parameters:

      readonly_context (ReadonlyContext, optional) – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools available under the specified context.

    Return type:

      list[BaseTool]

# google.adk.tools.discovery_engine_search_tool module

class google.adk.tools.discovery_engine_search_tool.DiscoveryEngineSearchTool(data_store_id=None, data_store_specs=None, search_engine_id=None, filter=None, max_results=None, *, search_result_mode=None, location=None)

  Bases: `FunctionTool`

  Tool for searching the discovery engine.

  Initializes the DiscoveryEngineSearchTool.

  Parameters:

    - data_store_id – The Vertex AI search data store resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}”.

    - data_store_specs – Specifications that define the specific DataStores to be searched. It should only be set if engine is used.

    - search_engine_id – The Vertex AI search engine resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/engines/{engine}”.

    - filter – The filter to be applied to the search request. Default is None.

    - max_results – The maximum number of results to return. Default is None.

    - search_result_mode – The search result mode. When None (default), automatically detects the correct mode by trying CHUNKS first and falling back to DOCUMENTS if the datastore requires it. Set explicitly to CHUNKS or DOCUMENTS to skip auto-detection.

    - location –

      Optional endpoint location override. Examples: “global”, “us”, “eu”. If not specified, location is inferred

      > from data_store_id or search_engine_id and defaults to “global”.

  discovery_engine_search(query)

    Search through Vertex AI Search’s discovery engine search API.

    Return type:

      `dict`[`str`, `Any`]

    Parameters:

      query – The search query.

    Returns:

      A dictionary containing the status of the request and the list of search results, which contains the title, url and content.

class google.adk.tools.discovery_engine_search_tool.SearchResultMode(value)

  Bases: `Enum`

  Search result mode for discovery engine search.

  CHUNKS = 'CHUNKS'

    Results as chunks (default). Works for unstructured data.

  DOCUMENTS = 'DOCUMENTS'

    Results as documents. Required for structured datastores.

# google.adk.tools.enterprise_search_tool module

class google.adk.tools.enterprise_search_tool.EnterpriseWebSearchTool

  Bases: `BaseTool`

  A Gemini 2+ built-in tool using web grounding for Enterprise compliance.

  NOTE: This tool is not the same as Vertex AI Search, which is used to be called “Enterprise Search”.

  See the documentation for more details: https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise.

  Initializes the Enterprise Web Search tool.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

# google.adk.tools.environment module

Environment toolset for command execution and file I/O.

class google.adk.tools.environment.EnvironmentToolset(*, environment, max_output_chars=None, **kwargs)

  Bases: `BaseToolset`

  Toolset providing tools to interact with an environment.

  Tools provided:

    - Execute – run shell commands

    - ReadFile – read file contents

    - EditFile – surgical text replacement

    - **WriteFile**q – create/overwrite files

  The toolset injects an environment-level system instruction on each LLM call that establishes environment identity and tool selection rules.

  Create an environment toolset.

  Parameters:

    - environment – The environment used to execute commands and perform file I/O.

    - max_output_chars – Maximum character limit for stdout/stderr/file truncation.

    - **kwargs – Forwarded to `BaseToolset.__init__`.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Return type:

      `None`

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Return all tools in the toolset based on the provided context.

    Return type:

      `list`[`BaseTool`]

    Parameters:

      readonly_context (ReadonlyContext, optional) – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools available under the specified context.

    Return type:

      list[BaseTool]

  async process_llm_request(*, tool_context, llm_request)

    Inject environment-level system instruction.

    Return type:

      `None`

# google.adk.tools.environment_simulation module

class google.adk.tools.environment_simulation.EnvironmentSimulationFactory(*args, **kwargs)

  Bases: `object`

  Factory for creating EnvironmentSimulation instances.

  static create_callback(config)

    Creates a callback function for EnvironmentSimulation.

    Return type:

      `Callable`[[`BaseTool`, `Dict`[`str`, `Any`], `Any`], `Awaitable`[`Optional`[`Dict`[`str`, `Any`]]]]

    Parameters:

      config – The configuration for the EnvironmentSimulation.

    Returns:

      A callable that can be used as a before_tool_callback or after_tool_callback.

  static create_plugin(config)

    Creates an ADK Plugin for EnvironmentSimulation.

    Return type:

      `EnvironmentSimulationPlugin`

    Parameters:

      config – The configuration for the EnvironmentSimulation.

    Returns:

      An instance of EnvironmentSimulationPlugin that can be used as an ADK plugin.

# google.adk.tools.example_tool module

class google.adk.tools.example_tool.ExampleTool(examples)

  Bases: `BaseTool`

  A tool that adds (few-shot) examples to the LLM request.

  examples

    The examples to add to the LLM request.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `ExampleTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

pydantic model google.adk.tools.example_tool.ExampleToolConfig

  Bases: `BaseToolConfig`

  Show JSON schema

      {
         "title": "ExampleToolConfig",
         "type": "object",
         "properties": {
            "examples": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Example"
                     },
                     "type": "array"
                  },
                  {
                     "type": "string"
                  }
               ],
               "title": "Examples"
            }
         },
         "$defs": {
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "Example": {
               "description": "A few-shot example.\n\nAttributes:\n  input: The input content for the example.\n  output: The expected output content for the example.",
               "properties": {
                  "input": {
                     "$ref": "#/$defs/Content"
                  },
                  "output": {
                     "items": {
                        "$ref": "#/$defs/Content"
                     },
                     "title": "Output",
                     "type": "array"
                  }
               },
               "required": [
                  "input",
                  "output"
               ],
               "title": "Example",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "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": [
            "examples"
         ]
      }

  Fields:

    - `examples (list[google.adk.examples.example.Example] | str)`

  field examples: Union[list[Example], str] [Required]

    The examples to add to the LLM request. User can either provide a list of examples or a fully-qualified name to a BaseExampleProvider object in code.

# google.adk.tools.exit_loop_tool module

google.adk.tools.exit_loop_tool.exit_loop(tool_context)

  Exits the loop.

  Call this function only when you are instructed to do so.

# google.adk.tools.function_tool module

class google.adk.tools.function_tool.FunctionTool(func, *, require_confirmation=False)

  Bases: `BaseTool`

  A tool that wraps a user-defined Python function.

  func

    The function to wrap.

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.get_user_choice_tool module

google.adk.tools.get_user_choice_tool.get_user_choice(options, tool_context)

  Provides the options to the user and asks them to choose one.

  Return type:

    `Optional`[`str`]

# google.adk.tools.google_api_tool module

Auto-generated tools and toolsets for Google APIs.

These tools and toolsets are auto-generated based on the API specifications provided by the Google API Discovery API.

class google.adk.tools.google_api_tool.BigQueryToolset(client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None)

  Bases: `GoogleApiToolset`

  Auto-generated BigQuery toolset based on Google BigQuery API v2 spec exposed by Google API discovery API.

  Parameters:

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

class google.adk.tools.google_api_tool.CalendarToolset(client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None)

  Bases: `GoogleApiToolset`

  Auto-generated Calendar toolset based on Google Calendar API v3 spec exposed by Google API discovery API.

  Parameters:

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

class google.adk.tools.google_api_tool.DocsToolset(client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None)

  Bases: `GoogleApiToolset`

  Auto-generated Docs toolset based on Google Docs API v1 spec exposed by Google API discovery API.

  Parameters:

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

class google.adk.tools.google_api_tool.GmailToolset(client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None)

  Bases: `GoogleApiToolset`

  Auto-generated Gmail toolset based on Google Gmail API v1 spec exposed by Google API discovery API.

  Parameters:

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

class google.adk.tools.google_api_tool.GoogleApiTool(rest_api_tool, client_id=None, client_secret=None, service_account=None, *, additional_headers=None)

  Bases: `BaseTool`

  configure_auth(client_id, client_secret)
  configure_sa_auth(service_account)
  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Dict`[`str`, `Any`]

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.google_api_tool.GoogleApiToolset(api_name, api_version, client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None, *, additional_headers=None)

  Bases: `BaseToolset`

  Google API Toolset contains tools for interacting with Google APIs.

  Usually one toolsets will contain tools only related to one Google API, e.g. Google Bigquery API toolset will contain tools only related to Google Bigquery API, like list dataset tool, list table tool etc.

  Parameters:

    - api_name – The name of the Google API (e.g., “calendar”, “gmail”).

    - api_version – The version of the API (e.g., “v3”, “v1”).

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

    - additional_headers – Optional dict of HTTP headers to inject into every request executed by this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  configure_auth(client_id, client_secret)
  configure_sa_auth(service_account)
  async get_tools(readonly_context=None)

    Get all tools in the toolset.

    Return type:

      `List`[`GoogleApiTool`]

  set_tool_filter(tool_filter)

class google.adk.tools.google_api_tool.SheetsToolset(client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None)

  Bases: `GoogleApiToolset`

  Auto-generated Sheets toolset based on Google Sheets API v4 spec exposed by Google API discovery API.

  Parameters:

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

class google.adk.tools.google_api_tool.SlidesToolset(client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None)

  Bases: `GoogleApiToolset`

  Auto-generated Slides toolset based on Google Slides API v1 spec exposed by Google API discovery API.

  Parameters:

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

class google.adk.tools.google_api_tool.YoutubeToolset(client_id=None, client_secret=None, tool_filter=None, service_account=None, tool_name_prefix=None)

  Bases: `GoogleApiToolset`

  Auto-generated YouTube toolset based on YouTube API v3 spec exposed by Google API discovery API.

  Parameters:

    - client_id – OAuth2 client ID for authentication.

    - client_secret – OAuth2 client secret for authentication.

    - tool_filter – Optional filter to include only specific tools or use a predicate function.

    - service_account – Optional service account for authentication.

    - tool_name_prefix – Optional prefix to add to all tool names in this toolset.

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

# google.adk.tools.google_maps_grounding_tool module

class google.adk.tools.google_maps_grounding_tool.GoogleMapsGroundingTool

  Bases: `BaseTool`

  A built-in tool that is automatically invoked by Gemini 2 models to ground query results with Google Maps.

  This tool operates internally within the model and does not require or perform local code execution.

  Only available for use with the VertexAI Gemini API (e.g. GOOGLE_GENAI_USE_VERTEXAI=TRUE)

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

# google.adk.tools.google_search_agent_tool module

class google.adk.tools.google_search_agent_tool.GoogleSearchAgentTool(agent)

  Bases: `AgentTool`

  A tool that wraps a sub-agent that only uses google_search tool.

  This is a workaround to support using google_search tool with other tools. TODO(b/448114567): Remove once the workaround is no longer needed.

  model

    The model to use for the sub-agent.

google.adk.tools.google_search_agent_tool.create_google_search_agent(model)

  Create a sub-agent that only uses google_search tool.

  Return type:

    `LlmAgent`

# google.adk.tools.google_search_tool module

class google.adk.tools.google_search_tool.GoogleSearchTool(*, bypass_multi_tools_limit=False, model=None)

  Bases: `BaseTool`

  A built-in tool that is automatically invoked by Gemini 2 models to retrieve search results from Google Search.

  This tool operates internally within the model and does not require or perform local code execution.

  Initializes the Google search tool.

  Parameters:

    - bypass_multi_tools_limit – Whether to bypass the multi tools limitation, so that the tool can be used with other tools in the same agent.

    - model – Optional model name to use for processing the LLM request. If provided, this model will be used instead of the model from the incoming llm_request.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

# google.adk.tools.google_tool module

class google.adk.tools.google_tool.GoogleTool(func, *, credentials_config=None, tool_settings=None)

  Bases: `FunctionTool`

  GoogleTool class for tools that call Google APIs.

  This class is for developers to handcraft customized Google API tools rather than auto generate Google API tools based on API specs.

  This class handles all the OAuth complexity, credential management, and common Google API patterns so subclasses can focus on their specific functionality.

  Initialize the Google API tool.

  Parameters:

    - func – callable that implements the tool’s logic, can accept one ‘credential” parameter

    - credentials_config – credentials config used to call Google API. If None, then we don’t handle the auth logic

    - tool_settings – Tool-specific settings. This settings should be provided by each toolset that uses this class to create customized tools.

  async run_async(*, args, tool_context)

    Main entry point for tool execution with credential handling.

    This method handles all the OAuth complexity and then delegates to the subclass’s run_async_with_credential method.

    Return type:

      `Any`

# google.adk.tools.langchain_tool module

class google.adk.tools.langchain_tool.LangchainTool(tool, name=None, description=None)

  Bases: `FunctionTool`

  Adapter class that wraps a Langchain tool for use with ADK.

  This adapter converts Langchain tools into a format compatible with Google’s generative AI function calling interface. It preserves the tool’s name, description, and functionality while adapting its schema.

  The original tool’s name and description can be overridden if needed.

  Parameters:

    - tool – A Langchain tool to wrap (BaseTool or a tool with a .run method)

    - name – Optional override for the tool’s name

    - description – Optional override for the tool’s description

  Examples:

      from langchain.tools import DuckDuckGoSearchTool
      from google.adk.integrations.langchain import LangchainTool

      search_tool = DuckDuckGoSearchTool()
      wrapped_tool = LangchainTool(search_tool)

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

  classmethod from_config(config, config_abs_path)

    Creates a tool instance from a config.

    This default implementation uses inspect to automatically map config values to constructor arguments based on their type hints. Subclasses should override this method for custom initialization logic.

    Return type:

      `LangchainTool`

    Parameters:

      - config – The config for the tool.

      - config_abs_path – The absolute path to the config file that contains the tool config.

    Returns:

      The tool instance.

pydantic model google.adk.tools.langchain_tool.LangchainToolConfig

  Bases: `BaseToolConfig`

  Show JSON schema

      {
         "title": "LangchainToolConfig",
         "type": "object",
         "properties": {
            "tool": {
               "title": "Tool",
               "type": "string"
            },
            "name": {
               "default": "",
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "required": [
            "tool"
         ]
      }

  Fields:

    - `description (str)`

    - `name (str)`

    - `tool (str)`

  field description: str = ''

    The description of the tool.

  field name: str = ''

    The name of the tool.

  field tool: str [Required]

    The fully qualified path of the Langchain tool instance.

# google.adk.tools.load_artifacts_tool module

class google.adk.tools.load_artifacts_tool.LoadArtifactsTool

  Bases: `BaseTool`

  A tool that loads the artifacts and adds them to the session.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.load_mcp_resource_tool module

class google.adk.tools.load_mcp_resource_tool.LoadMcpResourceTool(mcp_toolset)

  Bases: `BaseTool`

  A tool that loads the MCP resources and adds them to the session.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      None

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      Any

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

# google.adk.tools.load_memory_tool module

pydantic model google.adk.tools.load_memory_tool.LoadMemoryResponse

  Bases: `BaseModel`

  Show JSON schema

      {
         "title": "LoadMemoryResponse",
         "type": "object",
         "properties": {
            "memories": {
               "items": {
                  "$ref": "#/$defs/MemoryEntry"
               },
               "title": "Memories",
               "type": "array"
            }
         },
         "$defs": {
            "Blob": {
               "additionalProperties": false,
               "description": "A content blob.\n\nA Blob contains data of a specific media type. It is used to represent images,\naudio, and video.",
               "properties": {
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The raw bytes of the data.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "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\nGenerated only when the `CodeExecution` tool is used.",
               "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"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.",
                     "title": "Id"
                  }
               },
               "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 'model'. If not set, the service will default to 'user'.",
                     "title": "Role"
                  }
               },
               "title": "Content",
               "type": "object"
            },
            "ExecutableCode": {
               "additionalProperties": false,
               "description": "Model-generated code executed server-side, results returned to the model.\n\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.",
               "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`."
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.",
                     "title": "Id"
                  }
               },
               "title": "ExecutableCode",
               "type": "object"
            },
            "FileData": {
               "additionalProperties": false,
               "description": "URI-based data.\n\nA FileData message contains a URI pointing to data of a specific media type.\nIt is used to represent images, audio, and video stored in Google Cloud\nStorage.",
               "properties": {
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.",
                     "title": "Displayname"
                  },
                  "fileUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The URI of the file in Google Cloud Storage.",
                     "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": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. 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": "Optional. The name of the function to call. Matches [FunctionDeclaration.name].",
                     "title": "Name"
                  },
                  "partialArgs": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/PartialArg"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.",
                     "title": "Partialargs"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.",
                     "title": "Willcontinue"
                  }
               },
               "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."
                  },
                  "parts": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/FunctionResponsePart"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "List of parts that constitute a function response. Each part may\n      have a different IANA MIME type.",
                     "title": "Parts"
                  },
                  "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": [
                        {
                           "additionalProperties": true,
                           "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"
            },
            "FunctionResponseBlob": {
               "additionalProperties": false,
               "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
               "properties": {
                  "mimeType": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. The IANA standard MIME type of the source data.",
                     "title": "Mimetype"
                  },
                  "data": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. Inline media bytes.",
                     "title": "Data"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the blob.\n      Used to provide a label or filename to distinguish blobs.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseBlob",
               "type": "object"
            },
            "FunctionResponseFileData": {
               "additionalProperties": false,
               "description": "URI based data for function response.",
               "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"
                  },
                  "displayName": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Display name of the file.\n      Used to provide a label or filename to distinguish files.",
                     "title": "Displayname"
                  }
               },
               "title": "FunctionResponseFileData",
               "type": "object"
            },
            "FunctionResponsePart": {
               "additionalProperties": false,
               "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
               "properties": {
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseBlob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Inline media bytes."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponseFileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. URI based data."
                  }
               },
               "title": "FunctionResponsePart",
               "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": "Programming language of the `code`.",
               "enum": [
                  "LANGUAGE_UNSPECIFIED",
                  "PYTHON"
               ],
               "title": "Language",
               "type": "string"
            },
            "MemoryEntry": {
               "description": "Represent one memory entry.",
               "properties": {
                  "content": {
                     "$ref": "#/$defs/Content"
                  },
                  "custom_metadata": {
                     "additionalProperties": true,
                     "title": "Custom Metadata",
                     "type": "object"
                  },
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Id"
                  },
                  "author": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Author"
                  },
                  "timestamp": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timestamp"
                  }
               },
               "required": [
                  "content"
               ],
               "title": "MemoryEntry",
               "type": "object"
            },
            "Outcome": {
               "description": "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": {
                  "mediaResolution": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolution"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Media resolution for the input media.\n    "
                  },
                  "codeExecutionResult": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/CodeExecutionResult"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of executing the ExecutableCode."
                  },
                  "executableCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ExecutableCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Code generated by the model that is intended to be executed."
                  },
                  "fileData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FileData"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage."
                  },
                  "functionCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function."
                  },
                  "functionResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/FunctionResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted."
                  },
                  "inlineData": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Blob"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The inline data content of the part. This can be used to include images, audio, or video in a request."
                  },
                  "text": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.",
                     "title": "Text"
                  },
                  "thought": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates whether the `part` represents the model's thought process or reasoning.",
                     "title": "Thought"
                  },
                  "thoughtSignature": {
                     "anyOf": [
                        {
                           "format": "base64url",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.",
                     "title": "Thoughtsignature"
                  },
                  "videoMetadata": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/VideoMetadata"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."
                  },
                  "toolCall": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolCall"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API."
                  },
                  "toolResponse": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolResponse"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall."
                  },
                  "partMetadata": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.",
                     "title": "Partmetadata"
                  }
               },
               "title": "Part",
               "type": "object"
            },
            "PartMediaResolution": {
               "additionalProperties": false,
               "description": "Media resolution for the input media.",
               "properties": {
                  "level": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/PartMediaResolutionLevel"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tokenization quality used for given media.\n    "
                  },
                  "numTokens": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Specifies the required sequence length for media tokenization.\n    ",
                     "title": "Numtokens"
                  }
               },
               "title": "PartMediaResolution",
               "type": "object"
            },
            "PartMediaResolutionLevel": {
               "description": "The tokenization quality used for given media.",
               "enum": [
                  "MEDIA_RESOLUTION_UNSPECIFIED",
                  "MEDIA_RESOLUTION_LOW",
                  "MEDIA_RESOLUTION_MEDIUM",
                  "MEDIA_RESOLUTION_HIGH",
                  "MEDIA_RESOLUTION_ULTRA_HIGH"
               ],
               "title": "PartMediaResolutionLevel",
               "type": "string"
            },
            "PartialArg": {
               "additionalProperties": false,
               "description": "Partial argument value of the function call.\n\nThis data type is not supported in Gemini API.",
               "properties": {
                  "boolValue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a boolean value.",
                     "title": "Boolvalue"
                  },
                  "jsonPath": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. \"$.foo.bar[0].data\".",
                     "title": "Jsonpath"
                  },
                  "nullValue": {
                     "anyOf": [
                        {
                           "const": "NULL_VALUE",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a null value.",
                     "title": "Nullvalue"
                  },
                  "numberValue": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a double value.",
                     "title": "Numbervalue"
                  },
                  "stringValue": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Represents a string value.",
                     "title": "Stringvalue"
                  },
                  "willContinue": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.",
                     "title": "Willcontinue"
                  }
               },
               "title": "PartialArg",
               "type": "object"
            },
            "ToolCall": {
               "additionalProperties": false,
               "description": "A predicted server-side `ToolCall` returned from the model.\n\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Unique identifier of the tool call. The server returns the tool response with the matching `id`.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called."
                  },
                  "args": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.",
                     "title": "Args"
                  }
               },
               "title": "ToolCall",
               "type": "object"
            },
            "ToolResponse": {
               "additionalProperties": false,
               "description": "The output from a server-side `ToolCall` execution.\n\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.",
               "properties": {
                  "id": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The identifier of the tool call this response is for.",
                     "title": "Id"
                  },
                  "toolType": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ToolType"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The type of tool that was called, matching the tool_type in the corresponding ToolCall."
                  },
                  "response": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The tool response.",
                     "title": "Response"
                  }
               },
               "title": "ToolResponse",
               "type": "object"
            },
            "ToolType": {
               "description": "The type of tool in the function call.",
               "enum": [
                  "TOOL_TYPE_UNSPECIFIED",
                  "GOOGLE_SEARCH_WEB",
                  "GOOGLE_SEARCH_IMAGE",
                  "URL_CONTEXT",
                  "GOOGLE_MAPS",
                  "FILE_SEARCH"
               ],
               "title": "ToolType",
               "type": "string"
            },
            "VideoMetadata": {
               "additionalProperties": false,
               "description": "Provides metadata for a video, including the start and end offsets for clipping and the frame rate.",
               "properties": {
                  "endOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The end offset of the video.",
                     "title": "Endoffset"
                  },
                  "fps": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].",
                     "title": "Fps"
                  },
                  "startOffset": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The start offset of the video.",
                     "title": "Startoffset"
                  }
               },
               "title": "VideoMetadata",
               "type": "object"
            }
         }
      }

  Fields:

    - `memories (list[google.adk.memory.memory_entry.MemoryEntry])`

  field memories: list[MemoryEntry] [Optional]

class google.adk.tools.load_memory_tool.LoadMemoryTool

  Bases: `FunctionTool`

  A tool that loads the memory for the current user.

  NOTE: Currently this tool only uses text part from the memory.

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

async google.adk.tools.load_memory_tool.load_memory(query, tool_context)

  Loads the memory for the current user.

  Return type:

    `LoadMemoryResponse`

  Parameters:

    query – The query to load the memory for.

  Returns:

    A list of memory results.

# google.adk.tools.load_web_page module

google.adk.tools.load_web_page.load_web_page(url)

  Fetches the content in the url and returns the text in it.

  Return type:

    `str`

  Parameters:

    url (str) – The url to browse.

  Returns:

    The text content of the url.

  Return type:

    str

# google.adk.tools.long_running_tool module

class google.adk.tools.long_running_tool.LongRunningFunctionTool(func)

  Bases: `FunctionTool`

  A function tool that returns the result asynchronously.

  This tool is used for long-running operations that may take a significant amount of time to complete. The framework will call the function. Once the function returns, the response will be returned asynchronously to the framework which is identified by the function_call_id.

  Example: ``python tool = LongRunningFunctionTool(a_long_running_function) ``

  is_long_running

    Whether the tool is a long running operation.

  Initializes the FunctionTool. Extracts metadata from a callable object.

  Parameters:

    - func – The function to wrap.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

# google.adk.tools.mcp_tool module

class google.adk.tools.mcp_tool.MCPTool(*args, **kwargs)

  Bases: `McpTool`

  Deprecated name, use McpTool instead.

  Initializes an McpTool.

  This tool wraps an MCP Tool interface and uses a session manager to communicate with the MCP server.

  Parameters:

    - mcp_tool – The MCP tool to wrap.

    - mcp_session_manager – The MCP session manager to use for communication.

    - auth_scheme – The authentication scheme to use.

    - auth_credential – The authentication credential to use.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

    - header_provider – Optional function to provide dynamic headers.

    - progress_callback –

      Optional callback to receive progress notifications from MCP server during long-running tool execution. Can be either:

      - A `ProgressFnT` callback that receives (progress, total, message). This callback will be used for all invocations.

      - A `ProgressCallbackFactory` that creates per-invocation callbacks. The factory receives (tool_name, callback_context, **kwargs) and returns a ProgressFnT or None. This allows callbacks to access and modify runtime context like session state.

  Raises:

    ValueError – If mcp_tool or mcp_session_manager is None.

class google.adk.tools.mcp_tool.MCPToolset(*args, **kwargs)

  Bases: `McpToolset`

  Deprecated name, use McpToolset instead.

  Initializes the McpToolset.

  Parameters:

    - connection_params – The connection parameters to the MCP server. Can be: `StdioConnectionParams` for using local mcp server (e.g. using `npx` or `python3`); or `SseConnectionParams` for a local/remote SSE server; or `StreamableHTTPConnectionParams` for local/remote Streamable http server. Note, `StdioServerParameters` is also supported for using local mcp server (e.g. using `npx` or `python3` ), but it does not support timeout, and we recommend to use `StdioConnectionParams` instead when timeout is needed.

    - tool_filter – Optional filter to select specific tools. Can be either: - A list of tool names to include - A ToolPredicate function for custom filtering logic

    - tool_name_prefix – A prefix to be added to the name of each tool in this toolset.

    - errlog – TextIO stream for error logging.

    - auth_scheme – The auth scheme of the tool for tool calling

    - auth_credential – The auth credential of the tool for tool calling

    - require_confirmation – Whether tools in this toolset require confirmation. Can be a single boolean or a callable to apply to all tools.

    - header_provider – A callable that takes a ReadonlyContext and returns a dictionary of headers to be used for the MCP session.

    - progress_callback – Optional callback to receive progress notifications from MCP server during long-running tool execution. Can be either: - A `ProgressFnT` callback that receives (progress, total, message). This callback will be shared by all tools in the toolset. - A `ProgressCallbackFactory` that creates per-tool callbacks. The factory receives (tool_name, callback_context, **kwargs) and returns a ProgressFnT or None. This allows different tools to have different progress handling logic and access/modify session state via the CallbackContext. The **kwargs parameter allows for future extensibility.

    - use_mcp_resources – Whether the agent should have access to MCP resources. This will add a load_mcp_resource tool to the toolset and include available resources in the agent context. Defaults to False.

    - sampling_callback – Optional callback to handle sampling requests from the MCP server.

    - sampling_capabilities – Optional capabilities for sampling.

    - credential_key – A user specified key used to load and save this credential in a credential service. Used with auth_scheme.

class google.adk.tools.mcp_tool.McpTool(*, mcp_tool, mcp_session_manager, auth_scheme=None, auth_credential=None, require_confirmation=False, header_provider=None, progress_callback=None)

  Bases: `BaseAuthenticatedTool`

  Turns an MCP Tool into an ADK Tool.

  Internally, the tool initializes from a MCP Tool, and uses the MCP Session to call the tool.

  Note: For API key authentication, only header-based API keys are supported. Query and cookie-based API keys will result in authentication errors.

  Initializes an McpTool.

  This tool wraps an MCP Tool interface and uses a session manager to communicate with the MCP server.

  Parameters:

    - mcp_tool – The MCP tool to wrap.

    - mcp_session_manager – The MCP session manager to use for communication.

    - auth_scheme – The authentication scheme to use.

    - auth_credential – The authentication credential to use.

    - require_confirmation – Whether this tool requires confirmation. A boolean or a callable that takes the function’s arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user.

    - header_provider – Optional function to provide dynamic headers.

    - progress_callback –

      Optional callback to receive progress notifications from MCP server during long-running tool execution. Can be either:

      - A `ProgressFnT` callback that receives (progress, total, message). This callback will be used for all invocations.

      - A `ProgressCallbackFactory` that creates per-invocation callbacks. The factory receives (tool_name, callback_context, **kwargs) and returns a ProgressFnT or None. This allows callbacks to access and modify runtime context like session state.

  Raises:

    ValueError – If mcp_tool or mcp_session_manager is None.

  property mcp_app_resource_uri: str | None

    Returns the MCP App UI resource URI if this tool has one.

    MCP Apps declare a UI resource via meta.ui.resourceUri in the tool definition. This property extracts that URI, supporting both the nested format ({“ui”: {“resourceUri”: “ui://…”}}) and the flat format ({“ui/resourceUri”: “ui://…”}).

    Returns:

      //` resource URI string, or None if not present.

    Return type:

      The `ui

  property raw_mcp_tool: Tool

    Returns the raw MCP tool.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

  property visibility: List[str]

    Returns the visibility if this MCP tool meta has one.

class google.adk.tools.mcp_tool.McpToolset(*, connection_params, tool_filter=None, tool_name_prefix=None, errlog=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, auth_scheme=None, auth_credential=None, require_confirmation=False, header_provider=None, progress_callback=None, use_mcp_resources=False, sampling_callback=None, sampling_capabilities=None, credential_key=None)

  Bases: `BaseToolset`

  Connects to a MCP Server, and retrieves MCP Tools into ADK Tools.

  This toolset manages the connection to an MCP server and provides tools that can be used by an agent. It properly implements the BaseToolset interface for easy integration with the agent framework.

  Usage:

      toolset = McpToolset(
          connection_params=StdioServerParameters(
              command='npx',
              args=["-y", "@modelcontextprotocol/server-filesystem"],
          ),
          tool_filter=['read_file', 'list_directory']  # Optional: filter specific
          tools
      )

      # Use in an agent
      agent = LlmAgent(
          model='gemini-2.5-flash',
          name='enterprise_assistant',
          instruction='Help user accessing their file systems',
          tools=[toolset],
      )

      # Cleanup is handled automatically by the agent framework
      # But you can also manually close if needed:
      # await toolset.close()

  Initializes the McpToolset.

  Parameters:

    - connection_params – The connection parameters to the MCP server. Can be: `StdioConnectionParams` for using local mcp server (e.g. using `npx` or `python3`); or `SseConnectionParams` for a local/remote SSE server; or `StreamableHTTPConnectionParams` for local/remote Streamable http server. Note, `StdioServerParameters` is also supported for using local mcp server (e.g. using `npx` or `python3` ), but it does not support timeout, and we recommend to use `StdioConnectionParams` instead when timeout is needed.

    - tool_filter – Optional filter to select specific tools. Can be either: - A list of tool names to include - A ToolPredicate function for custom filtering logic

    - tool_name_prefix – A prefix to be added to the name of each tool in this toolset.

    - errlog – TextIO stream for error logging.

    - auth_scheme – The auth scheme of the tool for tool calling

    - auth_credential – The auth credential of the tool for tool calling

    - require_confirmation – Whether tools in this toolset require confirmation. Can be a single boolean or a callable to apply to all tools.

    - header_provider – A callable that takes a ReadonlyContext and returns a dictionary of headers to be used for the MCP session.

    - progress_callback – Optional callback to receive progress notifications from MCP server during long-running tool execution. Can be either: - A `ProgressFnT` callback that receives (progress, total, message). This callback will be shared by all tools in the toolset. - A `ProgressCallbackFactory` that creates per-tool callbacks. The factory receives (tool_name, callback_context, **kwargs) and returns a ProgressFnT or None. This allows different tools to have different progress handling logic and access/modify session state via the CallbackContext. The **kwargs parameter allows for future extensibility.

    - use_mcp_resources – Whether the agent should have access to MCP resources. This will add a load_mcp_resource tool to the toolset and include available resources in the agent context. Defaults to False.

    - sampling_callback – Optional callback to handle sampling requests from the MCP server.

    - sampling_capabilities – Optional capabilities for sampling.

    - credential_key – A user specified key used to load and save this credential in a credential service. Used with auth_scheme.

  async close()

    Performs cleanup and releases resources held by the toolset.

    This method closes the MCP session and cleans up all associated resources. It’s designed to be safe to call multiple times and handles cleanup errors gracefully to avoid blocking application shutdown.

    Return type:

      `None`

  classmethod from_config(config, config_abs_path)

    Creates an McpToolset from a configuration object.

    Return type:

      `McpToolset`

  get_auth_config()

    Returns the auth config for this toolset.

    ADK will populate exchanged_auth_credential on this config before calling get_tools(). The toolset can then access the ready-to-use credential via self._auth_config.exchanged_auth_credential.

    Return type:

      `Optional`[`AuthConfig`]

  async get_resource_info(name, readonly_context=None)

    Returns metadata about a specific resource (name, MIME type, etc.).

    Return type:

      `dict`[`str`, `Any`]

  async get_tools(readonly_context=None)

    Return all tools in the toolset based on the provided context.

    Return type:

      `List`[`BaseTool`]

    Parameters:

      readonly_context – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools available under the specified context.

    Return type:

      List[BaseTool]

  async list_resources(readonly_context=None)

    Returns a list of resource names available on the MCP server.

    Return type:

      `list`[`str`]

  async read_resource(name, readonly_context=None)

    Fetches and returns a list of contents of the named resource.

    Return type:

      `Any`

    Parameters:

      - name – The name of the resource to fetch.

      - readonly_context – Context used to provide headers for the MCP session.

    Returns:

      List of contents of the resource.

pydantic model google.adk.tools.mcp_tool.SseConnectionParams

  Bases: `BaseModel`

  Parameters for the MCP SSE connection.

  See MCP SSE Client documentation for more details. https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/sse.py

  url

    URL for the MCP SSE server.

  headers

    Headers for the MCP SSE connection.

  timeout

    Timeout in seconds for establishing the connection to the MCP SSE server.

  sse_read_timeout

    Timeout in seconds for reading data from the MCP SSE server.

  httpx_client_factory

    Factory function to create a custom HTTPX client. If not provided, a default factory will be used.

  Show JSON schema

      {
         "title": "SseConnectionParams",
         "type": "object",
         "properties": {
            "url": {
               "title": "Url",
               "type": "string"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Headers"
            },
            "timeout": {
               "default": 5.0,
               "title": "Timeout",
               "type": "number"
            },
            "sse_read_timeout": {
               "default": 300.0,
               "title": "Sse Read Timeout",
               "type": "number"
            },
            "httpx_client_factory": {
               "default": null,
               "title": "Httpx Client Factory"
            }
         },
         "required": [
            "url"
         ]
      }

  Fields:

    - `headers (dict[str, Any] | None)`

    - `httpx_client_factory (google.adk.tools.mcp_tool.mcp_session_manager.CheckableMcpHttpClientFactory)`

    - `sse_read_timeout (float)`

    - `timeout (float)`

    - `url (str)`

  field headers: dict[str, Any] | None = None
  field httpx_client_factory: CheckableMcpHttpClientFactory = <function create_mcp_http_client>
  field sse_read_timeout: float = 300.0
  field timeout: float = 5.0
  field url: str [Required]

pydantic model google.adk.tools.mcp_tool.StdioConnectionParams

  Bases: `BaseModel`

  Parameters for the MCP Stdio connection.

  server_params

    Parameters for the MCP Stdio server.

  timeout

    Timeout in seconds for establishing the connection to the MCP stdio server.

  Show JSON schema

      {
         "title": "StdioConnectionParams",
         "description": "Parameters for the MCP Stdio connection.\n\nAttributes:\n    server_params: Parameters for the MCP Stdio server.\n    timeout: Timeout in seconds for establishing the connection to the MCP\n      stdio server.",
         "type": "object",
         "properties": {
            "server_params": {
               "$ref": "#/$defs/StdioServerParameters"
            },
            "timeout": {
               "default": 5.0,
               "title": "Timeout",
               "type": "number"
            }
         },
         "$defs": {
            "StdioServerParameters": {
               "properties": {
                  "command": {
                     "title": "Command",
                     "type": "string"
                  },
                  "args": {
                     "items": {
                        "type": "string"
                     },
                     "title": "Args",
                     "type": "array"
                  },
                  "env": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "type": "string"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Env"
                  },
                  "cwd": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "format": "path",
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Cwd"
                  },
                  "encoding": {
                     "default": "utf-8",
                     "title": "Encoding",
                     "type": "string"
                  },
                  "encoding_error_handler": {
                     "default": "strict",
                     "enum": [
                        "strict",
                        "ignore",
                        "replace"
                     ],
                     "title": "Encoding Error Handler",
                     "type": "string"
                  }
               },
               "required": [
                  "command"
               ],
               "title": "StdioServerParameters",
               "type": "object"
            }
         },
         "required": [
            "server_params"
         ]
      }

  Fields:

    - `server_params (mcp.client.stdio.StdioServerParameters)`

    - `timeout (float)`

  field server_params: StdioServerParameters [Required]
  field timeout: float = 5.0

pydantic model google.adk.tools.mcp_tool.StreamableHTTPConnectionParams

  Bases: `BaseModel`

  Parameters for the MCP Streamable HTTP connection.

  See MCP Streamable HTTP Client documentation for more details. https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/streamable_http.py

  url

    URL for the MCP Streamable HTTP server.

  headers

    Headers for the MCP Streamable HTTP connection.

  timeout

    Timeout in seconds for establishing the connection to the MCP Streamable HTTP server.

  sse_read_timeout

    Timeout in seconds for reading data from the MCP Streamable HTTP server.

  terminate_on_close

    Whether to terminate the MCP Streamable HTTP server when the connection is closed.

  httpx_client_factory

    Factory function to create a custom HTTPX client. If not provided, a default factory will be used.

  Show JSON schema

      {
         "title": "StreamableHTTPConnectionParams",
         "type": "object",
         "properties": {
            "url": {
               "title": "Url",
               "type": "string"
            },
            "headers": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Headers"
            },
            "timeout": {
               "default": 5.0,
               "title": "Timeout",
               "type": "number"
            },
            "sse_read_timeout": {
               "default": 300.0,
               "title": "Sse Read Timeout",
               "type": "number"
            },
            "terminate_on_close": {
               "default": true,
               "title": "Terminate On Close",
               "type": "boolean"
            },
            "httpx_client_factory": {
               "default": null,
               "title": "Httpx Client Factory"
            }
         },
         "required": [
            "url"
         ]
      }

  Fields:

    - `headers (dict[str, Any] | None)`

    - `httpx_client_factory (google.adk.tools.mcp_tool.mcp_session_manager.CheckableMcpHttpClientFactory)`

    - `sse_read_timeout (float)`

    - `terminate_on_close (bool)`

    - `timeout (float)`

    - `url (str)`

  field headers: dict[str, Any] | None = None
  field httpx_client_factory: CheckableMcpHttpClientFactory = <function create_mcp_http_client>
  field sse_read_timeout: float = 300.0
  field terminate_on_close: bool = True
  field timeout: float = 5.0
  field url: str [Required]

google.adk.tools.mcp_tool.adk_to_mcp_tool_type(tool)

  Convert a Tool in ADK into MCP tool type.

  This function transforms an ADK tool definition into its equivalent representation in the MCP (Model Context Protocol) system.

  Return type:

    `Tool`

  Parameters:

    tool – The ADK tool to convert. It should be an instance of a class derived from BaseTool.

  Returns:

    An object of MCP Tool type, representing the converted tool.

  Examples

  # Assuming ‘my_tool’ is an instance of a BaseTool derived class mcp_tool = adk_to_mcp_tool_type(my_tool) print(mcp_tool)

google.adk.tools.mcp_tool.gemini_to_json_schema(gemini_schema)

  Converts a Gemini Schema object into a JSON Schema dictionary.

  Return type:

    `Dict`[`str`, `Any`]

  Parameters:

    gemini_schema – An instance of the Gemini Schema class.

  Returns:

    A dictionary representing the equivalent JSON Schema.

  Raises:

    - TypeError – If the input is not an instance of the expected Schema class.

    - ValueError – If an invalid Gemini Type enum value is encountered.

# google.adk.tools.openapi_tool module

class google.adk.tools.openapi_tool.OpenAPIToolset(*, spec_dict=None, spec_str=None, spec_str_type='json', auth_scheme=None, auth_credential=None, credential_key=None, tool_filter=None, tool_name_prefix=None, ssl_verify=None, header_provider=None, preserve_property_names=False)

  Bases: `BaseToolset`

  Class for parsing OpenAPI spec into a list of RestApiTool.

  Usage:

      # Initialize OpenAPI toolset from a spec string.
      openapi_toolset = OpenAPIToolset(spec_str=openapi_spec_str,
        spec_str_type="json")
      # Or, initialize OpenAPI toolset from a spec dictionary.
      openapi_toolset = OpenAPIToolset(spec_dict=openapi_spec_dict)

      # Add all tools to an agent.
      agent = Agent(
        tools=[*openapi_toolset.get_tools()]
      )
      # Or, add a single tool to an agent.
      agent = Agent(
        tools=[openapi_toolset.get_tool('tool_name')]
      )

  Initializes the OpenAPIToolset.

  Usage:

      # Initialize OpenAPI toolset from a spec string.
      openapi_toolset = OpenAPIToolset(spec_str=openapi_spec_str,
        spec_str_type="json")
      # Or, initialize OpenAPI toolset from a spec dictionary.
      openapi_toolset = OpenAPIToolset(spec_dict=openapi_spec_dict)

      # Add all tools to an agent.
      agent = Agent(
        tools=[*openapi_toolset.get_tools()]
      )
      # Or, add a single tool to an agent.
      agent = Agent(
        tools=[openapi_toolset.get_tool('tool_name')]
      )

  Parameters:

    - spec_dict – The OpenAPI spec dictionary. If provided, it will be used instead of loading the spec from a string.

    - spec_str – The OpenAPI spec string in JSON or YAML format. It will be used when spec_dict is not provided.

    - spec_str_type – The type of the OpenAPI spec string. Can be “json” or “yaml”.

    - auth_scheme – The auth scheme to use for all tools. Use AuthScheme or use helpers in `google.adk.tools.openapi_tool.auth.auth_helpers`

    - auth_credential – The auth credential to use for all tools. Use AuthCredential or use helpers in `google.adk.tools.openapi_tool.auth.auth_helpers`

    - credential_key – Optional stable key used for interactive auth and credential caching across all tools in this toolset.

    - tool_filter – The filter used to filter the tools in the toolset. It can be either a tool predicate or a list of tool names of the tools to expose.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset. Useful when multiple OpenAPI specs have tools with similar names.

    - ssl_verify – SSL certificate verification option for all tools. Can be: - None: Use default verification (True) - True: Verify SSL certificates using system CA - False: Disable SSL verification (insecure, not recommended) - str: Path to a CA bundle file or directory for custom CA - ssl.SSLContext: Custom SSL context for advanced configuration This is useful for enterprise environments where requests go through a TLS-intercepting proxy with a custom CA certificate.

    - header_provider – A callable that returns a dictionary of headers to be included in API requests. The callable receives the ReadonlyContext as an argument, allowing dynamic header generation based on the current context. Useful for adding custom headers like correlation IDs, authentication tokens, or other request metadata.

    - preserve_property_names – If True, preserve the original property names from the OpenAPI spec instead of converting them to snake_case. This is useful when calling APIs that expect camelCase or other non-snake_case parameter names in the request. Defaults to False for backward compatibility.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  configure_ssl_verify_all(ssl_verify=None)

    Configure SSL certificate verification for all tools.

    This is useful for enterprise environments where requests go through a TLS-intercepting proxy with a custom CA certificate.

    Parameters:

      ssl_verify – SSL certificate verification option. Can be: - None: Use default verification (True) - True: Verify SSL certificates using system CA - False: Disable SSL verification (insecure, not recommended) - str: Path to a CA bundle file or directory for custom CA - ssl.SSLContext: Custom SSL context for advanced configuration

  get_tool(tool_name)

    Get a tool by name.

    Return type:

      `Optional`[`RestApiTool`]

  async get_tools(readonly_context=None)

    Get all tools in the toolset.

    Return type:

      `List`[`RestApiTool`]

class google.adk.tools.openapi_tool.RestApiTool(name, description, endpoint, operation, auth_scheme=None, auth_credential=None, should_parse_operation=True, ssl_verify=None, header_provider=None, *, credential_key=None)

  Bases: `BaseTool`

  A generic tool that interacts with a REST API.

  - Generates request params and body

  - Attaches auth credentials to API call.

  Example:

      # Each API operation in the spec will be turned into its own tool
      # Name of the tool is the operationId of that operation, in snake case
      operations = OperationGenerator().parse(openapi_spec_dict)
      tool = [RestApiTool.from_parsed_operation(o) for o in operations]

  Initializes the RestApiTool with the given parameters.

  To generate RestApiTool from OpenAPI Specs, use OperationGenerator. Example:

      # Each API operation in the spec will be turned into its own tool
      # Name of the tool is the operationId of that operation, in snake case
      operations = OperationGenerator().parse(openapi_spec_dict)
      tool = [RestApiTool.from_parsed_operation(o) for o in operations]

  Hint: Use google.adk.tools.openapi_tool.auth.auth_helpers to construct auth_scheme and auth_credential.

  Parameters:

    - name – The name of the tool.

    - description – The description of the tool.

    - endpoint – Include the base_url, path, and method of the tool.

    - operation – Pydantic object or a dict. Representing the OpenAPI Operation object (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object)

    - auth_scheme – The auth scheme of the tool. Representing the OpenAPI SecurityScheme object (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-scheme-object)

    - auth_credential – The authentication credential of the tool.

    - should_parse_operation – Whether to parse the operation.

    - ssl_verify – SSL certificate verification option. Can be: - None: Use default verification - True: Verify SSL certificates using system CA - False: Disable SSL verification (insecure, not recommended) - str: Path to a CA bundle file or directory for custom CA - ssl.SSLContext: Custom SSL context for advanced configuration

    - header_provider – A callable that returns a dictionary of headers to be included in API requests. The callable receives the ReadonlyContext as an argument, allowing dynamic header generation based on the current context. Useful for adding custom headers like correlation IDs, authentication tokens, or other request metadata.

    - credential_key – Optional stable key used for interactive auth and credential caching.

  async call(*, args, tool_context)

    Executes the REST API call.

    Return type:

      `Dict`[`str`, `Any`]

    Parameters:

      - args – Keyword arguments representing the operation parameters.

      - tool_context – The tool context (not used here, but required by the interface).

    Returns:

      The API response as a dictionary.

  configure_auth_credential(auth_credential=None)

    Configures the authentication credential for the API call.

    Parameters:

      auth_credential – AuthCredential|dict - The authentication credential. The dict is converted to an AuthCredential object.

  configure_auth_scheme(auth_scheme)

    Configures the authentication scheme for the API call.

    Parameters:

      auth_scheme – AuthScheme|dict -: The authentication scheme. The dict is converted to a AuthScheme object.

  configure_credential_key(credential_key=None)

    Configures the credential key for interactive auth / caching.

  configure_ssl_verify(ssl_verify=None)

    Configures SSL certificate verification for the API call.

    This is useful for enterprise environments where requests go through a TLS-intercepting proxy with a custom CA certificate.

    Parameters:

      ssl_verify – SSL certificate verification option. Can be: - None: Use default verification (True) - True: Verify SSL certificates using system CA - False: Disable SSL verification (insecure, not recommended) - str: Path to a CA bundle file or directory for custom CA - ssl.SSLContext: Custom SSL context for advanced configuration

  classmethod from_parsed_operation(parsed, ssl_verify=None, header_provider=None)

    Initializes the RestApiTool from a ParsedOperation object.

    Return type:

      `RestApiTool`

    Parameters:

      - parsed – A ParsedOperation object.

      - ssl_verify – SSL certificate verification option.

      - header_provider – A callable that returns a dictionary of headers to be included in API requests. The callable receives the ReadonlyContext as an argument, allowing dynamic header generation based on the current context. Useful for adding custom headers like correlation IDs, authentication tokens, or other request metadata.

    Returns:

      A RestApiTool object.

  classmethod from_parsed_operation_str(parsed_operation_str)

    Initializes the RestApiTool from a dict.

    Return type:

      `RestApiTool`

    Parameters:

      parsed – A dict representation of a ParsedOperation object.

    Returns:

      A RestApiTool object.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Dict`[`str`, `Any`]

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

  set_default_headers(headers)

    Sets default headers that are merged into every request.

# google.adk.tools.preload_memory_tool module

class google.adk.tools.preload_memory_tool.PreloadMemoryTool

  Bases: `BaseTool`

  A tool that preloads the memory for the current user.

  This tool will be automatically executed for each llm_request, and it won’t be called by the model.

  NOTE: Currently this tool only uses text part from the memory.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

# google.adk.tools.pubsub module

Pub/Sub Tools (Experimental).

Pub/Sub Tools under this module are handcrafted and customized while the tools under google.adk.tools.google_api_tool are auto generated based on API definition. The rationales to have customized tool are:

1. Better handling of base64 encoding for published messages.

2. A richer subscribe-side API that reflects how users may want to pull/ack messages.

pydantic model google.adk.tools.pubsub.PubSubCredentialsConfig

  Bases: `BaseGoogleCredentialsConfig`

  Pub/Sub Credentials Configuration for Google API tools (Experimental).

  Please do not use this in production, as it may be deprecated later.

  Show JSON schema

      {
         "title": "PubSubCredentialsConfig",
         "type": "object",
         "properties": {
            "credentials": {
               "default": null,
               "title": "Credentials"
            },
            "external_access_token_key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "External Access Token Key"
            },
            "client_id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Id"
            },
            "client_secret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Secret"
            },
            "scopes": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scopes"
            }
         },
         "additionalProperties": false
      }

  Fields:

  Validators:

    - `__post_init__` » `all fields`

  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.

pydantic model google.adk.tools.pubsub.PubSubToolConfig

  Bases: `BaseModel`

  Configuration for Pub/Sub tools.

  Show JSON schema

      {
         "title": "PubSubToolConfig",
         "description": "Configuration for Pub/Sub tools.",
         "type": "object",
         "properties": {
            "project_id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Project Id"
            }
         },
         "additionalProperties": false
      }

  Fields:

    - `project_id (str | None)`

  field project_id: str | None = None

    GCP project ID to use for the Pub/Sub operations.

    If not set, the project ID will be inferred from the environment or credentials.

class google.adk.tools.pubsub.PubSubToolset(*, tool_filter=None, credentials_config=None, pubsub_tool_config=None)

  Bases: `BaseToolset`

  Pub/Sub Toolset contains tools for interacting with Pub/Sub topics and subscriptions.

  Initializes the PubSubToolset.

  Parameters:

    - tool_filter – A predicate or list of tool names to filter the tools in the toolset. If None, all tools are included.

    - credentials_config – The credentials configuration to use for authenticating with Google Cloud.

    - pubsub_tool_config – The configuration for the Pub/Sub tools.

  async close()

    Clean up resources used by the toolset.

  async get_tools(readonly_context=None)

    Get tools from the toolset.

    Return type:

      `list`[`BaseTool`]

# google.adk.tools.retrieval module

class google.adk.tools.retrieval.BaseRetrievalTool(*, name, description, is_long_running=False, custom_metadata=None)

  Bases: `BaseTool`

# google.adk.tools.set_model_response_tool module

Tool for setting model response when using output_schema with other tools.

class google.adk.tools.set_model_response_tool.SetModelResponseTool(output_schema)

  Bases: `BaseTool`

  Internal tool used for output schema workaround.

  This tool allows the model to set its final response when output_schema is configured alongside other tools. The model should use this tool to provide its final structured response instead of outputting text directly.

  Initialize the tool with the expected output schema.

  Parameters:

    output_schema – The output schema. Supports all types from SchemaUnion: - type[BaseModel]: A pydantic model class (e.g., MySchema) - list[type[BaseModel]]: A generic list type (e.g., list[MySchema]) - list[primitive]: e.g., list[str], list[int] - dict: Raw dict schemas - Schema: Google’s Schema type

  async run_async(*, args, tool_context)

    Process the model’s response and return the validated data.

    Return type:

      `Any`

    Parameters:

      - args – The structured response data matching the output schema.

      - tool_context – Tool execution context.

    Returns:

      - dict for BaseModel

      - list of dicts for list[BaseModel]

      - raw value for other schema types (list[str], dict, etc.)

    Return type:

      The validated response. Type depends on the output_schema

# google.adk.tools.skill_toolset module

Toolset for discovering, viewing, and executing agent skills.

class google.adk.tools.skill_toolset.ListSkillsTool(toolset)

  Bases: `BaseTool`

  Tool to list all available skills.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.skill_toolset.LoadSkillResourceTool(toolset)

  Bases: `BaseTool`

  Tool to load resources (references, assets, or scripts) from a skill.

  async process_llm_request(*, tool_context, llm_request)

    Injects binary content into the LLM request if the model viewed it.

    Return type:

      `None`

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.skill_toolset.LoadSkillTool(toolset)

  Bases: `BaseTool`

  Tool to load a skill’s instructions.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.skill_toolset.RunSkillScriptTool(toolset)

  Bases: `BaseTool`

  Tool to execute scripts from a skill’s scripts/ directory.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.skill_toolset.SearchSkillsTool(toolset)

  Bases: `BaseTool`

  Tool to search for relevant skills in the registry.

  async run_async(*, args, tool_context)

    Runs the tool with the given arguments and context.

    Return type:

      `Any`

    Note

    - Required if this tool needs to run at the client side.

    - Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

    Parameters:

      - args – The LLM-filled arguments.

      - tool_context – The context of the tool.

    Returns:

      The result of running the tool.

class google.adk.tools.skill_toolset.SkillToolset(skills=None, *, registry=None, code_executor=None, script_timeout=300, additional_tools=None)

  Bases: `BaseToolset`

  A toolset for managing and interacting with agent skills.

  Initializes the SkillToolset.

  Parameters:

    - skills – List of skills to register.

    - registry – Optional skill registry for dynamic loading.

    - code_executor – Optional code executor for script execution.

    - script_timeout – Timeout in seconds for shell script execution via subprocess.run. Defaults to 300 seconds. Does not apply to Python scripts executed via exec().

    - additional_tools – Optional list of BaseTool or BaseToolset instances to be made available to the agent when certain skills are activated.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Return type:

      `None`

  async get_tools(readonly_context=None)

    Returns the list of tools in this toolset.

    Return type:

      `list`[`BaseTool`]

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request to include available skills.

    Return type:

      `None`

# google.adk.tools.spanner module

Spanner Tools (Experimental).

Spanner Tools under this module are hand crafted and customized while the tools under google.adk.tools.google_api_tool are auto generated based on API definition. The rationales to have customized tool are:

1. A dedicated Spanner toolset to provide an easier, integrated way to interact with Spanner database and tables for building AI Agent applications quickly. 2. We want to provide more high-level tools like Search, ML.Predict, and Graph etc. 3. We want to provide extra access guardrails and controls in those tools. For example, execute_sql can’t arbitrarily mutate existing data. 4. We want to provide Spanner best practices and knowledge assistants for ad-hoc analytics queries. 5. Use Spanner Toolset for more customization and control to interact with Spanner database and tables.

class google.adk.tools.spanner.SpannerAdminToolset(*, tool_filter=None, credentials_config=None, spanner_tool_settings=None)

  Bases: `BaseToolset`

  A toolset containing tools for interacting with Spanner admin tasks.

  The tool names are:

    - spanner_list_instances

    - spanner_get_instance

    - spanner_create_database

    - spanner_list_databases

    - spanner_create_instance

    - spanner_list_instance_configs

    - spanner_get_instance_config

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Get tools from the toolset.

    Return type:

      `list`[`BaseTool`]

pydantic model google.adk.tools.spanner.SpannerCredentialsConfig

  Bases: `BaseGoogleCredentialsConfig`

  Spanner Credentials Configuration for Google API tools (Experimental).

  Please do not use this in production, as it may be deprecated later.

  Show JSON schema

      {
         "title": "SpannerCredentialsConfig",
         "type": "object",
         "properties": {
            "credentials": {
               "default": null,
               "title": "Credentials"
            },
            "external_access_token_key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "External Access Token Key"
            },
            "client_id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Id"
            },
            "client_secret": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Client Secret"
            },
            "scopes": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Scopes"
            }
         },
         "additionalProperties": false
      }

  Fields:

  Validators:

    - `__post_init__` » `all fields`

  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.

class google.adk.tools.spanner.SpannerToolset(*, tool_filter=None, credentials_config=None, spanner_tool_settings=None)

  Bases: `BaseToolset`

  Spanner Toolset contains tools for interacting with Spanner data, database and table information.

  The tool names are:

    - spanner_list_table_names

    - spanner_list_table_indexes

    - spanner_list_table_index_columns

    - spanner_list_named_schemas

    - spanner_get_table_schema

    - spanner_execute_sql

    - spanner_similarity_search

    - spanner_vector_store_similarity_search

  Initialize the toolset.

  Parameters:

    - tool_filter – Filter to apply to tools.

    - tool_name_prefix – The prefix to prepend to the names of the tools returned by the toolset.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Get tools from the toolset.

    Return type:

      `List`[`BaseTool`]

# google.adk.tools.tool_configs module

pydantic model google.adk.tools.tool_configs.BaseToolConfig

  Bases: `BaseModel`

  The base class for all tool configs.

  Show JSON schema

      {
         "title": "BaseToolConfig",
         "description": "The base class for all tool configs.",
         "type": "object",
         "properties": {},
         "additionalProperties": false
      }

pydantic model google.adk.tools.tool_configs.ToolArgsConfig

  Bases: `BaseModel`

  Config to host free key-value pairs for the args in ToolConfig.

  Show JSON schema

      {
         "title": "ToolArgsConfig",
         "description": "Config to host free key-value pairs for the args in ToolConfig.",
         "type": "object",
         "properties": {},
         "additionalProperties": true
      }

pydantic model google.adk.tools.tool_configs.ToolConfig

  Bases: `BaseModel`

  The configuration for a tool.

  The config supports these types of tools: 1. ADK built-in tools 2. User-defined tool instances 3. User-defined tool classes 4. User-defined functions that generate tool instances 5. User-defined function tools

  For examples:

  > 1. For ADK built-in tool instances or classes in google.adk.tools package, they can be referenced directly with the name and optionally with args.

  > ``` tools:

  > > - name: google_search

  > > - name: AgentTool args:

  > >   > agent: ./another_agent.yaml skip_summarization: true

  > ```

  > 2. For user-defined tool instances, the name is the fully qualified path to the tool instance.

  > ``` tools:

  > > - name: my_package.my_module.my_tool

  > ```

  > 3. For user-defined tool classes (custom tools), the name is the fully qualified path to the tool class and args is the arguments for the tool.

  > ``` tools:

  > > - name: my_package.my_module.my_tool_class args:

  > >   > my_tool_arg1: value1 my_tool_arg2: value2

  > ```

  > 4. For user-defined functions that generate tool instances, the name is the fully qualified path to the function and args is passed to the function as arguments.

  > ``` tools:

  > > - name: my_package.my_module.my_tool_function args:

  > >   > my_function_arg1: value1 my_function_arg2: value2

  > ```

  > The function must have the following signature: ``` def my_function(args: ToolArgsConfig) -> BaseTool:

  > > …

  > ```

  > 5. For user-defined function tools, the name is the fully qualified path to the function.

  > ``` tools:

  > > - name: my_package.my_module.my_function_tool

  > ```

  > If the above use cases don’t suffice, users can define a custom tool config by extending BaseToolConfig and override from_config() in the custom tool.

  Show JSON schema

      {
         "title": "ToolConfig",
         "description": "The configuration for a tool.\n\nThe config supports these types of tools:\n1. ADK built-in tools\n2. User-defined tool instances\n3. User-defined tool classes\n4. User-defined functions that generate tool instances\n5. User-defined function tools\n\nFor examples:\n\n  1. For ADK built-in tool instances or classes in `google.adk.tools` package,\n  they can be referenced directly with the `name` and optionally with\n  `args`.\n\n  ```\n  tools:\n    - name: google_search\n    - name: AgentTool\n      args:\n        agent: ./another_agent.yaml\n        skip_summarization: true\n  ```\n\n  2. For user-defined tool instances, the `name` is the fully qualified path\n  to the tool instance.\n\n  ```\n  tools:\n    - name: my_package.my_module.my_tool\n  ```\n\n  3. For user-defined tool classes (custom tools), the `name` is the fully\n  qualified path to the tool class and `args` is the arguments for the tool.\n\n  ```\n  tools:\n    - name: my_package.my_module.my_tool_class\n      args:\n        my_tool_arg1: value1\n        my_tool_arg2: value2\n  ```\n\n  4. For user-defined functions that generate tool instances, the `name` is\n  the fully qualified path to the function and `args` is passed to the\n  function as arguments.\n\n  ```\n  tools:\n    - name: my_package.my_module.my_tool_function\n      args:\n        my_function_arg1: value1\n        my_function_arg2: value2\n  ```\n\n  The function must have the following signature:\n  ```\n  def my_function(args: ToolArgsConfig) -> BaseTool:\n    ...\n  ```\n\n  5. For user-defined function tools, the `name` is the fully qualified path\n  to the function.\n\n  ```\n  tools:\n    - name: my_package.my_module.my_function_tool\n  ```\n\n  If the above use cases don't suffice, users can define a custom tool config\n  by extending BaseToolConfig and override from_config() in the custom tool.",
         "type": "object",
         "properties": {
            "name": {
               "description": "The name of the tool.\n\nFor ADK built-in tools, `name` is the name of the tool, e.g. `google_search`\nor `AgentTool`.\n\nFor user-defined tools, the name is the fully qualified path to the tool, e.g.\n`my_package.my_module.my_tool`.",
               "title": "Name",
               "type": "string"
            },
            "args": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ToolArgsConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The args for the tool."
            }
         },
         "$defs": {
            "ToolArgsConfig": {
               "additionalProperties": true,
               "description": "Config to host free key-value pairs for the args in ToolConfig.",
               "properties": {},
               "title": "ToolArgsConfig",
               "type": "object"
            }
         },
         "additionalProperties": false,
         "required": [
            "name"
         ]
      }

  Fields:

    - `args (google.adk.tools.tool_configs.ToolArgsConfig | None)`

    - `name (str)`

  field args: Optional[ToolArgsConfig] = None

    The args for the tool.

  field name: str [Required]

    The name of the tool.

    For ADK built-in tools, name is the name of the tool, e.g. google_search or AgentTool.

    For user-defined tools, the name is the fully qualified path to the tool, e.g. my_package.my_module.my_tool.

# google.adk.tools.tool_confirmation module

pydantic model google.adk.tools.tool_confirmation.ToolConfirmation

  Bases: `BaseModel`

  Represents a tool confirmation configuration.

  Show JSON schema

      {
         "title": "ToolConfirmation",
         "description": "Represents a tool confirmation configuration.",
         "type": "object",
         "properties": {
            "hint": {
               "default": "",
               "title": "Hint",
               "type": "string"
            },
            "confirmed": {
               "default": false,
               "title": "Confirmed",
               "type": "boolean"
            },
            "payload": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Payload"
            }
         },
         "additionalProperties": false
      }

  Fields:

    - `confirmed (bool)`

    - `hint (str)`

    - `payload (Any | None)`

  field confirmed: bool = False

    Whether the tool execution is confirmed.

  field hint: str = ''

    The hint text for why the input is needed.

  field payload: Optional[Any] = None

    The custom data payload needed from the user to continue the flow. It should be JSON serializable.

# google.adk.tools.tool_context module

# google.adk.tools.toolbox_toolset module

class google.adk.tools.toolbox_toolset.ToolboxToolset(server_url, toolset_name=None, tool_names=None, auth_token_getters=None, bound_params=None, credentials=None, additional_headers=None, **kwargs)

  Bases: `BaseToolset`

  A class that provides access to toolbox toolsets.

  Example: ``python toolbox_toolset = ToolboxToolset("http://127.0.0.1:5000") ``

  Initializes the ToolboxToolset.

  Parameters:

    - server_url – The URL of the toolbox server.

    - toolset_name – (Optional) The name of the toolbox toolset to load.

    - tool_names – (Optional) The names of the tools to load.

    - auth_token_getters –

      (Optional) A mapping of authentication service names to callables that return the corresponding authentication token. see: https://github.com/googleapis/mcp-toolbox-sdk-python/tree/main/packages/toolbox-core#authenticating-tools

      > for details.

    - bound_params –

      (Optional) A mapping of parameter names to bind to specific values or callables that are called to produce values as needed. see: https://github.com/googleapis/mcp-toolbox-sdk-python/tree/main/packages/toolbox-core#binding-parameter-values

      > for details.

    - credentials – (Optional) toolbox_adk.CredentialConfig object.

    - additional_headers – (Optional) Static headers mapping.

    - **kwargs – Additional arguments passed to the underlying toolbox_adk.ToolboxToolset.

  The resulting ToolboxToolset will contain both tools loaded by tool_names and toolset_name.

  Note: toolset_name and tool_names are optional. If both are omitted, all tools are loaded.

  async close()

    Performs cleanup and releases resources held by the toolset.

    Note

    This method is invoked, for example, at the end of an agent server’s lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

  async get_tools(readonly_context=None)

    Return all tools in the toolset based on the provided context.

    Return type:

      `list`[`BaseTool`]

    Parameters:

      readonly_context (ReadonlyContext, optional) – Context used to filter tools available to the agent. If None, all tools in the toolset are returned.

    Returns:

      A list of tools available under the specified context.

    Return type:

      list[BaseTool]

# google.adk.tools.transfer_to_agent_tool module

class google.adk.tools.transfer_to_agent_tool.TransferToAgentTool(agent_names)

  Bases: `FunctionTool`

  A specialized FunctionTool for agent transfer with enum constraints.

  This tool enhances the base transfer_to_agent function by adding JSON Schema enum constraints to the agent_name parameter. This prevents LLMs from hallucinating invalid agent names by restricting choices to only valid agents.

  agent_names

    List of valid agent names that can be transferred to.

  Initialize the TransferToAgentTool.

  Parameters:

    agent_names – List of valid agent names that can be transferred to.

google.adk.tools.transfer_to_agent_tool.transfer_to_agent(agent_name, tool_context)

  Transfer the question to another agent.

  This tool hands off control to another agent when it’s more suitable to answer the user’s question according to the agent’s description.

  Return type:

    `None`

  Note

  For most use cases, you should use TransferToAgentTool instead of this function directly. TransferToAgentTool provides additional enum constraints that prevent LLMs from hallucinating invalid agent names.

  Parameters:

    agent_name – the agent name to transfer to.

# google.adk.tools.url_context_tool module

class google.adk.tools.url_context_tool.UrlContextTool

  Bases: `BaseTool`

  A built-in tool that is automatically invoked by Gemini 2 models to retrieve content from the URLs and use that content to inform and shape its response.

  This tool operates internally within the model and does not require or perform local code execution.

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

# google.adk.tools.vertex_ai_search_tool module

class google.adk.tools.vertex_ai_search_tool.VertexAiSearchTool(*, data_store_id=None, data_store_specs=None, search_engine_id=None, filter=None, max_results=None, bypass_multi_tools_limit=False)

  Bases: `BaseTool`

  A built-in tool using Vertex AI Search.

  data_store_id

    The Vertex AI search data store resource ID.

  search_engine_id

    The Vertex AI search engine resource ID.

  To dynamically customize the search configuration at runtime (e.g., set filter based on user context), subclass this tool and override the _build_vertex_ai_search_config method.

  Example

  ```python class DynamicFilterSearchTool(VertexAiSearchTool):

  > def _build_vertex_ai_search_config(

  >   self, ctx: ReadonlyContext

  > ) -> types.VertexAISearch:

  >   user_id = ctx.state.get(‘user_id’) return types.VertexAISearch(

  >   > datastore=self.data_store_id, engine=self.search_engine_id, filter=f”user_id = ‘{user_id}’”, max_results=self.max_results,

  >   )

  ```

  Initializes the Vertex AI Search tool.

  Parameters:

    - data_store_id – The Vertex AI search data store resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}”.

    - data_store_specs – Specifications that define the specific DataStores to be searched. It should only be set if engine is used.

    - search_engine_id – The Vertex AI search engine resource ID in the format of “projects/{project}/locations/{location}/collections/{collection}/engines/{engine}”.

    - filter – The filter to apply to the search results.

    - max_results – The maximum number of results to return.

    - bypass_multi_tools_limit – Whether to bypass the multi tools limitation, so that the tool can be used with other tools in the same agent.

  Raises:

    - ValueError – If both data_store_id and search_engine_id are not specified

    - or both are specified. –

  async process_llm_request(*, tool_context, llm_request)

    Processes the outgoing LLM request for this tool.

    Use cases: - Most common use case is adding this tool to the LLM request. - Some tools may just preprocess the LLM request before it’s sent out.

    Return type:

      `None`

    Parameters:

      - tool_context – The context of the tool.

      - llm_request – The outgoing LLM request, mutable this method.

# google.adk.utils module

# google.adk.version module

# google.adk.workflow module

pydantic model google.adk.workflow.BaseNode

  Bases: `BaseModel`

  A base class for all nodes in the workflow graph.

  Show JSON schema

      {
         "title": "BaseNode",
         "description": "A base class for all nodes in the workflow graph.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            }
         },
         "$defs": {
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      }

  Fields:

    - `description (str)`

    - `input_schema (dict[Any, Any] | type | google.genai.types.Schema | types.GenericAlias | types.UnionType | _UnionGenericAlias | None)`

    - `name (str)`

    - `output_schema (dict[Any, Any] | type | google.genai.types.Schema | types.GenericAlias | types.UnionType | _UnionGenericAlias | None)`

    - `rerun_on_resume (bool)`

    - `retry_config (google.adk.workflow._retry_config.RetryConfig | None)`

    - `state_schema (type[pydantic.main.BaseModel] | None)`

    - `timeout (float | None)`

    - `wait_for_output (bool)`

  Validators:

    - `_validate_name` » `name`

  field description: str = ''

    A human-readable description of what this node does.

  field input_schema: SchemaType | None = None

    Schema to validate and coerce node input data.

    Supports all `SchemaType` variants. Validation uses `TypeAdapter` and runs centrally in the node runner before `node.run()` is called.

    `None` means no input validation (the default).

  field name: str [Required]

    The unique name of the node within the workflow graph.

    Validated by:

      - `_validate_name`

  field output_schema: SchemaType | None = None

    Schema to validate and coerce node output data.

    Supports all `SchemaType` variants (Pydantic `BaseModel` subclass, generic aliases like `list[str]`, raw `dict` schemas, etc.).

    When set to a `BaseModel` subclass, the node’s output data is validated:

      - dict → `output_schema.model_validate(data).model_dump()`

      - BaseModel instance → `data.model_dump()` (already converted)

    `None` means no output validation (the default).

  field rerun_on_resume: bool = False

    Controls behavior when resuming after an interrupt.

    If True, the node reruns from scratch. If False, it completes immediately using the user’s resuming input as the node’s output.

  field retry_config: RetryConfig | None = None

    Configuration for retrying the node on failure.

    If set, exceptions raised by the node will trigger retries according to the specified policy.

  field state_schema: type[BaseModel] | None = None

    Optional Pydantic model declaring the expected state keys and types.

    When set, `ctx.state` mutations are validated at runtime against this schema. Child nodes inherit the schema from their parent (via InvocationContext) unless they declare their own.

    Prefixed keys (`app:`, `user:`, `temp:`) bypass validation.

  field timeout: float | None = None

    Maximum time in seconds for this node to complete.

    If the node does not finish within this duration, it is cancelled and treated as a failure (raising `NodeTimeoutError`). This integrates with `retry_config` — a timed-out node can be retried if retries are configured.

    `None` means no timeout (the node runs until completion).

  field wait_for_output: bool = False

    If True, node only transitions to COMPLETED upon yielding output or route.

    Without output/route, the node enters WAITING state and downstream nodes are not triggered, allowing predecessors to re-trigger it. This is useful for nodes like `JoinNode` that run multiple times before producing a final output.

    WARNING: Completing execution without ever yielding output/route causes an indefinite WAITING state (deadlock). This is considered a user configuration error.

  async run(*, ctx, node_input)

    Public entry point. Calls _run_impl, normalizes yields to Event.

    Normalization rules: - None -> skipped - Event -> pass through - RequestInput -> convert to interrupt Event - Any other value -> Event(output=value)

    Return type:

      `AsyncGenerator`[`Event`, `None`]

pydantic model google.adk.workflow.Edge

  Bases: `BaseModel`

  An edge in the workflow graph.

  Show JSON schema

      {
         "title": "Edge",
         "description": "An edge in the workflow graph.",
         "type": "object",
         "properties": {
            "from_node": {
               "$ref": "#/$defs/BaseNode"
            },
            "to_node": {
               "$ref": "#/$defs/BaseNode"
            },
            "route": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  },
                  {
                     "items": {
                        "anyOf": [
                           {
                              "type": "boolean"
                           },
                           {
                              "type": "integer"
                           },
                           {
                              "type": "string"
                           }
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The route(s) that this edge is associated with. A single value or a list of values. The edge is followed when the emitted route matches any value in the list.",
               "title": "Route"
            }
         },
         "$defs": {
            "BaseNode": {
               "description": "A base class for all nodes in the workflow graph.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseNode",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "additionalProperties": false,
         "required": [
            "from_node",
            "to_node"
         ]
      }

  Fields:

    - `from_node (google.adk.workflow._base_node.BaseNode)`

    - `route (bool | int | str | list[bool | int | str] | None)`

    - `to_node (google.adk.workflow._base_node.BaseNode)`

  field from_node: Annotated[BaseNode, SerializeAsAny()] [Required]

    The from node.

  field route: RouteValue | list[RouteValue] | None = None

    The route(s) that this edge is associated with. A single value or a list of values. The edge is followed when the emitted route matches any value in the list.

  field to_node: Annotated[BaseNode, SerializeAsAny()] [Required]

    The to node.

pydantic model google.adk.workflow.FunctionNode

  Bases: `BaseNode`

  A node that wraps a Python sync/async function or generator.

  Type coercions applied to function parameters (via `TypeAdapter`):

    - `dict` → `BaseModel` when the annotation is a Pydantic model.

    - `list[dict]` → `list[BaseModel]`, `dict[K, dict]` → `dict[K, BaseModel]`, etc.

    - `types.Content` → `str` when the annotation expects `str` (including `Optional[str]` / `Union[str, ...]`).

    - All other values are validated/coerced by Pydantic’s `TypeAdapter`.

  Initializes FunctionNode.

  Parameters:

    - func – A sync/async function or sync/async generator function that forms the node’s logic. It can accept ‘ctx: Context’ and ‘node_input: Any’ as arguments, depending on its signature. If the function is not a generator, its return value will be wrapped in an Event, unless the return value is None.

    - name – The name of the node. If None, it defaults to func.__name__.

    - rerun_on_resume – If True, the node will be rerun after being interrupted and resumed. If False, the node will be marked as completed and the resuming input will be treated as the node’s output.

    - retry_config – If provided, the node will be retried on failure based on this configuration.

    - timeout – Maximum time in seconds for this node to complete.

    - auth_config – If provided, the framework requests user authentication before running the node. Requires rerun_on_resume=True (the node must rerun after credentials are provided).

    - parameter_binding – How function parameters are bound. `'state'` (default) binds parameters from `ctx.state`. `'node_input'` binds parameters from `node_input` dict and infers `input_schema` / `output_schema` from the function signature (used when the node acts as an agent’s tool).

  Show JSON schema

      {
         "title": "FunctionNode",
         "description": "A node that wraps a Python sync/async function or generator.\n\nType coercions applied to function parameters (via ``TypeAdapter``):\n  - ``dict`` \u2192 ``BaseModel`` when the annotation is a Pydantic model.\n  - ``list[dict]`` \u2192 ``list[BaseModel]``, ``dict[K, dict]`` \u2192\n    ``dict[K, BaseModel]``, etc.\n  - ``types.Content`` \u2192 ``str`` when the annotation expects ``str``\n    (including ``Optional[str]`` / ``Union[str, ...]``).\n  - All other values are validated/coerced by Pydantic's ``TypeAdapter``.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            },
            "auth_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/AuthConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "parameter_binding": {
               "default": "state",
               "enum": [
                  "state",
                  "node_input"
               ],
               "title": "Parameter Binding",
               "type": "string"
            }
         },
         "$defs": {
            "APIKey": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "apiKey"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "in": {
                     "$ref": "#/$defs/APIKeyIn"
                  },
                  "name": {
                     "title": "Name",
                     "type": "string"
                  }
               },
               "required": [
                  "in",
                  "name"
               ],
               "title": "APIKey",
               "type": "object"
            },
            "APIKeyIn": {
               "enum": [
                  "query",
                  "header",
                  "cookie"
               ],
               "title": "APIKeyIn",
               "type": "string"
            },
            "AuthConfig": {
               "additionalProperties": true,
               "description": "The auth config sent by tool asking client to collect auth credentials and\n\nadk and client will help to fill in the response",
               "properties": {
                  "authScheme": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/APIKey"
                        },
                        {
                           "$ref": "#/$defs/HTTPBase"
                        },
                        {
                           "$ref": "#/$defs/OAuth2"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnect"
                        },
                        {
                           "$ref": "#/$defs/HTTPBearer"
                        },
                        {
                           "$ref": "#/$defs/OpenIdConnectWithConfig"
                        },
                        {
                           "$ref": "#/$defs/CustomAuthScheme"
                        }
                     ],
                     "title": "Authscheme"
                  },
                  "rawAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "exchangedAuthCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/AuthCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "credentialKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Credentialkey"
                  }
               },
               "required": [
                  "authScheme"
               ],
               "title": "AuthConfig",
               "type": "object"
            },
            "AuthCredential": {
               "additionalProperties": true,
               "description": "Data class representing an authentication credential.\n\nTo exchange for the actual credential, please use\nCredentialExchanger.exchange_credential().\n\nExamples: API Key Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    api_key=\"1234\",\n)\n\nExample: HTTP Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"basic\",\n        credentials=HttpCredentials(username=\"user\", password=\"password\"),\n    ),\n)\n\nExample: OAuth2 Bearer Token in HTTP Header\nAuthCredential(\n    auth_type=AuthCredentialTypes.HTTP,\n    http=HttpAuth(\n        scheme=\"bearer\",\n        credentials=HttpCredentials(token=\"eyAkaknabna....\"),\n    ),\n)\n\nExample: OAuth2 Auth with Authorization Code Flow\nAuthCredential(\n    auth_type=AuthCredentialTypes.OAUTH2,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n    ),\n)\n\nExample: OpenID Connect Auth\nAuthCredential(\n    auth_type=AuthCredentialTypes.OPEN_ID_CONNECT,\n    oauth2=OAuth2Auth(\n        client_id=\"1234\",\n        client_secret=\"secret\",\n        redirect_uri=\"https://example.com\",\n        scopes=[\"scope1\", \"scope2\"],\n    ),\n)\n\nExample: Auth with resource reference\nAuthCredential(\n    auth_type=AuthCredentialTypes.API_KEY,\n    resource_ref=\"projects/1234/locations/us-central1/resources/resource1\",\n)",
               "properties": {
                  "authType": {
                     "$ref": "#/$defs/AuthCredentialTypes"
                  },
                  "resourceRef": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Resourceref"
                  },
                  "apiKey": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Apikey"
                  },
                  "http": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/HttpAuth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "serviceAccount": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccount"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "oauth2": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuth2Auth"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "required": [
                  "authType"
               ],
               "title": "AuthCredential",
               "type": "object"
            },
            "AuthCredentialTypes": {
               "description": "Represents the type of authentication credential.",
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect",
                  "serviceAccount"
               ],
               "title": "AuthCredentialTypes",
               "type": "string"
            },
            "CustomAuthScheme": {
               "additionalProperties": true,
               "description": "A flexible model for custom authentication schemes.\n\nThe subclasses must define a `default` for the `type_` field, if using OAuth2\nuser consent flow, to ensure correct rehydration.",
               "properties": {
                  "type": {
                     "title": "Type",
                     "type": "string"
                  }
               },
               "required": [
                  "type"
               ],
               "title": "CustomAuthScheme",
               "type": "object"
            },
            "HTTPBase": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  }
               },
               "required": [
                  "scheme"
               ],
               "title": "HTTPBase",
               "type": "object"
            },
            "HTTPBearer": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "http"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "scheme": {
                     "const": "bearer",
                     "default": "bearer",
                     "title": "Scheme",
                     "type": "string"
                  },
                  "bearerFormat": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Bearerformat"
                  }
               },
               "title": "HTTPBearer",
               "type": "object"
            },
            "HttpAuth": {
               "additionalProperties": true,
               "description": "The credentials and metadata for HTTP authentication.",
               "properties": {
                  "scheme": {
                     "title": "Scheme",
                     "type": "string"
                  },
                  "credentials": {
                     "$ref": "#/$defs/HttpCredentials"
                  },
                  "additionalHeaders": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "type": "string"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Additionalheaders"
                  }
               },
               "required": [
                  "scheme",
                  "credentials"
               ],
               "title": "HttpAuth",
               "type": "object"
            },
            "HttpCredentials": {
               "additionalProperties": true,
               "description": "Represents the secret token value for HTTP authentication, like user name, password, oauth token, etc.",
               "properties": {
                  "username": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Username"
                  },
                  "password": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Password"
                  },
                  "token": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token"
                  }
               },
               "title": "HttpCredentials",
               "type": "object"
            },
            "OAuth2": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "oauth2"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "flows": {
                     "$ref": "#/$defs/OAuthFlows"
                  }
               },
               "required": [
                  "flows"
               ],
               "title": "OAuth2",
               "type": "object"
            },
            "OAuth2Auth": {
               "additionalProperties": true,
               "description": "Represents credential value and its metadata for a OAuth2 credential.",
               "properties": {
                  "clientId": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientid"
                  },
                  "clientSecret": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Clientsecret"
                  },
                  "authUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authuri"
                  },
                  "nonce": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Nonce"
                  },
                  "state": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State"
                  },
                  "redirectUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Redirecturi"
                  },
                  "authResponseUri": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authresponseuri"
                  },
                  "authCode": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Authcode"
                  },
                  "accessToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Accesstoken"
                  },
                  "refreshToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshtoken"
                  },
                  "idToken": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Idtoken"
                  },
                  "expiresAt": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresat"
                  },
                  "expiresIn": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Expiresin"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  },
                  "codeVerifier": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codeverifier"
                  },
                  "codeChallengeMethod": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Codechallengemethod"
                  },
                  "tokenEndpointAuthMethod": {
                     "anyOf": [
                        {
                           "enum": [
                              "client_secret_basic",
                              "client_secret_post",
                              "client_secret_jwt",
                              "private_key_jwt"
                           ],
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": "client_secret_basic",
                     "title": "Tokenendpointauthmethod"
                  }
               },
               "title": "OAuth2Auth",
               "type": "object"
            },
            "OAuthFlowAuthorizationCode": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl",
                  "tokenUrl"
               ],
               "title": "OAuthFlowAuthorizationCode",
               "type": "object"
            },
            "OAuthFlowClientCredentials": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowClientCredentials",
               "type": "object"
            },
            "OAuthFlowImplicit": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "authorizationUrl": {
                     "title": "Authorizationurl",
                     "type": "string"
                  }
               },
               "required": [
                  "authorizationUrl"
               ],
               "title": "OAuthFlowImplicit",
               "type": "object"
            },
            "OAuthFlowPassword": {
               "additionalProperties": true,
               "properties": {
                  "refreshUrl": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Refreshurl"
                  },
                  "scopes": {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "default": {},
                     "title": "Scopes",
                     "type": "object"
                  },
                  "tokenUrl": {
                     "title": "Tokenurl",
                     "type": "string"
                  }
               },
               "required": [
                  "tokenUrl"
               ],
               "title": "OAuthFlowPassword",
               "type": "object"
            },
            "OAuthFlows": {
               "additionalProperties": true,
               "properties": {
                  "implicit": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowImplicit"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "password": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowPassword"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "clientCredentials": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowClientCredentials"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "authorizationCode": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/OAuthFlowAuthorizationCode"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  }
               },
               "title": "OAuthFlows",
               "type": "object"
            },
            "OpenIdConnect": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "openIdConnectUrl": {
                     "title": "Openidconnecturl",
                     "type": "string"
                  }
               },
               "required": [
                  "openIdConnectUrl"
               ],
               "title": "OpenIdConnect",
               "type": "object"
            },
            "OpenIdConnectWithConfig": {
               "additionalProperties": true,
               "properties": {
                  "type": {
                     "$ref": "#/$defs/SecuritySchemeType",
                     "default": "openIdConnect"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Description"
                  },
                  "authorization_endpoint": {
                     "title": "Authorization Endpoint",
                     "type": "string"
                  },
                  "token_endpoint": {
                     "title": "Token Endpoint",
                     "type": "string"
                  },
                  "userinfo_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Userinfo Endpoint"
                  },
                  "revocation_endpoint": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Revocation Endpoint"
                  },
                  "token_endpoint_auth_methods_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Token Endpoint Auth Methods Supported"
                  },
                  "grant_types_supported": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Grant Types Supported"
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  }
               },
               "required": [
                  "authorization_endpoint",
                  "token_endpoint"
               ],
               "title": "OpenIdConnectWithConfig",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "SecuritySchemeType": {
               "enum": [
                  "apiKey",
                  "http",
                  "oauth2",
                  "openIdConnect"
               ],
               "title": "SecuritySchemeType",
               "type": "string"
            },
            "ServiceAccount": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  service_account_credential: The service account credential (JSON key).\n  scopes: The OAuth2 scopes to request. Optional; when omitted with\n      ``use_default_credential=True``, defaults to the cloud-platform scope.\n  use_default_credential: Whether to use Application Default Credentials.\n  use_id_token: Whether to exchange for an ID token instead of an access\n      token. Required for service-to-service authentication with Cloud Run,\n      Cloud Functions, and other Google Cloud services that require identity\n      verification. When True, ``audience`` must also be set.\n  audience: The target audience for the ID token, typically the URL of the\n      receiving service (e.g. ``https://my-service-xyz.run.app``). Required\n      when ``use_id_token`` is True.",
               "properties": {
                  "serviceAccountCredential": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/ServiceAccountCredential"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "scopes": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Scopes"
                  },
                  "useDefaultCredential": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Usedefaultcredential"
                  },
                  "useIdToken": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": false,
                     "title": "Useidtoken"
                  },
                  "audience": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Audience"
                  }
               },
               "title": "ServiceAccount",
               "type": "object"
            },
            "ServiceAccountCredential": {
               "additionalProperties": true,
               "description": "Represents Google Service Account configuration.\n\nAttributes:\n  type: The type should be \"service_account\".\n  project_id: The project ID.\n  private_key_id: The ID of the private key.\n  private_key: The private key.\n  client_email: The client email.\n  client_id: The client ID.\n  auth_uri: The authorization URI.\n  token_uri: The token URI.\n  auth_provider_x509_cert_url: URL for auth provider's X.509 cert.\n  client_x509_cert_url: URL for the client's X.509 cert.\n  universe_domain: The universe domain.\n\nExample:\n\n    config = ServiceAccountCredential(\n        type_=\"service_account\",\n        project_id=\"your_project_id\",\n        private_key_id=\"your_private_key_id\",\n        private_key=\"-----BEGIN PRIVATE KEY-----...\",\n        client_email=\"...@....iam.gserviceaccount.com\",\n        client_id=\"your_client_id\",\n        auth_uri=\"https://accounts.google.com/o/oauth2/auth\",\n        token_uri=\"https://oauth2.googleapis.com/token\",\n        auth_provider_x509_cert_url=\"https://www.googleapis.com/oauth2/v1/certs\",\n        client_x509_cert_url=\"https://www.googleapis.com/robot/v1/metadata/x509/...\",\n        universe_domain=\"googleapis.com\"\n    )\n\n\n    config = ServiceAccountConfig.model_construct(**{\n        ...service account config dict\n    })",
               "properties": {
                  "type": {
                     "default": "",
                     "title": "Type",
                     "type": "string"
                  },
                  "projectId": {
                     "title": "Projectid",
                     "type": "string"
                  },
                  "privateKeyId": {
                     "title": "Privatekeyid",
                     "type": "string"
                  },
                  "privateKey": {
                     "title": "Privatekey",
                     "type": "string"
                  },
                  "clientEmail": {
                     "title": "Clientemail",
                     "type": "string"
                  },
                  "clientId": {
                     "title": "Clientid",
                     "type": "string"
                  },
                  "authUri": {
                     "title": "Authuri",
                     "type": "string"
                  },
                  "tokenUri": {
                     "title": "Tokenuri",
                     "type": "string"
                  },
                  "authProviderX509CertUrl": {
                     "title": "Authproviderx509Certurl",
                     "type": "string"
                  },
                  "clientX509CertUrl": {
                     "title": "Clientx509Certurl",
                     "type": "string"
                  },
                  "universeDomain": {
                     "title": "Universedomain",
                     "type": "string"
                  }
               },
               "required": [
                  "projectId",
                  "privateKeyId",
                  "privateKey",
                  "clientEmail",
                  "clientId",
                  "authUri",
                  "tokenUri",
                  "authProviderX509CertUrl",
                  "clientX509CertUrl",
                  "universeDomain"
               ],
               "title": "ServiceAccountCredential",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      }

  Fields:

    - `auth_config (AuthConfig | None)`

    - `parameter_binding (Literal['state', 'node_input'])`

  Validators:

  field auth_config: AuthConfig | None = None

    If set, the framework requests user authentication before running.

    When the node runs for the first time and no credential is found in session state, it yields an `adk_request_credential` event and interrupts. On resume, the credential is stored and the node re-runs with the credential available via `AuthHandler(auth_config).get_auth_response(ctx.state)`.

  field parameter_binding: Literal['state', 'node_input'] = 'state'

    How function parameters are bound.

    `'state'` (default) binds parameters from `ctx.state`. `'node_input'` binds parameters from `node_input` dict and infers `input_schema` / `output_schema` from the function signature (used when the node acts as an agent’s tool).

  model_copy(*, update=None, deep=False)
    Return type:

      `FunctionNode`

    !!! abstract “Usage Documentation”

      [model_copy](../concepts/models.md#model-copy)

    Returns a copy of the model.

    !!! note

      The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

    Parameters:

      - update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

      - deep – Set to True to make a deep copy of the model.

    Returns:

      New model instance.

  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.

pydantic model google.adk.workflow.JoinNode

  Bases: `BaseNode`

  A node that waits for all specified predecessors to trigger it before outputting.

  Show JSON schema

      {
         "title": "JoinNode",
         "description": "A node that waits for all specified predecessors to trigger it before\noutputting.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            }
         },
         "$defs": {
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      }

  Fields:

  Validators:

pydantic model google.adk.workflow.Node

  Bases: `BaseNode`

  A node class designed for subclassing.

  Subclasses can directly benefit from advanced flags like parallel_worker by implementing the run_node_impl() method.

  Show JSON schema

      {
         "title": "Node",
         "description": "A node class designed for subclassing.\n\nSubclasses can directly benefit from advanced flags like parallel_worker\nby implementing the run_node_impl() method.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": false,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            },
            "parallel_worker": {
               "default": false,
               "title": "Parallel Worker",
               "type": "boolean"
            }
         },
         "$defs": {
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      }

  Fields:

    - `parallel_worker (bool)`

  Validators:

  field parallel_worker: bool = False
  model_copy(*, update=None, deep=False)

    Clones the node with updated fields.

    Return type:

      `Any`

  model_post_init(_Node__context)

    Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

    Return type:

      `None`

  async run_node_impl(*, ctx, node_input)

    Implement this method when designing a child class that inherits from Node.

    Subclasses can directly benefit from advanced flags like parallel_worker by providing their custom execution logic here.

    Return type:

      `AsyncGenerator`[`Any`, `None`]

exception google.adk.workflow.NodeTimeoutError(*, node_name, timeout)

  Bases: `Exception`

  Raised when a node exceeds its configured timeout.

  This is a regular `Exception` (not `BaseException`) so it is compatible with `retry_config` — a timed-out node can be retried.

pydantic model google.adk.workflow.RetryConfig

  Bases: `BaseModel`

  Configuration for retrying a node.

  Show JSON schema

      {
         "title": "RetryConfig",
         "description": "Configuration for retrying a node.",
         "type": "object",
         "properties": {
            "max_attempts": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
               "title": "Max Attempts"
            },
            "initial_delay": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
               "title": "Initial Delay"
            },
            "max_delay": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
               "title": "Max Delay"
            },
            "backoff_factor": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
               "title": "Backoff Factor"
            },
            "jitter": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
               "title": "Jitter"
            },
            "exceptions": {
               "anyOf": [
                  {
                     "items": {
                        "anyOf": [
                           {
                              "type": "string"
                           },
                           {}
                        ]
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
               "title": "Exceptions"
            }
         }
      }

  Fields:

    - `backoff_factor (float | None)`

    - `exceptions (list[str | type[BaseException]] | None)`

    - `initial_delay (float | None)`

    - `jitter (float | None)`

    - `max_attempts (int | None)`

    - `max_delay (float | None)`

  Validators:

    - `_normalize_exceptions` » `exceptions`

  field backoff_factor: float | None = None

    Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.

  field exceptions: list[str | type[BaseException]] | None = None

    Exceptions to retry on. Accepts exception class names as strings (e.g. `['ValueError']`) or exception classes directly (e.g. `[ValueError]`). `None` means retry on all exceptions.

    Validated by:

      - `_normalize_exceptions`

  field initial_delay: float | None = None

    Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.

  field jitter: float | None = None

    Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.

  field max_attempts: int | None = None

    Maximum number of attempts, including the original request. If 0 or 1, it means no retries. If not specified, default to 5.

  field max_delay: float | None = None

    Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.

pydantic model google.adk.workflow.Workflow

  Bases: `BaseNode`

  A graph-based workflow node.

  _run_impl() IS the graph orchestration loop: - SETUP: build graph, seed triggers - LOOP: schedule ready nodes via NodeRunner, handle completions - FINALIZE: collect terminal outputs

  Show JSON schema

      {
         "title": "Workflow",
         "description": "A graph-based workflow node.\n\n_run_impl() IS the graph orchestration loop:\n- SETUP: build graph, seed triggers\n- LOOP: schedule ready nodes via NodeRunner, handle completions\n- FINALIZE: collect terminal outputs",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "description": {
               "default": "",
               "title": "Description",
               "type": "string"
            },
            "rerun_on_resume": {
               "default": true,
               "title": "Rerun On Resume",
               "type": "boolean"
            },
            "wait_for_output": {
               "default": false,
               "title": "Wait For Output",
               "type": "boolean"
            },
            "retry_config": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RetryConfig"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Timeout"
            },
            "input_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Input Schema"
            },
            "output_schema": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "$ref": "#/$defs/Schema"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Output Schema"
            },
            "state_schema": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "State Schema"
            },
            "edges": {
               "description": "Edges to build the workflow graph.",
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/Edge"
                     },
                     {
                        "items": {
                           "anyOf": [
                              {
                                 "$ref": "#/$defs/BaseNode"
                              },
                              {
                                 "const": "START",
                                 "type": "string"
                              },
                              {
                                 "items": {
                                    "anyOf": [
                                       {
                                          "$ref": "#/$defs/BaseNode"
                                       },
                                       {
                                          "const": "START",
                                          "type": "string"
                                       }
                                    ]
                                 },
                                 "type": "array"
                              },
                              {
                                 "additionalProperties": {
                                    "anyOf": [
                                       {
                                          "$ref": "#/$defs/BaseNode"
                                       },
                                       {
                                          "const": "START",
                                          "type": "string"
                                       },
                                       {
                                          "items": {
                                             "anyOf": [
                                                {
                                                   "$ref": "#/$defs/BaseNode"
                                                },
                                                {
                                                   "const": "START",
                                                   "type": "string"
                                                }
                                             ]
                                          },
                                          "type": "array"
                                       }
                                    ]
                                 },
                                 "type": "object"
                              }
                           ]
                        },
                        "type": "array"
                     }
                  ]
               },
               "title": "Edges",
               "type": "array"
            },
            "max_concurrency": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Max Concurrency"
            },
            "graph": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Graph"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The compiled workflow graph."
            }
         },
         "$defs": {
            "BaseNode": {
               "description": "A base class for all nodes in the workflow graph.",
               "properties": {
                  "name": {
                     "title": "Name",
                     "type": "string"
                  },
                  "description": {
                     "default": "",
                     "title": "Description",
                     "type": "string"
                  },
                  "rerun_on_resume": {
                     "default": false,
                     "title": "Rerun On Resume",
                     "type": "boolean"
                  },
                  "wait_for_output": {
                     "default": false,
                     "title": "Wait For Output",
                     "type": "boolean"
                  },
                  "retry_config": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/RetryConfig"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null
                  },
                  "timeout": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Timeout"
                  },
                  "input_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Input Schema"
                  },
                  "output_schema": {
                     "anyOf": [
                        {
                           "additionalProperties": true,
                           "type": "object"
                        },
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "Output Schema"
                  },
                  "state_schema": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "title": "State Schema"
                  }
               },
               "required": [
                  "name"
               ],
               "title": "BaseNode",
               "type": "object"
            },
            "Edge": {
               "additionalProperties": false,
               "description": "An edge in the workflow graph.",
               "properties": {
                  "from_node": {
                     "$ref": "#/$defs/BaseNode"
                  },
                  "to_node": {
                     "$ref": "#/$defs/BaseNode"
                  },
                  "route": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "integer"
                        },
                        {
                           "type": "string"
                        },
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "boolean"
                                 },
                                 {
                                    "type": "integer"
                                 },
                                 {
                                    "type": "string"
                                 }
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "The route(s) that this edge is associated with. A single value or a list of values. The edge is followed when the emitted route matches any value in the list.",
                     "title": "Route"
                  }
               },
               "required": [
                  "from_node",
                  "to_node"
               ],
               "title": "Edge",
               "type": "object"
            },
            "Graph": {
               "additionalProperties": false,
               "description": "A workflow graph.",
               "properties": {
                  "nodes": {
                     "items": {
                        "$ref": "#/$defs/BaseNode"
                     },
                     "title": "Nodes",
                     "type": "array"
                  },
                  "edges": {
                     "items": {
                        "$ref": "#/$defs/Edge"
                     },
                     "title": "Edges",
                     "type": "array"
                  }
               },
               "title": "Graph",
               "type": "object"
            },
            "RetryConfig": {
               "description": "Configuration for retrying a node.",
               "properties": {
                  "max_attempts": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum number of attempts, including the original request.\n      If 0 or 1, it means no retries. If not specified, default to 5.",
                     "title": "Max Attempts"
                  },
                  "initial_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.",
                     "title": "Initial Delay"
                  },
                  "max_delay": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.",
                     "title": "Max Delay"
                  },
                  "backoff_factor": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.",
                     "title": "Backoff Factor"
                  },
                  "jitter": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Randomness factor for the delay. If not specified, default to 1.0. Otherwise use 0.0 to remove randomness.",
                     "title": "Jitter"
                  },
                  "exceptions": {
                     "anyOf": [
                        {
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "string"
                                 },
                                 {}
                              ]
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Exceptions to retry on. Accepts exception class names as\n      strings (e.g. ``['ValueError']``) or exception classes directly (e.g.\n      ``[ValueError]``). ``None`` means retry on all exceptions.",
                     "title": "Exceptions"
                  }
               },
               "title": "RetryConfig",
               "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": {
                  "additionalProperties": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Can either be a boolean or an object; controls the presence of additional properties.",
                     "title": "Additionalproperties"
                  },
                  "defs": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.",
                     "title": "Defs"
                  },
                  "ref": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named \"Pet\": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the \"pet\" property is a reference to the schema node named \"Pet\". See details in https://json-schema.org/understanding-json-schema/structuring",
                     "title": "Ref"
                  },
                  "anyOf": {
                     "anyOf": [
                        {
                           "items": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.",
                     "title": "Anyof"
                  },
                  "default": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Default value to use if the field is not specified.",
                     "title": "Default"
                  },
                  "description": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.",
                     "title": "Description"
                  },
                  "enum": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`",
                     "title": "Enum"
                  },
                  "example": {
                     "anyOf": [
                        {},
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Example of an instance of this schema.",
                     "title": "Example"
                  },
                  "format": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.",
                     "title": "Format"
                  },
                  "items": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Schema"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array."
                  },
                  "maxItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.",
                     "title": "Maxitems"
                  },
                  "maxLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.",
                     "title": "Maxlength"
                  },
                  "maxProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.",
                     "title": "Maxproperties"
                  },
                  "maximum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.",
                     "title": "Maximum"
                  },
                  "minItems": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.",
                     "title": "Minitems"
                  },
                  "minLength": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.",
                     "title": "Minlength"
                  },
                  "minProperties": {
                     "anyOf": [
                        {
                           "type": "integer"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.",
                     "title": "Minproperties"
                  },
                  "minimum": {
                     "anyOf": [
                        {
                           "type": "number"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.",
                     "title": "Minimum"
                  },
                  "nullable": {
                     "anyOf": [
                        {
                           "type": "boolean"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Indicates if the value of this field can be null.",
                     "title": "Nullable"
                  },
                  "pattern": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.",
                     "title": "Pattern"
                  },
                  "properties": {
                     "anyOf": [
                        {
                           "additionalProperties": {
                              "$ref": "#/$defs/Schema"
                           },
                           "type": "object"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.",
                     "title": "Properties"
                  },
                  "propertyOrdering": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.",
                     "title": "Propertyordering"
                  },
                  "required": {
                     "anyOf": [
                        {
                           "items": {
                              "type": "string"
                           },
                           "type": "array"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.",
                     "title": "Required"
                  },
                  "title": {
                     "anyOf": [
                        {
                           "type": "string"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Title for the schema.",
                     "title": "Title"
                  },
                  "type": {
                     "anyOf": [
                        {
                           "$ref": "#/$defs/Type"
                        },
                        {
                           "type": "null"
                        }
                     ],
                     "default": null,
                     "description": "Optional. Data type of the schema field."
                  }
               },
               "title": "Schema",
               "type": "object"
            },
            "Type": {
               "description": "Data type of the schema field.",
               "enum": [
                  "TYPE_UNSPECIFIED",
                  "STRING",
                  "NUMBER",
                  "INTEGER",
                  "BOOLEAN",
                  "ARRAY",
                  "OBJECT",
                  "NULL"
               ],
               "title": "Type",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      }

  Fields:

    - `edges (list[EdgeItem])`

    - `graph (Graph | None)`

    - `max_concurrency (int | None)`

    - `rerun_on_resume (bool)`

  Validators:

  field edges: list[EdgeItem] [Optional]

    Edges to build the workflow graph.

  field graph: Graph | None = None

    The compiled workflow graph.

  field max_concurrency: int | None = None

    Maximum parallel graph-scheduled nodes. None means unlimited.

    Only applies to nodes triggered by graph edges. Dynamic nodes (via ctx.run_node()) are excluded — they are awaited inline by their parent and throttling them would cause deadlock.

  field rerun_on_resume: bool = True

    Controls behavior when resuming after an interrupt.

    If True, the node reruns from scratch. If False, it completes immediately using the user’s resuming input as the node’s output.

  model_post_init(context)

    Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

    Return type:

      `None`

google.adk.workflow.node(node_like=None, *, name=None, rerun_on_resume=None, retry_config=None, timeout=None, parallel_worker=False, auth_config=None)

  Decorator or function to wrap a NodeLike in a node or override its properties.

  This can be used as a decorator on a function: @node async def my_func(): …

  @node() async def my_func2(): …

  @node(name=’my_node’, rerun_on_resume=True) async def my_func3(): …

  Or as a function on a NodeLike: my_node = node(my_func, name=’other_name’)

  Return type:

    `Any`

  Parameters:

    - node_like – The item to be wrapped as a node. Can be a BaseNode, BaseAgent, BaseTool, or callable.

    - name – If provided, overrides the name of the wrapped node.

    - rerun_on_resume – If provided, overrides the rerun_on_resume property of the wrapped node.

    - retry_config – If provided, overrides the retry_config property of the wrapped node.

    - timeout – If provided, overrides the timeout property of the wrapped node.

    - parallel_worker – If True, wraps the node in a _ParallelWorker.

    - auth_config – If provided, the framework requests user authentication before running the node. Requires rerun_on_resume=True.

  Returns:

    If used as a decorator factory (@node() or @node(…)), returns a decorator. If used as a decorator (@node) or function (node(node_like, …)), returns a BaseNode instance.