Skip to main content

RuntimeAgent

Struct RuntimeAgent 

Source
pub struct RuntimeAgent { /* private fields */ }

Implementations§

Source§

impl RuntimeAgent

Source

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

Source

pub fn with_declared_tool_ids(self, ids: Option<Vec<String>>) -> RuntimeAgent

Source

pub fn with_storage_config(self, config: StorageConfig) -> RuntimeAgent

Source

pub fn with_storage(self, storage: Arc<dyn AgentStorage>) -> RuntimeAgent

Source

pub fn with_reasoning(self, config: ReasoningConfig) -> RuntimeAgent

Source

pub fn with_reflection(self, config: ReflectionConfig) -> RuntimeAgent

Source

pub fn reasoning_config(&self) -> &ReasoningConfig

Source

pub fn reflection_config(&self) -> &ReflectionConfig

Source

pub fn with_persona(self, manager: Arc<PersonaManager>) -> RuntimeAgent

Source

pub fn persona_manager(&self) -> Option<&Arc<PersonaManager>>

Source

pub fn with_disambiguation(self, config: DisambiguationConfig) -> RuntimeAgent

Source

pub fn disambiguation_manager(&self) -> Option<&DisambiguationManager>

Source

pub fn has_disambiguation(&self) -> bool

Source

pub async fn init_storage(&self) -> Result<(), AgentError>

Source

pub fn storage(&self) -> Option<Arc<dyn AgentStorage>>

Source

pub fn storage_config(&self) -> &StorageConfig

Source

pub fn spawner(&self) -> Option<&Arc<AgentSpawner>>

Returns the spawner if configured via a spawner: YAML section.

Source

pub fn spawner_registry(&self) -> Option<&Arc<AgentRegistry>>

Returns the agent registry if configured via a spawner: YAML section.

Source

pub fn has_spawner(&self) -> bool

Source

pub fn with_spawner_handles( self, spawner: Arc<AgentSpawner>, registry: Arc<AgentRegistry>, ) -> RuntimeAgent

Source

pub fn with_hooks(self, hooks: Arc<dyn AgentHooks>) -> RuntimeAgent

Source

pub fn with_parallel_tools(self, config: ParallelToolsConfig) -> RuntimeAgent

Source

pub fn with_streaming(self, config: StreamingConfig) -> RuntimeAgent

Source

pub fn with_hitl( self, engine: HITLEngine, handler: Arc<dyn ApprovalHandler>, ) -> RuntimeAgent

Source

pub fn with_max_context_tokens(self, tokens: u32) -> RuntimeAgent

Source

pub fn with_memory_token_budget(self, budget: MemoryTokenBudget) -> RuntimeAgent

Source

pub fn with_recovery_manager(self, manager: RecoveryManager) -> RuntimeAgent

Source

pub fn with_tool_security(self, engine: ToolSecurityEngine) -> RuntimeAgent

Source

pub fn with_process_processor(self, processor: ProcessProcessor) -> RuntimeAgent

Source

pub fn with_state_machine( self, state_machine: Arc<StateMachine>, evaluator: Arc<dyn TransitionEvaluator>, ) -> RuntimeAgent

Source

pub fn with_context_manager(self, manager: Arc<ContextManager>) -> RuntimeAgent

Source

pub fn register_message_filter( &self, name: impl Into<String>, filter: Arc<dyn MessageFilter>, )

Source

pub fn set_context(&self, key: &str, value: Value) -> Result<(), AgentError>

Source

pub fn update_context(&self, path: &str, value: Value) -> Result<(), AgentError>

Source

pub fn get_context(&self) -> HashMap<String, Value>

Source

pub fn remove_context(&self, key: &str) -> Option<Value>

Source

pub async fn refresh_context(&self, key: &str) -> Result<(), AgentError>

Source

pub fn register_context_provider( &self, name: &str, provider: Arc<dyn ContextProvider>, )

Source

pub fn current_state(&self) -> Option<String>

Source

pub async fn transition_to(&self, state: &str) -> Result<(), AgentError>

Source

pub fn state_history(&self) -> Vec<StateTransitionEvent>

Source

pub async fn save_state(&self) -> Result<AgentSnapshot, AgentError>

Source

pub async fn save_state_full(&self) -> Result<AgentSnapshot, AgentError>

Save state including spawned agents manifest for session persistence.

Source

pub async fn restore_state( &self, snapshot: AgentSnapshot, ) -> Result<(), AgentError>

Source

pub async fn save_to( &self, storage: &dyn AgentStorage, session_id: &str, ) -> Result<(), AgentError>

Source

pub async fn load_from( &self, storage: &dyn AgentStorage, session_id: &str, ) -> Result<bool, AgentError>

Source

pub async fn save_session(&self, session_id: &str) -> Result<(), AgentError>

Source

pub async fn load_session(&self, session_id: &str) -> Result<bool, AgentError>

Source

pub async fn delete_session(&self, session_id: &str) -> Result<(), AgentError>

Source

pub async fn list_sessions(&self) -> Result<Vec<String>, AgentError>

Source

pub fn info(&self) -> AgentInfo

Source

pub fn skills(&self) -> &[SkillDefinition]

Source

pub async fn reset(&self) -> Result<(), AgentError>

Source

pub fn max_context_tokens(&self) -> u32

Source

pub fn llm_registry(&self) -> &Arc<LLMRegistry>

Source

pub fn state_machine(&self) -> Option<&Arc<StateMachine>>

Source

pub fn context_manager(&self) -> &Arc<ContextManager>

Source

pub fn tool_call_history(&self) -> Vec<ToolCallRecord>

Source

pub fn memory_token_budget(&self) -> Option<&MemoryTokenBudget>

Source

pub fn parallel_tools_config(&self) -> &ParallelToolsConfig

Source

pub fn streaming_config(&self) -> &StreamingConfig

Source

pub fn hooks(&self) -> &Arc<dyn AgentHooks>

Source

pub fn hitl_engine(&self) -> Option<&HITLEngine>

Source

pub fn approval_handler(&self) -> &Arc<dyn ApprovalHandler>

Source

pub async fn check_state_hitl( &self, from: Option<&str>, to: &str, ) -> Result<bool, AgentError>

Source

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

Source§

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,

Source§

fn info(&self) -> AgentInfo

Source§

fn reset<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where 'life0: 'async_trait, RuntimeAgent: 'async_trait,

Source§

impl Debug for RuntimeAgent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more