pub struct AgentRunner {
pub tools: Arc<RwLock<Vec<Arc<dyn Tool>>>>,
pub system_prompt: Arc<RwLock<String>>,
pub skills: Arc<RwLock<Vec<Skill>>>,
pub steering_queue: Arc<Mutex<Vec<String>>>,
pub agent_config: AgentConfig,
/* private fields */
}Fields§
§tools: Arc<RwLock<Vec<Arc<dyn Tool>>>>§system_prompt: Arc<RwLock<String>>§skills: Arc<RwLock<Vec<Skill>>>§steering_queue: Arc<Mutex<Vec<String>>>§agent_config: AgentConfigImplementations§
Source§impl AgentRunner
impl AgentRunner
pub fn new( provider: Arc<dyn Provider>, tools: Vec<Arc<dyn Tool>>, memory: Arc<dyn MemoryBackend>, system_prompt: impl Into<String>, model: impl Into<String>, ) -> Self
pub fn set_stream_sink(&self, tx: Option<AgentStreamTx>)
Sourcepub fn stream_sink(&self) -> Option<AgentStreamTx>
pub fn stream_sink(&self) -> Option<AgentStreamTx>
The sink events go to: the per-turn sink of the current task if one is scoped, otherwise the process-wide sink.
pub fn with_config(self, config: AgentConfig) -> Self
pub fn with_mode(self, mode: AgentMode) -> Self
pub async fn with_plugin_registry(self, registry: PluginRegistry) -> Self
pub fn with_compactor(self, compactor: Arc<dyn Compactor>) -> Self
pub fn get_mode(&self) -> AgentMode
pub fn set_mode(&self, mode: AgentMode)
pub fn mode_handle(&self) -> Arc<RwLock<AgentMode>> ⓘ
pub fn add_hook(&self, hook: Arc<dyn ToolHook>)
pub fn steer(&self, message: String)
pub fn with_workspace(self, workspace: PathBuf) -> Self
pub fn with_memory_ideas(self, cfg: MemoryIdeasConfig) -> Self
pub fn with_group_chat(self, cfg: GroupChatConfig) -> Self
pub fn with_zkr(self, store: Option<Arc<ZkrStore>>, cfg: ZkrConfig) -> Self
pub async fn with_skills(self, skills: Vec<Skill>) -> Self
pub fn cost_tracker(&self) -> Arc<CostTracker> ⓘ
pub async fn get_cost_summary(&self) -> CostSummary
Sourcepub fn provider_name(&self) -> &str
pub fn provider_name(&self) -> &str
The name of the provider currently backing model calls.
Sourcepub fn memory(&self) -> &Arc<dyn MemoryBackend> ⓘ
pub fn memory(&self) -> &Arc<dyn MemoryBackend> ⓘ
The conversation store, for callers that need to read or clear history.
pub fn get_model(&self) -> String
pub fn get_default_model(&self) -> &str
pub fn set_model(&self, model: impl Into<String>)
pub fn reset_model(&self)
pub async fn list_tools(&self) -> Vec<String>
pub async fn add_tool(&self, tool: Arc<dyn Tool>)
Sourcepub fn hook_manager(&self) -> &Arc<HookManager> ⓘ
pub fn hook_manager(&self) -> &Arc<HookManager> ⓘ
Access the hook manager (for plugin tool registration)
Sourcepub fn plugin_registry(&self) -> &Arc<RwLock<PluginRegistry>> ⓘ
pub fn plugin_registry(&self) -> &Arc<RwLock<PluginRegistry>> ⓘ
Get the plugin registry
pub async fn deploy_coding_swarm( self: Arc<Self>, tasks: Vec<String>, base_chat_id: &str, parallelism: usize, ) -> Vec<(String, String)>
pub async fn run(&self, channel: &mut dyn Channel) -> Result<()>
pub async fn run_with_extra_rx( &self, channel: &mut dyn Channel, extra_rx: Receiver<IncomingMessage>, ) -> Result<()>
pub async fn run_with_runtime_rx( &self, channel: &mut dyn Channel, extra_rx: Receiver<IncomingMessage>, cron_rx: Receiver<DueJob>, scheduler: Arc<CronScheduler>, ) -> Result<()>
pub async fn handle_message( &self, msg: &IncomingMessage, channel: &dyn Channel, ) -> Result<String>
pub async fn handle_message_with_model( &self, msg: &IncomingMessage, channel: &dyn Channel, model: Option<&str>, ) -> Result<String>
Sourcepub async fn get_trajectory(&self, chat_id: &str) -> Option<Trajectory>
pub async fn get_trajectory(&self, chat_id: &str) -> Option<Trajectory>
Get trajectory for a chat (for export)
Sourcepub async fn get_all_trajectories(&self) -> Vec<Trajectory>
pub async fn get_all_trajectories(&self) -> Vec<Trajectory>
Get all trajectories
Auto Trait Implementations§
impl !Freeze for AgentRunner
impl !RefUnwindSafe for AgentRunner
impl !UnwindSafe for AgentRunner
impl Send for AgentRunner
impl Sync for AgentRunner
impl Unpin for AgentRunner
impl UnsafeUnpin for AgentRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more