pub struct InProcessRuntimeBuilder { /* private fields */ }Expand description
Builder for the public in-process runtime.
The builder owns a standalone runtime bundle:
PlatformDefinitionfor capabilities and drivers- in-memory stores for sessions, files, storage, memory, and messages
- seeded harness/agent/session entities
build() returns an InProcessRuntime that can execute turns in-process
without the durable engine or the control-plane server.
Implementations§
Source§impl InProcessRuntimeBuilder
impl InProcessRuntimeBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a builder with built-in capabilities and no implicit LLM driver.
Embedders must either:
- call
Self::llm_simfor deterministic local examples/tests, or - register their own driver(s) on the platform definition and set a
default model via
Self::default_model.
Sourcepub fn platform_definition(
self,
platform_definition: PlatformDefinition,
) -> Self
pub fn platform_definition( self, platform_definition: PlatformDefinition, ) -> Self
Replace the platform definition used by the runtime.
Sourcepub fn capability<C: Capability + 'static>(self, capability: C) -> Self
pub fn capability<C: Capability + 'static>(self, capability: C) -> Self
Register an additional capability on the runtime platform.
Sourcepub fn driver_registry(self, driver_registry: DriverRegistry) -> Self
pub fn driver_registry(self, driver_registry: DriverRegistry) -> Self
Replace the platform driver registry.
Sourcepub fn llm_sim(self, config: LlmSimConfig) -> Self
pub fn llm_sim(self, config: LlmSimConfig) -> Self
Register the built-in llmsim driver for deterministic local execution.
Sourcepub fn default_model(self, model: ModelWithProvider) -> Self
pub fn default_model(self, model: ModelWithProvider) -> Self
Set the runtime default model used when sessions/agents do not override it.
Sourcepub fn backends(self, backends: RuntimeBackends) -> Self
pub fn backends(self, backends: RuntimeBackends) -> Self
Supply a custom backend bundle instead of the built-in in-memory stores.
Sourcepub fn session_file_system_factory_context(
self,
context: SessionFileSystemFactoryContext,
) -> Self
pub fn session_file_system_factory_context( self, context: SessionFileSystemFactoryContext, ) -> Self
Supply host dependencies needed by the platform session filesystem factory.
Sourcepub fn single_session<F>(self, configure: F) -> Self
pub fn single_session<F>(self, configure: F) -> Self
Seed one harness, one agent, and one session with a compact sub-builder.
The generated session id is exposed from the built runtime via
InProcessRuntime::default_session_id.
Sourcepub fn seed_text_file(
self,
session_id: SessionId,
path: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn seed_text_file( self, session_id: SessionId, path: impl Into<String>, content: impl Into<String>, ) -> Self
Seed an additional text file directly into a session workspace.
This is applied after harness/agent/session initial_files are merged.
Sourcepub async fn build(self) -> Result<InProcessRuntime>
pub async fn build(self) -> Result<InProcessRuntime>
Build the in-process runtime.
Returns a configuration error when no default model is available after
applying explicit configuration and any requested llmsim setup.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InProcessRuntimeBuilder
impl !RefUnwindSafe for InProcessRuntimeBuilder
impl Send for InProcessRuntimeBuilder
impl Sync for InProcessRuntimeBuilder
impl Unpin for InProcessRuntimeBuilder
impl UnsafeUnpin for InProcessRuntimeBuilder
impl !UnwindSafe for InProcessRuntimeBuilder
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request