pub struct ObservationExtractionContext {
pub transcript: String,
pub recent_user_turns: Vec<String>,
pub recent_assistant_turn: Option<String>,
pub known_predicates: Vec<String>,
pub speaker: SpeakerAttribution,
pub session_id: SessionId,
pub turn_id: TurnId,
pub now: DateTime<Utc>,
}Expand description
What the observation extractor is given.
Fields§
§transcript: StringThe finalized user utterance.
recent_user_turns: Vec<String>Preceding user turns, for pronoun resolution.
recent_assistant_turn: Option<String>The preceding assistant turn, for reference resolution only.
known_predicates: Vec<String>Predicates already in use in this user’s corpus, most-used first.
Reconciliation matches on subject and predicate, so a correction only
supersedes the fact it corrects when the two agree on a name. Left to
invent one per call, the model writes dietary_preference on Monday
and dietary_identity on Tuesday, and the correction becomes a second
active record instead of replacing the first. Showing it the names
already in use is the same move as learning entities from the corpus:
the vocabulary comes from the data, not from a list in the binary and
not from the model’s imagination each time.
speaker: SpeakerAttributionWho the utterance is attributed to.
session_id: SessionIdThe logical session.
turn_id: TurnIdThe turn.
now: DateTime<Utc>Evaluation time, for resolving relative dates.
Implementations§
Source§impl ObservationExtractionContext
impl ObservationExtractionContext
Sourcepub fn user_turn(
transcript: impl Into<String>,
session_id: SessionId,
turn_id: TurnId,
now: DateTime<Utc>,
) -> Self
pub fn user_turn( transcript: impl Into<String>, session_id: SessionId, turn_id: TurnId, now: DateTime<Utc>, ) -> Self
A context for a finalized user turn.
Sourcepub fn attributed_to(self, speaker: SpeakerAttribution) -> Self
pub fn attributed_to(self, speaker: SpeakerAttribution) -> Self
Attribute the utterance to someone other than the enrolled user.
Sourcepub fn with_known_predicates(self, predicates: Vec<String>) -> Self
pub fn with_known_predicates(self, predicates: Vec<String>) -> Self
Offer the predicate names the corpus already uses.
Trait Implementations§
Source§impl Clone for ObservationExtractionContext
impl Clone for ObservationExtractionContext
Source§fn clone(&self) -> ObservationExtractionContext
fn clone(&self) -> ObservationExtractionContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ObservationExtractionContext
impl RefUnwindSafe for ObservationExtractionContext
impl Send for ObservationExtractionContext
impl Sync for ObservationExtractionContext
impl Unpin for ObservationExtractionContext
impl UnwindSafe for ObservationExtractionContext
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,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].