Expand description
Agent module - event-driven AI agent implementation.
Provides Agent struct with streaming responses, tool execution, and event output.
§Module Structure (Refactoring in Progress)
The agent module is being refactored to improve separation of concerns:
Current Structure (will be phased out):
builder.rs: Agent builder patternhelpers.rs: Helper functions and utilitiesrun.rs: Main execution loop (716 lines, to be simplified)streaming.rs: Streaming response handlingtools.rs: Tool execution logictypes.rs: Agent struct definition (26 fields, to be split)
New Structure (being introduced in phases):
core/: Core configuration and state managementconfig.rs: Configuration constants (max iterations, retries, etc.)state.rs: State management (messages, tokens) - Phase 3executor.rs: Execution engine - Phase 7
context/: Context managementmanager.rs: Context manager - Phase 4
session/: Session managementmanager.rs: Session manager - Phase 6
tests/: Comprehensive test coverage
Re-exports§
pub use core::AgentConfig;pub use core::AgentState;pub use context::AgentContext;pub use session::SessionManager;
Modules§
Structs§
- Agent
- MAX_ITERATIONS Documentation:
- Agent
Builder - Agent builder
- Context
Info - Context information for display