pub enum AssistantStreamEvent {
Show 25 variants
ThreadCreated {
data: ThreadObject,
},
ThreadRunCreated {
data: RunObject,
},
ThreadRunQueued {
data: RunObject,
},
ThreadRunInProgress {
data: RunObject,
},
ThreadRunRequiresAction {
data: RunObject,
},
ThreadRunCompleted {
data: RunObject,
},
ThreadRunIncomplete {
data: RunObject,
},
ThreadRunFailed {
data: RunObject,
},
ThreadRunCancelling {
data: RunObject,
},
ThreadRunCancelled {
data: RunObject,
},
ThreadRunExpired {
data: RunObject,
},
ThreadRunStepCreated {
data: RunStepObject,
},
ThreadRunStepInProgress {
data: RunStepObject,
},
ThreadRunStepDelta {
data: RunStepDeltaObject,
},
ThreadRunStepCompleted {
data: RunStepObject,
},
ThreadRunStepFailed {
data: RunStepObject,
},
ThreadRunStepCancelled {
data: RunStepObject,
},
ThreadRunStepExpired {
data: RunStepObject,
},
ThreadMessageCreated {
data: MessageObject,
},
ThreadMessageInProgress {
data: MessageObject,
},
ThreadMessageDelta {
data: MessageDeltaObject,
},
ThreadMessageCompleted {
data: MessageObject,
},
ThreadMessageIncomplete {
data: MessageObject,
},
Error {
data: Error,
},
Done {
data: String,
},
}Expand description
Represents the different types of events emitted during an Assistant stream.
§Used By
- Streaming responses from
/threads/runs(POST),/threads/{thread_id}/runs(POST),/threads/{thread_id}/runs/{run_id}/submit_tool_outputs(POST)
Variants§
ThreadCreated
Occurs when a new thread is created.
Fields
data: ThreadObjectThe created ThreadObject.
ThreadRunCreated
Occurs when a new run is created.
ThreadRunQueued
Occurs when a run moves to a queued status.
ThreadRunInProgress
Occurs when a run moves to an in_progress status.
ThreadRunRequiresAction
Occurs when a run moves to a requires_action status.
ThreadRunCompleted
Occurs when a run is completed.
ThreadRunIncomplete
Occurs when a run ends with status incomplete.
ThreadRunFailed
Occurs when a run fails.
ThreadRunCancelling
Occurs when a run moves to a cancelling status.
ThreadRunCancelled
Occurs when a run is cancelled.
ThreadRunExpired
Occurs when a run expires.
ThreadRunStepCreated
Occurs when a run step is created.
Fields
data: RunStepObjectThe created RunStepObject.
ThreadRunStepInProgress
Occurs when a run step moves to an in_progress state.
Fields
data: RunStepObjectThe RunStepObject in the in-progress state.
ThreadRunStepDelta
Occurs when parts of a run step are being streamed.
Fields
data: RunStepDeltaObjectThe RunStepDeltaObject containing the changes.
ThreadRunStepCompleted
Occurs when a run step is completed.
Fields
data: RunStepObjectThe completed RunStepObject.
ThreadRunStepFailed
Occurs when a run step fails.
Fields
data: RunStepObjectThe failed RunStepObject.
ThreadRunStepCancelled
Occurs when a run step is cancelled.
Fields
data: RunStepObjectThe cancelled RunStepObject.
ThreadRunStepExpired
Occurs when a run step expires.
Fields
data: RunStepObjectThe expired RunStepObject.
ThreadMessageCreated
Occurs when a message is created.
Fields
data: MessageObjectThe created MessageObject.
ThreadMessageInProgress
Occurs when a message moves to an in_progress state.
Fields
data: MessageObjectThe MessageObject in the in-progress state.
ThreadMessageDelta
Occurs when parts of a Message are being streamed.
Fields
data: MessageDeltaObjectThe MessageDeltaObject containing the changes.
ThreadMessageCompleted
Occurs when a message is completed.
Fields
data: MessageObjectThe completed MessageObject.
ThreadMessageIncomplete
Occurs when a message ends before it is completed.
Fields
data: MessageObjectThe incomplete MessageObject.
Error
Occurs when an error occurs during streaming.
Done
Occurs when a stream ends.
Trait Implementations§
Source§impl Clone for AssistantStreamEvent
impl Clone for AssistantStreamEvent
Source§fn clone(&self) -> AssistantStreamEvent
fn clone(&self) -> AssistantStreamEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AssistantStreamEvent
impl Debug for AssistantStreamEvent
Source§impl<'de> Deserialize<'de> for AssistantStreamEvent
impl<'de> Deserialize<'de> for AssistantStreamEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AssistantStreamEvent
impl PartialEq for AssistantStreamEvent
impl StructuralPartialEq for AssistantStreamEvent
Auto Trait Implementations§
impl Freeze for AssistantStreamEvent
impl RefUnwindSafe for AssistantStreamEvent
impl Send for AssistantStreamEvent
impl Sync for AssistantStreamEvent
impl Unpin for AssistantStreamEvent
impl UnwindSafe for AssistantStreamEvent
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,
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Entry is defined by the Collection trait.