#[non_exhaustive]pub enum ResponseStreamEvent {
Show 18 variants
ResponseCreated {
response: Response,
},
ResponseInProgress {
response: Response,
},
ResponseCompleted(ResponseCompletedEvent),
ResponseFailed(ResponseFailedEvent),
ResponseIncomplete(ResponseIncompleteEvent),
ResponseOutputItemAdded(ResponseOutputItemAddedEvent),
OutputItemDone {
output_index: i64,
item: ResponseOutputItem,
},
ContentPartAdded {
output_index: i64,
content_index: i64,
part: Value,
},
ContentPartDone {
output_index: i64,
content_index: i64,
part: Value,
},
ResponseOutputTextDelta(ResponseTextDeltaEvent),
OutputTextDone {
output_index: i64,
content_index: i64,
text: String,
},
ResponseFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent),
ResponseFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent),
ResponseReasoningTextDelta(ResponseReasoningTextDeltaEvent),
ResponseReasoningSummaryTextDelta(ResponseReasoningSummaryTextDeltaEvent),
ReasoningSummaryTextDone {
output_index: i64,
summary_index: Option<i64>,
text: String,
},
ResponseError(ResponseErrorEvent),
Other(Value),
}Expand description
A streaming event from the Responses API.
Uses #[serde(tag = "type")] for typed deserialization. Unknown event types
fall through to the Other variant to ensure forward compatibility.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ResponseCreated
Response created.
ResponseInProgress
Response in progress.
ResponseCompleted(ResponseCompletedEvent)
Response completed.
ResponseFailed(ResponseFailedEvent)
Response failed.
ResponseIncomplete(ResponseIncompleteEvent)
Response incomplete.
ResponseOutputItemAdded(ResponseOutputItemAddedEvent)
New output item added.
OutputItemDone
Output item done.
Fields
§
item: ResponseOutputItemThe completed output item.
ContentPartAdded
Content part added.
Fields
ContentPartDone
Content part done.
Fields
ResponseOutputTextDelta(ResponseTextDeltaEvent)
Text output delta.
OutputTextDone
Text output done.
Fields
ResponseFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent)
Function call arguments delta.
ResponseFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent)
Function call arguments done.
ResponseReasoningTextDelta(ResponseReasoningTextDeltaEvent)
Reasoning text delta.
ResponseReasoningSummaryTextDelta(ResponseReasoningSummaryTextDeltaEvent)
Reasoning summary text delta.
ReasoningSummaryTextDone
Reasoning summary text done.
Fields
ResponseError(ResponseErrorEvent)
Error event.
Other(Value)
Unknown event type. Contains the raw JSON data for forward compatibility.
Implementations§
Source§impl ResponseStreamEvent
impl ResponseStreamEvent
Sourcepub fn event_type(&self) -> &str
pub fn event_type(&self) -> &str
Get the event type string.
Trait Implementations§
Source§impl Clone for ResponseStreamEvent
impl Clone for ResponseStreamEvent
Source§fn clone(&self) -> ResponseStreamEvent
fn clone(&self) -> ResponseStreamEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseStreamEvent
impl Debug for ResponseStreamEvent
Source§impl<'de> Deserialize<'de> for ResponseStreamEvent
impl<'de> Deserialize<'de> for ResponseStreamEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResponseStreamEvent
impl RefUnwindSafe for ResponseStreamEvent
impl Send for ResponseStreamEvent
impl Sync for ResponseStreamEvent
impl Unpin for ResponseStreamEvent
impl UnsafeUnpin for ResponseStreamEvent
impl UnwindSafe for ResponseStreamEvent
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
Mutably borrows from an owned value. Read more