pub(crate) enum AzureStreamEvent {
ResponseCreated,
ResponseCompleted,
OutputItemAdded,
OutputItemDone,
FunctionCallArgumentsDelta,
CustomToolCallInputDelta,
OutputTextDelta,
RefusalDelta,
Incomplete,
ErrorReported,
Other,
}Expand description
One Azure SSE event name, classified once instead of by a separate &str match in each parser
that reacts to it.
The three parsers deliberately disagree about the same event — OutputTextDelta is a hard
error in the tool-call parser, the classification signal here, and ordinary traffic in the
text parser — so this only says what the event is, never what to do about it. Each parser
still matches its own subset of variants and keeps a catch-all for the rest, including
Self::Other.
Variants§
ResponseCreated
ResponseCompleted
OutputItemAdded
OutputItemDone
FunctionCallArgumentsDelta
CustomToolCallInputDelta
OutputTextDelta
RefusalDelta
Incomplete
ErrorReported
Other
Anything not matched by name above, including traffic every parser is fine to ignore
(response.in_progress, reasoning summaries, …) and names outside ALL_EXPECTED_EVENTS.
Implementations§
Source§impl AzureStreamEvent
impl AzureStreamEvent
pub(crate) fn from_wire(name: &str) -> Self
Sourcepub(crate) fn of_data_line(
preceding_event: Option<Self>,
response_type: Option<&str>,
) -> Option<Self>
pub(crate) fn of_data_line( preceding_event: Option<Self>, response_type: Option<&str>, ) -> Option<Self>
Which event a data: line belongs to: the event: line that preceded it, or, when none
did, the line’s own type field.
The one rule all three readers of the stream use, so the same line cannot count as, say,
Azure’s finished copy of an item for one reader and its added copy for another. type is
only a fallback because it is optional on the wire.
Sourcefn for_event_line(name: &str) -> Self
fn for_event_line(name: &str) -> Self
Classifies an event: line, warning once if the name falls outside everything a parser
reacts to and ALL_EXPECTED_EVENTS.
Trait Implementations§
Source§impl Clone for AzureStreamEvent
impl Clone for AzureStreamEvent
Source§fn clone(&self) -> AzureStreamEvent
fn clone(&self) -> AzureStreamEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AzureStreamEvent
impl Debug for AzureStreamEvent
Source§impl PartialEq for AzureStreamEvent
impl PartialEq for AzureStreamEvent
impl Eq for AzureStreamEvent
impl StructuralPartialEq for AzureStreamEvent
Auto Trait Implementations§
impl Freeze for AzureStreamEvent
impl RefUnwindSafe for AzureStreamEvent
impl Send for AzureStreamEvent
impl Sync for AzureStreamEvent
impl Unpin for AzureStreamEvent
impl UnsafeUnpin for AzureStreamEvent
impl UnwindSafe for AzureStreamEvent
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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> ⓘ
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].