pub struct AgentCore { /* private fields */ }Expand description
Core agent execution engine
Implementations§
Source§impl AgentCore
impl AgentCore
Sourcepub fn new(
profile: AgentProfile,
provider: Arc<dyn ModelProvider>,
embeddings_client: Option<EmbeddingsClient>,
persistence: Persistence,
session_id: String,
agent_name: Option<String>,
tool_registry: Arc<ToolRegistry>,
policy_engine: Arc<PolicyEngine>,
) -> Self
pub fn new( profile: AgentProfile, provider: Arc<dyn ModelProvider>, embeddings_client: Option<EmbeddingsClient>, persistence: Persistence, session_id: String, agent_name: Option<String>, tool_registry: Arc<ToolRegistry>, policy_engine: Arc<PolicyEngine>, ) -> Self
Create a new agent core
Sourcepub fn with_fast_provider(self, fast_provider: Arc<dyn ModelProvider>) -> Self
pub fn with_fast_provider(self, fast_provider: Arc<dyn ModelProvider>) -> Self
Set the fast model provider for hierarchical reasoning
Sourcepub fn with_session(self, session_id: String) -> Self
pub fn with_session(self, session_id: String) -> Self
Set a new session ID and clear conversation history
Sourcepub async fn run_step(&mut self, input: &str) -> Result<AgentOutput>
pub async fn run_step(&mut self, input: &str) -> Result<AgentOutput>
Execute a single interaction step
Sourcepub async fn run_spec(&mut self, spec: &AgentSpec) -> Result<AgentOutput>
pub async fn run_spec(&mut self, spec: &AgentSpec) -> Result<AgentOutput>
Execute a structured spec by converting it into a single prompt.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Get the current session ID
Sourcepub fn profile(&self) -> &AgentProfile
pub fn profile(&self) -> &AgentProfile
Get the agent profile
Sourcepub fn agent_name(&self) -> Option<&str>
pub fn agent_name(&self) -> Option<&str>
Get the logical agent name (if provided)
Sourcepub fn conversation_history(&self) -> &[Message]
pub fn conversation_history(&self) -> &[Message]
Get conversation history
Sourcepub fn load_history(&mut self, limit: i64) -> Result<()>
pub fn load_history(&mut self, limit: i64) -> Result<()>
Load conversation history from persistence
Sourcepub fn tool_registry(&self) -> &ToolRegistry
pub fn tool_registry(&self) -> &ToolRegistry
Get the tool registry
Sourcepub fn policy_engine(&self) -> &PolicyEngine
pub fn policy_engine(&self) -> &PolicyEngine
Get the policy engine
Sourcepub fn set_policy_engine(&mut self, policy_engine: Arc<PolicyEngine>)
pub fn set_policy_engine(&mut self, policy_engine: Arc<PolicyEngine>)
Set a new policy engine (useful for reloading policies)
Sourcepub async fn generate_embedding(&self, text: &str) -> Option<i64>
pub async fn generate_embedding(&self, text: &str) -> Option<i64>
Generate and store an embedding for arbitrary text (e.g., transcriptions) Returns the embedding_id if successful, None otherwise
Auto Trait Implementations§
impl Freeze for AgentCore
impl !RefUnwindSafe for AgentCore
impl Send for AgentCore
impl Sync for AgentCore
impl Unpin for AgentCore
impl !UnwindSafe for AgentCore
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 more