AgentConfig


The config for the YAML schema to create an agent.

LlmAgentConfig

Type: object

The config for the YAML schema of a LlmAgent.

No Additional Properties

Agent Class

Type: enum (of string) Default: "LlmAgent"

The value is used to uniquely identify the LlmAgent class. If it is empty, it is by default an LlmAgent.

Must be one of:

  • "LlmAgent"
  • ""

Name

Type: string

Required. The name of the agent.

Description

Type: string Default: ""

Optional. The description of the agent.

Sub Agents

Default: null

Optional. The sub-agents of the agent.

Type: array
No Additional Items

Each item of this array must be:

Before Agent Callbacks

Default: null

Optional. The beforeagentcallbacks of the agent.

Example:

before_agent_callbacks:
  - name: my_library.security_callbacks.before_agent_callback

Type: array
No Additional Items

Each item of this array must be:

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

No Additional Properties

After Agent Callbacks

Default: null

Optional. The afteragentcallbacks of the agent.

Type: array
No Additional Items

Each item of this array must be:

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

Same definition as CodeConfig

Model

Default: null

Optional. LlmAgent.model. If not set, the model will be inherited from the ancestor.

Instruction

Type: string

Required. LlmAgent.instruction.

Disallow Transfer To Parent

Default: null

Optional. LlmAgent.disallowtransferto_parent.

Disallow Transfer To Peers

Default: null

Optional. LlmAgent.disallowtransferto_peers.

Default: null

Optional. LlmAgent.input_schema.

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

Same definition as CodeConfig

Default: null

Optional. LlmAgent.output_schema.

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

Same definition as CodeConfig

Output Key

Default: null

Optional. LlmAgent.output_key.

Include Contents

Type: enum (of string) Default: "default"

Optional. LlmAgent.include_contents.

Must be one of:

  • "default"
  • "none"

Tools

Default: null

Optional. LlmAgent.tools.

Examples:

For ADK built-in tools in google.adk.tools package, they can be referenced
directly with the name:

tools:
  - name: google_search
  - name: load_memory

For user-defined tools, they can be referenced with fully qualified name:

tools:
  - name: my_library.my_tools.my_tool

For tools that needs to be created via functions:

tools:
  - name: my_library.my_tools.create_tool
    args:
      - name: param1
        value: value1
      - name: param2
        value: value2

For more advanced tools, instead of specifying arguments in config, it's
recommended to define them in Python files and reference them. E.g.,

# tools.py
my_mcp_toolset = MCPToolset(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@notionhq/notion-mcp-server"],
        env={"OPENAPI_MCP_HEADERS": NOTION_HEADERS},
    )
)

Then, reference the toolset in config:

tools:
  - name: tools.my_mcp_toolset

Type: array
No Additional Items

Each item of this array must be:

ToolConfig

Type: object

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.

No Additional Properties

Name

Type: string

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.

Default: null

The args for the tool.

ToolArgsConfig

Type: object

Config to host free key-value pairs for the args in ToolConfig.

Additional Properties of any type are allowed.

Type: object

Before Model Callbacks

Default: null

Optional. LlmAgent.beforemodelcallbacks.

Example:

before_model_callbacks:
  - name: my_library.callbacks.before_model_callback

Type: array
No Additional Items

Each item of this array must be:

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

Same definition as CodeConfig

After Model Callbacks

Default: null

Optional. LlmAgent.aftermodelcallbacks.

Type: array
No Additional Items

Each item of this array must be:

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

Same definition as CodeConfig

Before Tool Callbacks

Default: null

Optional. LlmAgent.beforetoolcallbacks.

Type: array
No Additional Items

Each item of this array must be:

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

Same definition as CodeConfig

After Tool Callbacks

Default: null

Optional. LlmAgent.aftertoolcallbacks.

Type: array
No Additional Items

Each item of this array must be:

CodeConfig

Type: object

Code reference config for a variable, a function, or a class.

This config is used for configuring callbacks and tools.

Same definition as CodeConfig

Default: null

Optional. LlmAgent.generatecontentconfig.

GenerateContentConfig

Type: object

Optional model configuration parameters.

For more information, see Content generation parameters <https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>_.

No Additional Properties

Default: null

Used to override HTTP request options.

HttpOptions

Type: object

HTTP options to be used in each of the requests.

No Additional Properties

Extrabody

Default: null

Extra parameters to add to the request body.
The structure must match the backend API's request structure.
- VertexAI backend API docs: https://cloud.google.com/vertex-ai/docs/reference/rest
- GeminiAPI backend API docs: https://ai.google.dev/api/rest

Default: null

HTTP retry options for the request.

HttpRetryOptions

Type: object

HTTP retry options to be used in each of the requests.

No Additional Properties

Systeminstruction

Default: null

Instructions for the model to steer it toward better performance.
For example, "Answer as concisely as possible" or "Don't use technical
terms in your response".

Content

Type: object

Contains the multi-part content of a message.

No Additional Properties

Parts

Default: null

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

Type: array
No Additional Items

Each item of this array must be:

Part

Type: object

A datatype containing media content.

Exactly one field within a Part should be set, representing the specific type
of content being conveyed. Using multiple fields within the same Part
instance is considered invalid.

No Additional Properties

Default: null

Metadata for a given video.

VideoMetadata

Type: object

Describes how the video in the Part should be used by the model.

No Additional Properties

Default: null

Optional. Inlined bytes data.

Blob

Type: object

Content blob.

No Additional Properties

Default: null

Optional. URI based data.

FileData

Type: object

URI based data.

No Additional Properties

Default: null

Optional. Result of executing the [ExecutableCode].

CodeExecutionResult

Type: object

Result of executing the [ExecutableCode].

Only generated when using the [CodeExecution] tool, and always follows a
part containing the [ExecutableCode].

No Additional Properties

Default: null

Optional. Code generated by the model that is meant to be executed.

ExecutableCode

Type: object

Code generated by the model that is meant to be executed, and the result returned to the model.

Generated when using the [CodeExecution] tool, in which the code will be
automatically executed, and a corresponding [CodeExecutionResult] will also be
generated.

No Additional Properties

Default: null

Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.

FunctionCall

Type: object

A function call.

No Additional Properties

Default: null

Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.

FunctionResponse

Type: object

A function response.

No Additional Properties

Willcontinue

Default: null

Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NONBLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NONBLOCKING 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.

Default: null

Specifies how the response should be scheduled in the conversation. Only applicable to NONBLOCKING function calls, is ignored otherwise. Defaults to WHENIDLE.

Role

Default: null

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

Type: array
No Additional Items

Each item of this array must be:


File

Type: object

A file uploaded to the API.

No Additional Properties

Name

Default: null

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