Skip to main content

LiveTranscriptIdentity

Struct LiveTranscriptIdentity 

Source
pub struct LiveTranscriptIdentity<'a> {
    pub provider_item_id: Option<&'a str>,
    pub previous_item_id: Option<&'a str>,
    pub content_index: Option<u32>,
    pub response_id: Option<&'a str>,
    pub delta_id: Option<&'a str>,
}
Expand description

Runtime-side projection sink consumed by LiveAdapterHost.

This is the seam through which adapter observations become canonical Meerkat semantic facts. Surfaces (RPC/REST/WASM) provide an implementation that bridges into meerkat_core::SessionService / EventInjector / observer streams. Tests use [RecordingProjectionSink] (in this module’s #[cfg(test)] block) to assert routing decisions deterministically. Provider-side identity carried alongside a transcript fragment.

All fields are Option<&str> / Option<u32> because the underlying LiveAdapterObservation variants emit them as #[serde(default, skip_serializing_if = "Option::is_none")] per A11. Bundling them in one struct keeps sink trait signatures readable and lets sink implementations pattern-match the fields they care about without the call sites passing six separate arguments.

Variants:

  • UserTranscriptFinal carries provider_item_id, previous_item_id, content_index (no response_id / delta_id — those are assistant-only).
  • AssistantTextDelta carries the full set including response_id and delta_id.
  • AssistantTranscriptFinal carries provider_item_id (always present), previous_item_id, content_index, response_id (no delta_id — a final is not a delta).

Fields§

§provider_item_id: Option<&'a str>§previous_item_id: Option<&'a str>§content_index: Option<u32>§response_id: Option<&'a str>§delta_id: Option<&'a str>

Implementations§

Source§

impl<'a> LiveTranscriptIdentity<'a>

Source

pub fn user( provider_item_id: Option<&'a str>, previous_item_id: Option<&'a str>, content_index: Option<u32>, ) -> Self

Build identity for a user-side observation (response/delta IDs are always None on the user side).

Source

pub fn assistant_delta( provider_item_id: Option<&'a str>, previous_item_id: Option<&'a str>, content_index: Option<u32>, response_id: Option<&'a str>, delta_id: Option<&'a str>, ) -> Self

Build identity for a streaming assistant delta (full set carried).

Source

pub fn assistant_final( provider_item_id: &'a str, previous_item_id: Option<&'a str>, content_index: Option<u32>, response_id: Option<&'a str>, ) -> Self

Build identity for an assistant final (no delta_id, but everything else is meaningful and provider_item_id is required upstream).

Source

pub fn require_delta_identity( &self, ) -> Result<DeltaIdentity<'a>, LiveTranscriptIdentityError>

Resolve the required identity triple for an assistant delta event (D199): response_id, delta_id, and item_id (provider item id).

The sink previously coalesced each missing id to an empty string via unwrap_or_default(), emitting an RealtimeTranscriptEvent whose identity was empty-string truth — a delta that cannot be bound back to any response/item. This accessor fails closed: a missing required id yields a typed LiveTranscriptIdentityError naming the absent field, so the projection rejects the malformed delta rather than fabricating empty identity.

Trait Implementations§

Source§

impl<'a> Clone for LiveTranscriptIdentity<'a>

Source§

fn clone(&self) -> LiveTranscriptIdentity<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for LiveTranscriptIdentity<'a>

Source§

impl<'a> Debug for LiveTranscriptIdentity<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for LiveTranscriptIdentity<'a>

Source§

fn default() -> LiveTranscriptIdentity<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Eq for LiveTranscriptIdentity<'a>

Source§

impl<'a> PartialEq for LiveTranscriptIdentity<'a>

Source§

fn eq(&self, other: &LiveTranscriptIdentity<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for LiveTranscriptIdentity<'a>

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> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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