pub struct SessionAnalyst { /* private fields */ }Expand description
Summarizes sessions into episodes with a model.
Implementations§
Source§impl SessionAnalyst
impl SessionAnalyst
pub fn new(provider: Arc<dyn Provider>, model: impl Into<String>) -> Self
Sourcepub async fn analyze(&self, transcript: &str) -> Result<SessionAnalysis>
pub async fn analyze(&self, transcript: &str) -> Result<SessionAnalysis>
Ask the model about a transcript. An unparseable reply is a neutral default analysis; provider failures and empty replies are errors.
Sourcepub async fn record_episode<S>(
&self,
store: &S,
session_id: &str,
entries: &[TranscriptEntry],
message_count: usize,
start_time: DateTime<Utc>,
end_time: DateTime<Utc>,
channel_id: Option<String>,
) -> Result<(i64, SessionAnalysis)>where
S: EpisodeStore + ?Sized,
pub async fn record_episode<S>(
&self,
store: &S,
session_id: &str,
entries: &[TranscriptEntry],
message_count: usize,
start_time: DateTime<Utc>,
end_time: DateTime<Utc>,
channel_id: Option<String>,
) -> Result<(i64, SessionAnalysis)>where
S: EpisodeStore + ?Sized,
Analyze a session and record it as an episode. Importance comes from the session’s size and the analysis’s typed signals (errors, decisions, goals, intensity), never from matching words. Returns the episode id and the analysis, whose goals the host may act on.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SessionAnalyst
impl !UnwindSafe for SessionAnalyst
impl Forget for SessionAnalyst
impl Freeze for SessionAnalyst
impl Move for SessionAnalyst
impl Send for SessionAnalyst
impl Sync for SessionAnalyst
impl Unpin for SessionAnalyst
impl UnsafeUnpin for SessionAnalystwhere
*const ArcInner<dyn Provider> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Provider>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more