pub struct AgentRuntime { /* private fields */ }Expand description
Runtime that wraps an oxi-sdk Agent for executing Seeds.
Each call to AgentRuntime::execute creates a fresh Agent,
builds a ToolRegistry based on the agent’s CSpace, and runs it to completion.
All OS-level access goes through KernelHandle — the single syscall table
for agent control. Provider/model resolution goes through EngineHandle,
which returns the latest OxiosEngine (hot-swapped on config change).
Implementations§
Source§impl AgentRuntime
impl AgentRuntime
Sourcepub fn new(
engine_handle: Arc<EngineHandle>,
model_id: impl Into<String>,
kernel_handle: Arc<KernelHandle>,
routing_stats: Option<Arc<RoutingStats>>,
) -> Self
pub fn new( engine_handle: Arc<EngineHandle>, model_id: impl Into<String>, kernel_handle: Arc<KernelHandle>, routing_stats: Option<Arc<RoutingStats>>, ) -> Self
Creates a new agent runtime with engine handle and kernel access.
Provider/model resolution goes through engine_handle (hot-swapped on config change).
Tool access goes through kernel_handle.
Sourcepub fn with_persona_manager(self, pm: Arc<PersonaManager>) -> Self
pub fn with_persona_manager(self, pm: Arc<PersonaManager>) -> Self
Attach a PersonaManager for persona system prompt injection.
Sourcepub fn with_config(self, config: AgentRuntimeConfig) -> Self
pub fn with_config(self, config: AgentRuntimeConfig) -> Self
Set the runtime config (overrides defaults).
Sourcepub fn with_tool_retriever(self, retriever: Arc<ToolRetriever>) -> Self
pub fn with_tool_retriever(self, retriever: Arc<ToolRetriever>) -> Self
Attach a ToolRetriever for semantic capability discovery.
Sourcepub async fn execute(
&self,
agent_id: AgentId,
seed: &Seed,
session_ctx: &mut SessionContext,
) -> Result<ExecutionResult>
pub async fn execute( &self, agent_id: AgentId, seed: &Seed, session_ctx: &mut SessionContext, ) -> Result<ExecutionResult>
Execute a Seed by running the tool-calling agent to completion.
- Resolves CSpace from persona/role/hint
- Registers tools via CSpace
- Recalls memories if available
- Creates Agent via
Agent::new_with_resolver() - Runs via
Agent::run_streaming()
Sourcepub async fn execute_with_session(
&self,
agent_id: AgentId,
seed: &Seed,
session_ctx: &mut SessionContext,
session_id: Option<String>,
) -> Result<ExecutionResult>
pub async fn execute_with_session( &self, agent_id: AgentId, seed: &Seed, session_ctx: &mut SessionContext, session_id: Option<String>, ) -> Result<ExecutionResult>
Like execute but with an explicit session_id for
RFC-015 chat transparency event publishing.