pub struct AgentSession {
pub id: SessionId,
pub config: SessionConfig,
/* private fields */
}Expand description
An agent session with isolated type environment
Fields§
§id: SessionId§config: SessionConfigImplementations§
Source§impl AgentSession
impl AgentSession
pub async fn new(base_universe: SharedUniverse, config: SessionConfig) -> Self
Sourcepub fn query_engine(&self) -> &QueryEngine
pub fn query_engine(&self) -> &QueryEngine
Get the query engine for this session
Sourcepub fn checker(&self) -> &StreamingChecker
pub fn checker(&self) -> &StreamingChecker
Get the streaming checker for this session
Sourcepub async fn semantic_search(
&self,
query: &str,
limit: usize,
) -> Vec<SearchResult>
pub async fn semantic_search( &self, query: &str, limit: usize, ) -> Vec<SearchResult>
Perform semantic search if RAG is enabled
Sourcepub async fn commit(&self) -> Result<CommitResult, CommitError>
pub async fn commit(&self) -> Result<CommitResult, CommitError>
Commit changes to parent universe
Sourcepub async fn rollback(&self) -> Result<(), RollbackError>
pub async fn rollback(&self) -> Result<(), RollbackError>
Rollback to last checkpoint
Sourcepub async fn fork(
&self,
_name: impl Into<String>,
) -> Result<SessionId, ForkError>
pub async fn fork( &self, _name: impl Into<String>, ) -> Result<SessionId, ForkError>
Create a sub-branch (for speculative exploration)
Sourcepub async fn metrics(&self) -> SessionMetrics
pub async fn metrics(&self) -> SessionMetrics
Get session metrics
Sourcepub async fn record_query(&self, latency_us: u64)
pub async fn record_query(&self, latency_us: u64)
Update metrics
Sourcepub async fn close(self) -> SessionSummary
pub async fn close(self) -> SessionSummary
Close the session
Auto Trait Implementations§
impl !Freeze for AgentSession
impl !RefUnwindSafe for AgentSession
impl Send for AgentSession
impl Sync for AgentSession
impl Unpin for AgentSession
impl UnsafeUnpin for AgentSession
impl !UnwindSafe for AgentSession
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
Wrap the input message
T in a tonic::Request