Skip to main content

InProcessRuntimeBuilder

Struct InProcessRuntimeBuilder 

Source
pub struct InProcessRuntimeBuilder { /* private fields */ }
Expand description

Builder for the public in-process runtime.

The builder owns a standalone runtime bundle:

  • PlatformDefinition for 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

Source

pub fn new() -> Self

Create a builder with built-in capabilities and no implicit LLM driver.

Embedders must either:

  • call Self::llm_sim for deterministic local examples/tests, or
  • register their own driver(s) on the platform definition and set a default model via Self::default_model.
Source

pub fn platform_definition( self, platform_definition: PlatformDefinition, ) -> Self

Replace the platform definition used by the runtime.

Source

pub fn capability<C: Capability + 'static>(self, capability: C) -> Self

Register an additional capability on the runtime platform.

Source

pub fn driver_registry(self, driver_registry: DriverRegistry) -> Self

Replace the platform driver registry.

Source

pub fn llm_sim(self, config: LlmSimConfig) -> Self

Register the built-in llmsim driver for deterministic local execution.

Source

pub fn default_model(self, model: ModelWithProvider) -> Self

Set the runtime default model used when sessions/agents do not override it.

Source

pub fn backends(self, backends: RuntimeBackends) -> Self

Supply a custom backend bundle instead of the built-in in-memory stores.

Source

pub fn session_file_system_factory_context( self, context: SessionFileSystemFactoryContext, ) -> Self

Supply host dependencies needed by the platform session filesystem factory.

Source

pub fn harness(self, harness: Harness) -> Self

Seed a harness into the runtime store.

Source

pub fn agent(self, agent: Agent) -> Self

Seed an agent into the runtime store.

Source

pub fn session(self, session: Session) -> Self

Seed a session into the runtime store.

Source

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.

Source

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.

Source

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§

Source§

impl Default for InProcessRuntimeBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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