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
CustomAgentBuilder
GuardrailSetNon-guardrails
Placeholder type when guardrails feature is disabled
LlmAgent
LlmAgentBuilder
LlmConditionalAgent
LLM-based intelligent conditional routing agent.
LlmConditionalAgentBuilder
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

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).