pub struct RuntimeAgent { /* private fields */ }Implementations§
Source§impl RuntimeAgent
impl RuntimeAgent
pub fn new( info: AgentInfo, llm_registry: Arc<LLMRegistry>, memory: Arc<dyn Memory>, tools: Arc<ToolRegistry>, skills: Vec<SkillDefinition>, system_prompt: String, max_iterations: u32, ) -> RuntimeAgent
pub fn with_declared_tool_ids(self, ids: Option<Vec<String>>) -> RuntimeAgent
pub fn with_storage_config(self, config: StorageConfig) -> RuntimeAgent
pub fn with_storage(self, storage: Arc<dyn AgentStorage>) -> RuntimeAgent
pub fn with_reasoning(self, config: ReasoningConfig) -> RuntimeAgent
pub fn with_reflection(self, config: ReflectionConfig) -> RuntimeAgent
pub fn reasoning_config(&self) -> &ReasoningConfig
pub fn reflection_config(&self) -> &ReflectionConfig
pub fn with_persona(self, manager: Arc<PersonaManager>) -> RuntimeAgent
pub fn persona_manager(&self) -> Option<&Arc<PersonaManager>>
pub fn with_disambiguation(self, config: DisambiguationConfig) -> RuntimeAgent
pub fn disambiguation_manager(&self) -> Option<&DisambiguationManager>
pub fn has_disambiguation(&self) -> bool
pub async fn init_storage(&self) -> Result<(), AgentError>
pub fn storage(&self) -> Option<Arc<dyn AgentStorage>>
pub fn storage_config(&self) -> &StorageConfig
Sourcepub fn spawner(&self) -> Option<&Arc<AgentSpawner>>
pub fn spawner(&self) -> Option<&Arc<AgentSpawner>>
Returns the spawner if configured via a spawner: YAML section.
Sourcepub fn spawner_registry(&self) -> Option<&Arc<AgentRegistry>>
pub fn spawner_registry(&self) -> Option<&Arc<AgentRegistry>>
Returns the agent registry if configured via a spawner: YAML section.
pub fn has_spawner(&self) -> bool
pub fn with_spawner_handles( self, spawner: Arc<AgentSpawner>, registry: Arc<AgentRegistry>, ) -> RuntimeAgent
pub fn with_hooks(self, hooks: Arc<dyn AgentHooks>) -> RuntimeAgent
pub fn with_parallel_tools(self, config: ParallelToolsConfig) -> RuntimeAgent
pub fn with_streaming(self, config: StreamingConfig) -> RuntimeAgent
pub fn with_hitl( self, engine: HITLEngine, handler: Arc<dyn ApprovalHandler>, ) -> RuntimeAgent
pub fn with_max_context_tokens(self, tokens: u32) -> RuntimeAgent
pub fn with_memory_token_budget(self, budget: MemoryTokenBudget) -> RuntimeAgent
pub fn with_recovery_manager(self, manager: RecoveryManager) -> RuntimeAgent
pub fn with_tool_security(self, engine: ToolSecurityEngine) -> RuntimeAgent
pub fn with_process_processor(self, processor: ProcessProcessor) -> RuntimeAgent
pub fn with_state_machine( self, state_machine: Arc<StateMachine>, evaluator: Arc<dyn TransitionEvaluator>, ) -> RuntimeAgent
pub fn with_context_manager(self, manager: Arc<ContextManager>) -> RuntimeAgent
pub fn register_message_filter( &self, name: impl Into<String>, filter: Arc<dyn MessageFilter>, )
pub fn set_context(&self, key: &str, value: Value) -> Result<(), AgentError>
pub fn update_context(&self, path: &str, value: Value) -> Result<(), AgentError>
pub fn get_context(&self) -> HashMap<String, Value>
pub fn remove_context(&self, key: &str) -> Option<Value>
pub async fn refresh_context(&self, key: &str) -> Result<(), AgentError>
pub fn register_context_provider( &self, name: &str, provider: Arc<dyn ContextProvider>, )
pub fn current_state(&self) -> Option<String>
pub async fn transition_to(&self, state: &str) -> Result<(), AgentError>
pub fn state_history(&self) -> Vec<StateTransitionEvent>
pub async fn save_state(&self) -> Result<AgentSnapshot, AgentError>
Sourcepub async fn save_state_full(&self) -> Result<AgentSnapshot, AgentError>
pub async fn save_state_full(&self) -> Result<AgentSnapshot, AgentError>
Save state including spawned agents manifest for session persistence.
pub async fn restore_state( &self, snapshot: AgentSnapshot, ) -> Result<(), AgentError>
pub async fn save_to( &self, storage: &dyn AgentStorage, session_id: &str, ) -> Result<(), AgentError>
pub async fn load_from( &self, storage: &dyn AgentStorage, session_id: &str, ) -> Result<bool, AgentError>
pub async fn save_session(&self, session_id: &str) -> Result<(), AgentError>
pub async fn load_session(&self, session_id: &str) -> Result<bool, AgentError>
pub async fn delete_session(&self, session_id: &str) -> Result<(), AgentError>
pub async fn list_sessions(&self) -> Result<Vec<String>, AgentError>
pub fn info(&self) -> AgentInfo
pub fn skills(&self) -> &[SkillDefinition]
pub async fn reset(&self) -> Result<(), AgentError>
pub fn max_context_tokens(&self) -> u32
pub fn llm_registry(&self) -> &Arc<LLMRegistry>
pub fn state_machine(&self) -> Option<&Arc<StateMachine>>
pub fn context_manager(&self) -> &Arc<ContextManager>
pub fn tool_call_history(&self) -> Vec<ToolCallRecord>
pub fn memory_token_budget(&self) -> Option<&MemoryTokenBudget>
pub fn parallel_tools_config(&self) -> &ParallelToolsConfig
pub fn streaming_config(&self) -> &StreamingConfig
pub fn hooks(&self) -> &Arc<dyn AgentHooks>
pub fn hitl_engine(&self) -> Option<&HITLEngine>
pub fn approval_handler(&self) -> &Arc<dyn ApprovalHandler>
pub async fn check_state_hitl( &self, from: Option<&str>, to: &str, ) -> Result<bool, AgentError>
Sourcepub async fn chat_stream<'a>(
&'a self,
input: &'a str,
) -> Result<Pin<Box<dyn Stream<Item = StreamChunk> + Send + 'a>>, AgentError>
pub async fn chat_stream<'a>( &'a self, input: &'a str, ) -> Result<Pin<Box<dyn Stream<Item = StreamChunk> + Send + 'a>>, AgentError>
Stream a chat response with real-time updates
Trait Implementations§
Source§impl Agent for RuntimeAgent
impl Agent for RuntimeAgent
fn chat<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AgentResponse, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RuntimeAgent: 'async_trait,
fn info(&self) -> AgentInfo
fn reset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RuntimeAgent: 'async_trait,
Auto Trait Implementations§
impl !Freeze for RuntimeAgent
impl !RefUnwindSafe for RuntimeAgent
impl Send for RuntimeAgent
impl Sync for RuntimeAgent
impl Unpin for RuntimeAgent
impl UnsafeUnpin for RuntimeAgent
impl !UnwindSafe for RuntimeAgent
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
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 moreCreates a shared type from an unshared type.