pub(super) enum TurnEvent {
Delta(String),
Refusal {
text: String,
message_id: Uuid,
},
Item(StreamItem),
ItemAnnounced(OutputItem),
Messages(Vec<APIInputMessage>),
Done {
text: String,
used_tokens: i32,
},
Suspended,
}Expand description
What the two body parsers — the tool-call round and the text answer — yield once a response is
classified. One type shared between them rather than split further: both stream Item, while
Refusal/ItemAnnounced/Messages/Suspended come only from the tool-call round and Delta/
Done only from the text answer.
Variants§
Delta(String)
Refusal
Text the model refused with, and the message it was stored as. A refusal is stored before
it is streamed, so unlike a Delta it names the message it belongs to itself.
Item(StreamItem)
ItemAnnounced(OutputItem)
An item the tool-call round stores itself, at its position among the round’s other items,
instead of leaving that to whichever loop consumes this event. The consumer converts and
forwards it to the client exactly like Item, but must not persist it.
Messages(Vec<APIInputMessage>)
Done
The answer Azure finished, for the turn to store on the message it streamed from.
Suspended
The round ended in a tool call only the client can answer, so the turn ends here and is continued by the request that brings the answer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TurnEvent
impl RefUnwindSafe for TurnEvent
impl Send for TurnEvent
impl Sync for TurnEvent
impl Unpin for TurnEvent
impl UnsafeUnpin for TurnEvent
impl UnwindSafe for TurnEvent
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
§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].