pub struct InProcessHost { /* private fields */ }Expand description
In-process host: nested TurnRuntime with shared sampler, tool pool, and limits.
Implementations§
Source§impl InProcessHost
impl InProcessHost
Sourcepub fn new(sampler: Arc<dyn LlmSampler>, tools: Vec<SharedTool>) -> Self
pub fn new(sampler: Arc<dyn LlmSampler>, tools: Vec<SharedTool>) -> Self
Create a host with default depth/concurrency caps and unlimited agent budget.
Sourcepub const fn with_agent_budget(self, budget: u64) -> Self
pub const fn with_agent_budget(self, budget: u64) -> Self
Absolute agent-call budget for this host (every successful admission counts 1).
Sourcepub const fn with_max_spawn_depth(self, max: Option<u32>) -> Self
pub const fn with_max_spawn_depth(self, max: Option<u32>) -> Self
Cap nesting depth (depth must be < max). None disables the limit.
Sourcepub fn with_max_concurrent_children(self, max: Option<usize>) -> Self
pub fn with_max_concurrent_children(self, max: Option<usize>) -> Self
Cap concurrent in-flight children. None disables the limit.
Sourcepub fn with_agent_registry(self, registry: AgentRegistry) -> Self
pub fn with_agent_registry(self, registry: AgentRegistry) -> Self
Install a full agent registry for agent_type resolution.
Sourcepub fn with_agent_definitions(
self,
defs: impl IntoIterator<Item = AgentDefinition>,
) -> Self
pub fn with_agent_definitions( self, defs: impl IntoIterator<Item = AgentDefinition>, ) -> Self
Register agent definitions (merged into the host registry).
Sourcepub fn with_prompt_assembler(self, assembler: Arc<dyn PromptAssembler>) -> Self
pub fn with_prompt_assembler(self, assembler: Arc<dyn PromptAssembler>) -> Self
Install a prompt assembler applied when resolving agent_type definitions.
Sourcepub fn with_isolation(self, isolation: Arc<dyn IsolationBackend>) -> Self
pub fn with_isolation(self, isolation: Arc<dyn IsolationBackend>) -> Self
Install an isolation backend (default InProcessIsolation).
Sourcepub fn with_metrics(self, metrics: SharedMetrics) -> Self
pub fn with_metrics(self, metrics: SharedMetrics) -> Self
Metrics sink for spawn/turn accounting.
Sourcepub fn with_parent_handle(self, handle: ChatStateHandle) -> Self
pub fn with_parent_handle(self, handle: ChatStateHandle) -> Self
Parent conversation handle used when fork_context is set without messages.
Sourcepub fn with_run_store(self, store: Arc<dyn WorkflowRunStore>) -> Self
pub fn with_run_store(self, store: Arc<dyn WorkflowRunStore>) -> Self
Workflow run store enabling resume_from on spawn opts.
Sourcepub fn with_instructions(self, instructions: impl Into<String>) -> Self
pub fn with_instructions(self, instructions: impl Into<String>) -> Self
Override child system instructions (used when agent_type is unset).
Sourcepub fn agent_registry(&self) -> &AgentRegistry
pub fn agent_registry(&self) -> &AgentRegistry
Shared agent registry (clone is cheap).
Sourcepub fn agents_spent(&self) -> u64
pub fn agents_spent(&self) -> u64
Agents admitted so far (including in-flight after reservation).
Sourcepub fn agents_remaining(&self) -> Option<u64>
pub fn agents_remaining(&self) -> Option<u64>
Remaining budget when capped.
Sourcepub const fn max_spawn_depth(&self) -> Option<u32>
pub const fn max_spawn_depth(&self) -> Option<u32>
Configured max spawn depth.
Sourcepub const fn max_concurrent_children(&self) -> Option<usize>
pub const fn max_concurrent_children(&self) -> Option<usize>
Configured max concurrent children.