pub struct ResponseStreamEvent {
pub content_index: Option<i64>,
pub delta: Option<String>,
pub item_id: Option<String>,
pub output_index: Option<i64>,
pub response: Option<Response>,
pub sequence_number: Option<i64>,
pub text: Option<String>,
pub type_: String,
}Expand description
A server-sent event emitted while streaming a response. The Responses API emits a sequence of typed events (for example response.created, response.output_text.delta, and response.completed). This schema models the common event envelope; which fields are populated depends on the event type.
JSON schema
{
"description": "A server-sent event emitted while streaming a response. The Responses API emits a sequence of typed events (for example `response.created`, `response.output_text.delta`, and `response.completed`). This schema models the common event envelope; which fields are populated depends on the event `type`.\n",
"type": "object",
"required": [
"type"
],
"properties": {
"content_index": {
"description": "The index of the content part within the output item.",
"type": "integer"
},
"delta": {
"description": "The incremental text delta for `*.delta` events.",
"type": "string"
},
"item_id": {
"description": "The ID of the output item this event relates to.",
"type": "string"
},
"output_index": {
"description": "The index of the output item in the response's output array.",
"type": "integer"
},
"response": {
"$ref": "#/definitions/Response"
},
"sequence_number": {
"description": "The sequence number of this event.",
"type": "integer"
},
"text": {
"description": "The finalized text for `*.done` events.",
"type": "string"
},
"type": {
"description": "The type of the streamed event, for example `response.output_text.delta` or `response.completed`.\n",
"type": "string"
}
}
}Fields§
§content_index: Option<i64>The index of the content part within the output item.
delta: Option<String>The incremental text delta for *.delta events.
item_id: Option<String>The ID of the output item this event relates to.
output_index: Option<i64>The index of the output item in the response’s output array.
response: Option<Response>§sequence_number: Option<i64>The sequence number of this event.
text: Option<String>The finalized text for *.done events.
type_: StringThe type of the streamed event, for example response.output_text.delta or response.completed.
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