gitdataai/libs/agent/tool/mod.rs
ZhenYi 10c0cc007b refactor(agent): split into submodules and add Qdrant embedding
- Split agent crate into client/, model/, agent/ subdirs
- Add billing.rs for token usage recording
- Add sync.rs for upstream model sync
- EmbedService: Qdrant-backed vector memory for semantic search
- ChatService: wire EmbedService for memory lookup, passive skill awareness
- ReAct loop: streamline with tokio::select! and proper error handling
2026-04-25 20:09:33 +08:00

32 lines
1.1 KiB
Rust

//! Unified function call routing for AI agents.
//!
//! Provides a type-safe, request-scoped tool registry and executor.
//!
//! # Architecture
//!
//! - [`definition`](definition) — Tool schemas: name, description, parameter JSON schema
//! - [`registry`](registry) — Request-scoped `ToolRegistry` mapping names → handlers
//! - [`call`](call) — Execution types: `ToolCall`, `ToolResult`, `ToolError`
//! - [`context`](context) — Execution context passed to each tool handler
//! - [`executor`](executor) — `ToolExecutor` coordinating lookup → execute → result
//! - [`rig_adapter`](rig_adapter) — Adapter to bridge with rig's Tool trait
//! - [`examples`](examples) — `#[tool]` macro usage guide
pub mod call;
pub mod context;
pub mod definition;
pub mod executor;
pub mod registry;
#[cfg(feature = "rig")]
pub mod rig_adapter;
#[cfg(test)]
mod examples;
pub use call::{ToolCall, ToolCallResult, ToolError, ToolResult};
pub use context::ToolContext;
pub use definition::{ToolDefinition, ToolParam, ToolSchema};
pub use executor::ToolExecutor;
pub use registry::{ToolHandler, ToolRegistry};