pub struct ResponsesStreamEvent {
pub type: String,
pub sequence_number: u64,
pub response: Option<ResponsesResponse>,
pub output_index: Option<u32>,
pub item_id: Option<String>,
pub content_index: Option<u32>,
pub item: Option<ResponseItem>,
pub part: Option<ResponseContentPart>,
pub delta: Option<String>,
pub text: Option<String>,
pub arguments: Option<String>,
pub message: Option<String>,
}Expand description
One streaming SSE event. Unlike chat streaming there is NO data: \[DONE\] sentinel:
each frame is event: <type> + data: <json> where the JSON is self-describing via
type, and the stream ends after the terminal response.completed /
response.incomplete / response.failed event. This is a flat superset of every
event’s fields — type says which ones are meaningful; SDKs MUST ignore event types
they don’t recognise (the dialect grows by adding types).
Fields§
§type: String“response.created”, “response.output_text.delta”, …
sequence_number: u64§response: Option<ResponsesResponse>response.created/in_progress/completed/incomplete/failed
output_index: Option<u32>§item_id: Option<String>§content_index: Option<u32>§item: Option<ResponseItem>response.output_item.added/done
part: Option<ResponseContentPart>response.content_part.added/done
delta: Option<String>*.delta events (text / reasoning / arguments)
text: Option<String>response.output_text.done / reasoning_text.done
arguments: Option<String>response.function_call_arguments.done
message: Option<String>“error” event
Implementations§
Source§impl ResponsesStreamEvent
impl ResponsesStreamEvent
Sourcepub fn output_index(&self) -> u32
pub fn output_index(&self) -> u32
Returns the value of output_index, or the default value if output_index is unset.
Sourcepub fn item_id(&self) -> &str
pub fn item_id(&self) -> &str
Returns the value of item_id, or the default value if item_id is unset.
Sourcepub fn content_index(&self) -> u32
pub fn content_index(&self) -> u32
Returns the value of content_index, or the default value if content_index is unset.
Sourcepub fn delta(&self) -> &str
pub fn delta(&self) -> &str
Returns the value of delta, or the default value if delta is unset.
Trait Implementations§
Source§impl Clone for ResponsesStreamEvent
impl Clone for ResponsesStreamEvent
Source§fn clone(&self) -> ResponsesStreamEvent
fn clone(&self) -> ResponsesStreamEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResponsesStreamEvent
impl Debug for ResponsesStreamEvent
Source§impl Default for ResponsesStreamEvent
impl Default for ResponsesStreamEvent
Source§impl Message for ResponsesStreamEvent
impl Message for ResponsesStreamEvent
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.