Skip to main content

Module agent

Module agent 

Source
Available on crate feature agents only.
Expand description

Agent implementations (LLM, Custom, Workflow agents).

Provides the core agent types:

Available with feature: agents

Modules§

compaction
LLM-based event summarizer for context compaction.
guardrails
Guardrail integration for LlmAgent
tool_call_markup
XML-based tool call markup parsing.

Structs§

ConditionalAgent
Rule-based conditional routing agent.
CustomAgent
An agent with a user-defined async handler function.
CustomAgentBuilder
Builder for constructing a CustomAgent.
GuardrailSetNon-guardrails
Placeholder type when guardrails feature is disabled
LlmAgent
An LLM-powered agent that orchestrates tool calls and sub-agent delegation.
LlmAgentBuilder
Builder for constructing an LlmAgent with all configuration options.
LlmConditionalAgent
LLM-based intelligent conditional routing agent.
LlmConditionalAgentBuilder
Builder for constructing an LlmConditionalAgent.
LlmEventSummarizer
An LLM-based event summarizer for sliding window compaction.
LoopAgent
Loop agent executes sub-agents repeatedly for N iterations or until escalation
ParallelAgent
Parallel agent executes sub-agents concurrently
SequentialAgent
Sequential agent executes sub-agents once in order

Constants§

DEFAULT_LOOP_MAX_ITERATIONS
Default maximum iterations for LoopAgent when none is specified. Prevents infinite loops from consuming unbounded resources.
DEFAULT_MAX_ITERATIONS
Default maximum number of LLM round-trips (iterations) before the agent stops.
DEFAULT_TOOL_TIMEOUT
Default tool execution timeout (5 minutes).

Traits§

Agent
The fundamental trait for all ADK agents.

Functions§

normalize_content
Normalize content by converting tool call markup in text parts to FunctionCall parts.
normalize_option_content
Normalize Option<Content> by converting tool call markup.

Type Aliases§

AfterToolCallbackFull
Rich after-tool callback that receives the tool, arguments, and response.
OnToolErrorCallback
Callback invoked when a tool execution fails (after retries are exhausted).