Skip to main content

Session

Struct Session 

Source
pub struct Session {
Show 14 fields pub session_type: String, pub channel: Value, pub free_time: Value, pub orchestration: Value, pub provenance_id: Option<String>, pub rust_lib_session_id: String, pub root_node_ids: Vec<String>, pub reference_root_node_ids: Vec<String>, pub started_at: String, pub transcript: Vec<Value>, pub pending_turn: bool, pub pending_external_event_id: Option<String>, pub completed: bool, pub rounds_used: u64, /* private fields */
}

Fields§

§session_type: String§channel: Value§free_time: Value§orchestration: Value§provenance_id: Option<String>§rust_lib_session_id: String§root_node_ids: Vec<String>§reference_root_node_ids: Vec<String>§started_at: String§transcript: Vec<Value>§pending_turn: bool§pending_external_event_id: Option<String>§completed: bool§rounds_used: u64

Implementations§

Source§

impl Session

Source

pub async fn new( api: Service, system_prompt: String, runtime: RuntimeModel, options: SessionOptions, restored: Option<&Value>, ) -> Result<Self>

Source

pub fn append_final_user_message( &mut self, text: &str, metadata: &Value, ) -> bool

Source

pub fn stage_source_message( &mut self, kennedy: bool, text: &str, metadata: Value, ) -> Result<()>

Source

pub fn answer_for_external_event(&self, id: &str) -> Option<&Value>

Source

pub fn responses_for_external_event(&self, id: &str) -> Vec<&Value>

Source

pub fn resolve_object(&mut self, object_id: &str) -> Result<ResolvedObject>

Source

pub fn requires_history_ingress(&self) -> bool

Source

pub fn stage_free_time_opening(&mut self) -> bool

Source

pub fn stage_wakeup_opening(&mut self) -> Result<bool>

Source

pub fn begin_user_turn(&mut self, text: &str, metadata: &Value) -> bool

Source

pub fn reset_exhausted_turn_rounds_for_retry(&mut self)

Source

pub fn interrupt_current_turn(&mut self) -> Result<()>

Source

pub async fn run_pending_turn<C, F>( &mut self, operation_id: Uuid, checkpoint: C, ) -> Result<Option<String>>
where C: FnMut(Value) -> F + Send, F: Future<Output = Result<()>> + Send,

Source

pub fn refresh_telegram_group_context( &mut self, group_context: &Value, current_message_id: Option<&str>, ) -> Result<()>

Source

pub fn finalize_free_time(&mut self, reason: &str) -> Result<()>

Source

pub fn commit_current_write_session(&mut self) -> Result<()>

Source

pub fn snapshot(&self) -> Result<Value>

Source

pub async fn release_managed_sources(&self)

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Erasable for T

Source§

const ACK_1_1_0: bool = true

Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Source§

unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>

Unerase this erased pointer. Read more
Source§

fn erase(this: NonNull<Self>) -> NonNull<Erased>

Turn this erasable pointer into an erased pointer. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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