rskit_agent/agent/definition.rs
1use std::sync::Arc;
2
3use rskit_llm::provider::Provider;
4
5use crate::config::AgentConfig;
6
7/// A multi-turn agentic loop that drives an LLM provider, executes tool calls,
8/// and emits hook events at each lifecycle point.
9pub struct Agent {
10 pub(super) provider: Arc<dyn Provider>,
11 pub(super) config: AgentConfig,
12}
13
14impl Agent {
15 /// Create a new agent with the given provider and configuration.
16 pub fn new(provider: Arc<dyn Provider>, config: AgentConfig) -> Self {
17 Self { provider, config }
18 }
19
20 /// Create a new agent with the locked default configuration.
21 pub fn with_defaults(provider: Arc<dyn Provider>) -> Self {
22 Self::new(provider, AgentConfig::default())
23 }
24}