Skip to main content

Crate lellm_agent

Crate lellm_agent 

Source
Expand description

lellm-agent — Agent 运行时。

提供完整的 Agent 运行时能力:工具系统、Agent Loop、 循环检测、重试策略、Fallback 降级等。

Re-exports§

pub use hook::AgentHook;
pub use hook::AgentHookContext;
pub use hook::AgentHookSnapshot;
pub use hook::NoOpAgentHook;
pub use hook::TracingAgentHook;
pub use runtime::AgentBuilder;
pub use runtime::AgentEvent;
pub use runtime::AgentFlowNode;
pub use runtime::AgentStream;
pub use runtime::BackoffStrategy;
pub use runtime::BatchExecutionResult;
pub use runtime::CompactionResult;
pub use runtime::CompositeCatalog;
pub use runtime::ContextBudget;
pub use runtime::ContextCompactor;
pub use runtime::DefaultFallback;
pub use runtime::FallbackAction;
pub use runtime::FallbackContext;
pub use runtime::FallbackStrategy;
pub use runtime::LocalCompactor;
pub use runtime::ParallelSafety;
pub use runtime::ResolvedRound;
pub use runtime::RetryPolicy;
pub use runtime::StaticCatalog;
pub use runtime::StopReason;
pub use runtime::ToolArgs;
pub use runtime::ToolCatalog;
pub use runtime::ToolCategory;
pub use runtime::ToolExecutor;
pub use runtime::ToolRegistration;
pub use runtime::ToolSnapshot;
pub use runtime::ToolUseConfig;
pub use runtime::ToolUseDeps;
pub use runtime::ToolUseLoop;
pub use runtime::ToolUseResult;
pub use runtime::estimate_message;
pub use runtime::estimate_tokens;
pub use runtime::execute_batch_with;
pub use schemars;
pub use serde;

Modules§

hook
Agent-level Hook — AgentLoop 执行扩展点。
runtime
Agent 运行时 — 编排循环、防御机制、工具系统。

Structs§

ResolvedModel
解析后的模型 — 从 Registry 中解析 RouteEntry 得到
ToolError
工具执行错误 — 携带错误分类与详细描述。

Enums§

ToolErrorKind
工具执行错误的分类。

Traits§

IntoToolError
将已知错误类型转换为 ToolError
IntoToolResult
将工具函数返回值统一转换为 ToolResult

Functions§

create_agent
便捷创建 Agent — 生态包糖衣 API 原型。
create_agent_full
完整配置的便捷创建。
create_agent_with_system
快速创建带系统提示的 Agent。
create_agent_with_tools
快速创建带工具的 Agent。

Type Aliases§

ToolResult
工具执行结果 — serde_json::Value 支持结构化数据。