pub struct StreamingCompletionResponse {
pub usage: ResponsesUsage,
pub reasoning_metadata: Option<Map<String, Value>>,
pub reasoning_context: Option<String>,
pub status: Option<ResponseStatus>,
pub incomplete_details: Option<IncompleteDetailsReason>,
pub message_id: Option<String>,
pub response_id: Option<String>,
pub model: Option<String>,
pub provider_request_id: Option<String>,
}Expand description
The final streaming response from the OpenAI Responses API.
This is the provider-native terminal record carried by
[GenericResponsesCompletionModel::raw_stream]. The normalized path maps it
once, through crate::streaming::normalize_stream, into a
streaming::StreamFinal.
Fields§
§usage: ResponsesUsageToken usage
reasoning_metadata: Option<Map<String, Value>>The complete object-shaped reasoning metadata from the terminal response event.
reasoning_context: Option<String>The effective reasoning context from the terminal response event.
status: Option<ResponseStatus>The status reported by the terminal response.completed event.
incomplete_details: Option<IncompleteDetailsReason>Why the response stopped short, when the provider said so.
message_id: Option<String>The assistant message ID (msg_...) carried by the terminal response’s
output items.
Distinct from Self::response_id (resp_...), which names the whole
response.
response_id: Option<String>The response ID (resp_...) reported by the terminal
response.completed event.
model: Option<String>The model identifier reported by the terminal response event.
provider_request_id: Option<String>The transport request id from the SSE connection’s x-request-id
response header — not part of any stream frame; stamped by the
transport. None when the provider did not report one.
Implementations§
Source§impl StreamingCompletionResponse
impl StreamingCompletionResponse
Sourcepub fn new(usage: ResponsesUsage) -> Self
pub fn new(usage: ResponsesUsage) -> Self
Create a terminal record carrying only usage; the remaining metadata is
filled in from the terminal response.completed event as it arrives.
Trait Implementations§
Source§impl Clone for StreamingCompletionResponse
impl Clone for StreamingCompletionResponse
Source§fn clone(&self) -> StreamingCompletionResponse
fn clone(&self) -> StreamingCompletionResponse
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 StreamingCompletionResponse
impl Debug for StreamingCompletionResponse
Source§impl<'de> Deserialize<'de> for StreamingCompletionResponse
impl<'de> Deserialize<'de> for StreamingCompletionResponse
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 From<&StreamingCompletionResponse> for Usage
impl From<&StreamingCompletionResponse> for Usage
Source§fn from(response: &StreamingCompletionResponse) -> Self
fn from(response: &StreamingCompletionResponse) -> Self
Auto Trait Implementations§
impl Freeze for StreamingCompletionResponse
impl RefUnwindSafe for StreamingCompletionResponse
impl Send for StreamingCompletionResponse
impl Sync for StreamingCompletionResponse
impl Unpin for StreamingCompletionResponse
impl UnsafeUnpin for StreamingCompletionResponse
impl UnwindSafe for StreamingCompletionResponse
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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> 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