The config for the YAML schema to create an agent.
The config for the YAML schema of a LlmAgent.
No Additional PropertiesThe value is used to uniquely identify the LlmAgent class. If it is empty, it is by default an LlmAgent.
Required. The name of the agent.
Optional. The description of the agent.
Optional. The sub-agents of the agent.
The config for the reference to another agent.
No Additional PropertiesOptional. The beforeagentcallbacks of the agent.
Example:
before_agent_callbacks:
- name: my_library.security_callbacks.before_agent_callback
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
No Additional PropertiesAn argument passed to a function or a class's constructor.
No Additional PropertiesOptional. The afteragentcallbacks of the agent.
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
Same definition as CodeConfigOptional. LlmAgent.model. If not set, the model will be inherited from the ancestor.
Required. LlmAgent.instruction.
Optional. LlmAgent.disallowtransferto_parent.
Optional. LlmAgent.disallowtransferto_peers.
Optional. LlmAgent.input_schema.
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
Same definition as CodeConfigOptional. LlmAgent.output_schema.
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
Same definition as CodeConfigOptional. LlmAgent.output_key.
Optional. LlmAgent.include_contents.
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
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:
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
For user-defined tool instances, the name is the fully qualified path
to the tool instance.
tools:
- name: my_package.my_module.my_tool
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
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:
...
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.
The args for the tool.
Config to host free key-value pairs for the args in ToolConfig.
Additional Properties of any type are allowed.
Type: objectOptional. LlmAgent.beforemodelcallbacks.
Example:
before_model_callbacks:
- name: my_library.callbacks.before_model_callback
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
Same definition as CodeConfigOptional. LlmAgent.aftermodelcallbacks.
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
Same definition as CodeConfigOptional. LlmAgent.beforetoolcallbacks.
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
Same definition as CodeConfigOptional. LlmAgent.aftertoolcallbacks.
Code reference config for a variable, a function, or a class.
This config is used for configuring callbacks and tools.
Same definition as CodeConfigOptional. LlmAgent.generatecontentconfig.
Optional model configuration parameters.
For more information, see Content generation parameters
<https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>_.
Used to override HTTP request options.
HTTP options to be used in each of the requests.
No Additional PropertiesThe base URL for the AI platform service endpoint.
Specifies the version of the API to use.
Additional HTTP headers to be sent with the request.
Each additional property must conform to the following schema
Type: stringTimeout for the request in milliseconds.
Args passed to the HTTP client.
Additional Properties of any type are allowed.
Type: objectArgs passed to the async HTTP client.
Additional Properties of any type are allowed.
Type: objectExtra 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
Additional Properties of any type are allowed.
Type: objectHTTP retry options for the request.
HTTP retry options to be used in each of the requests.
No Additional PropertiesMaximum number of attempts, including the original request.
If 0 or 1, it means no retries.
Initial delay before the first retry, in fractions of a second.
Maximum delay between retries, in fractions of a second.
Multiplier by which the delay increases after each attempt.
Randomness factor for the delay.
List of HTTP status codes that should trigger a retry.
If not specified, a default set of retryable codes may be used.
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".
Contains the multi-part content of a message.
No Additional PropertiesList of parts that constitute a single message. Each part may have
a different IANA MIME type.
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.
Metadata for a given video.
Describes how the video in the Part should be used by the model.
No Additional PropertiesThe frame rate of the video sent to the model. If not specified, the
default value will be 1.0. The fps range is (0.0, 24.0].
Optional. The end offset of the video.
Optional. The start offset of the video.
Indicates if the part is thought from the model.
Optional. Inlined bytes data.
Content blob.
No Additional PropertiesOptional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.
Required. Raw bytes.
Required. The IANA standard MIME type of the source data.
Optional. URI based data.
URI based data.
No Additional PropertiesOptional. Display name of the file data. Used to provide a label or filename to distinguish file datas. It is not currently used in the Gemini GenerateContent calls.
Required. URI.
Required. The IANA standard MIME type of the source data.
An opaque signature for the thought so it can be reused in subsequent requests.
Optional. Result of executing the [ExecutableCode].
Result of executing the [ExecutableCode].
Only generated when using the [CodeExecution] tool, and always follows a
part containing the [ExecutableCode].
Required. Outcome of the code execution.
Required. Outcome of the code execution.
Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
Optional. Code generated by the model that is meant to be executed.
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.
Required. The code to be executed.
Required. Programming language of the code.
Required. Programming language of the code.
Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
A function call.
No Additional PropertiesThe unique id of the function call. If populated, the client to execute the
function_call and return the response with the matching id.
Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
Additional Properties of any type are allowed.
Type: objectRequired. The name of the function to call. Matches [FunctionDeclaration.name].
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.
A function response.
No Additional PropertiesSignals 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.
Specifies how the response should be scheduled in the conversation. Only applicable to NONBLOCKING function calls, is ignored otherwise. Defaults to WHENIDLE.
Specifies how the response should be scheduled in the conversation.
Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call id.
Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
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.
Additional Properties of any type are allowed.
Type: objectOptional. Text part (can be code).
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.
A file uploaded to the API.
No Additional PropertiesThe 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
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'
Output only. MIME type of the file.
Output only. Size of the file in bytes.
Output only. The timestamp of when the File was created.
Output only. The timestamp of when the File will be deleted. Only set if the File is scheduled to expire.
Output only. The timestamp of when the File was last updated.
Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format.
Output only. The URI of the File.
Output only. The URI of the File, only set for downloadable (generated) files.
Output only. Processing state of the File.
State for the lifecycle of a File.