pub struct InProcessRuntime { /* private fields */ }Expand description
Public in-process runtime backed by either in-memory or custom stores.
This runtime is intended for embedders who want to execute Everruns harnesses inside their own process while controlling capabilities, harness definitions, and driver registrations directly in Rust.
Implementations§
Source§impl InProcessRuntime
impl InProcessRuntime
Sourcepub fn builder() -> InProcessRuntimeBuilder
pub fn builder() -> InProcessRuntimeBuilder
Create a builder for the in-process runtime.
Sourcepub fn default_session_id(&self) -> Option<SessionId>
pub fn default_session_id(&self) -> Option<SessionId>
Return the default session id seeded by
InProcessRuntimeBuilder::single_session, if one was configured.
Sourcepub async fn run_turn(
&self,
session_id: SessionId,
input: impl Into<InputMessage>,
) -> Result<TurnResult>
pub async fn run_turn( &self, session_id: SessionId, input: impl Into<InputMessage>, ) -> Result<TurnResult>
Execute one turn for an existing session.
The input message is stored in the runtime history, an input.message
event is emitted, and the turn then executes the shared core
input -> reason -> act state machine.
pub async fn run_text_turn( &self, session_id: SessionId, text: impl Into<String>, ) -> Result<TurnResult>
Sourcepub async fn messages(&self, session_id: SessionId) -> Result<Vec<Message>>
pub async fn messages(&self, session_id: SessionId) -> Result<Vec<Message>>
Load the current message history for a session.
Sourcepub async fn read_file(
&self,
session_id: SessionId,
path: &str,
) -> Result<Option<SessionFile>>
pub async fn read_file( &self, session_id: SessionId, path: &str, ) -> Result<Option<SessionFile>>
Read a file from the in-memory session filesystem.
Sourcepub async fn load_context(
&self,
session_id: SessionId,
) -> Result<AssembledTurnContext>
pub async fn load_context( &self, session_id: SessionId, ) -> Result<AssembledTurnContext>
Assemble the current runtime context for a session without executing a turn.
Trait Implementations§
Source§impl Clone for InProcessRuntime
impl Clone for InProcessRuntime
Source§fn clone(&self) -> InProcessRuntime
fn clone(&self) -> InProcessRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl RuntimeHostAdapter for InProcessRuntime
impl RuntimeHostAdapter for InProcessRuntime
fn get_agent<'life0, 'async_trait>(
&'life0 self,
_org_id: i64,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_harness<'life0, 'async_trait>(
&'life0 self,
_org_id: i64,
harness_id: HarnessId,
) -> Pin<Box<dyn Future<Output = Result<Option<Harness>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_session_status<'life0, 'async_trait>(
&'life0 self,
_org_id: i64,
session_id: SessionId,
_status: SessionStatus,
) -> Pin<Box<dyn Future<Output = Result<Session>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_turn_context<'life0, 'async_trait>(
&'life0 self,
_org_id: i64,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<RuntimeHostTurnContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn capability_registry(&self) -> CapabilityRegistry
fn driver_registry(&self) -> DriverRegistry
fn harness_store(&self, _org_id: i64) -> Arc<dyn HarnessStore>
fn agent_store(&self, _org_id: i64) -> Arc<dyn AgentStore>
fn session_store(&self, _org_id: i64) -> Arc<dyn SessionStore>
fn session_mutator(&self, _org_id: i64) -> Arc<dyn SessionMutator>
fn provider_store(&self, _org_id: i64) -> Arc<dyn LlmProviderStore>
fn message_store(&self) -> Arc<dyn MessageRetriever>
fn event_emitter(&self) -> Arc<dyn EventEmitter>
fn file_store(&self) -> Arc<dyn SessionFileSystem>
fn storage_store(&self) -> Option<Arc<dyn SessionStorageStore>>
fn memory_store(&self, _org_id: i64) -> Option<Arc<dyn MemoryStoreBackend>>
fn image_resolver(&self, _org_id: i64) -> Option<Arc<dyn ImageResolver>>
fn image_artifact_store( &self, _org_id: i64, ) -> Option<Arc<dyn ImageArtifactStore>>
fn provider_credential_store( &self, _org_id: i64, ) -> Option<Arc<dyn ProviderCredentialStore>>
fn connection_resolver(&self) -> Option<Arc<dyn UserConnectionResolver>>
fn sqldb_store(&self) -> Option<SessionSqlDbStoreRef>
fn leased_resource_store(&self) -> Option<Arc<dyn LeasedResourceStore>>
fn session_resource_registry(&self) -> Option<Arc<dyn SessionResourceRegistry>>
fn schedule_store(&self, _org_id: i64) -> Option<Arc<dyn SessionScheduleStore>>
fn platform_store( &self, _org_id: i64, _session_id: SessionId, ) -> Option<Arc<dyn PlatformStore>>
fn budget_checker( &self, _org_id: i64, _agent_id: Option<AgentId>, ) -> Option<Arc<dyn BudgetChecker>>
Auto Trait Implementations§
impl Freeze for InProcessRuntime
impl !RefUnwindSafe for InProcessRuntime
impl Send for InProcessRuntime
impl Sync for InProcessRuntime
impl Unpin for InProcessRuntime
impl UnsafeUnpin for InProcessRuntime
impl !UnwindSafe for InProcessRuntime
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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