pub struct StreamingCompletionResponse {
pub usage: PartialUsage,
pub stop_reason: Option<String>,
pub stop_sequence: Option<String>,
pub message_id: Option<String>,
pub model: Option<String>,
pub provider_request_id: Option<String>,
}Expand description
Anthropic’s own terminal stream record, as returned by
[GenericCompletionModel::raw_stream].
crate::completion::CompletionModel::stream maps this once into the
normalized StreamFinal; callers who want the provider-native shape read
it here instead.
Fields§
§usage: PartialUsageToken usage carried by the terminal message_delta event.
stop_reason: Option<String>Anthropic’s stop_reason, verbatim, when the stream reported one.
stop_sequence: Option<String>Which of the caller’s stop_sequences actually fired, verbatim, when
the terminal message_delta reported one.
stop_reason: "stop_sequence" says only that a sequence matched;
the sequence itself is the part a caller branches on, and Anthropic
strips it from the text, so the wire is its only source. The blocking
twin has carried it on
CompletionResponse::stop_sequence
all along — the streamed record dropped it after parsing, so the same
request answered strictly less when streamed.
message_id: Option<String>The message_start message ID, when the stream reported one.
model: Option<String>The model named by message_start, when the stream reported one.
provider_request_id: Option<String>The transport request id from the SSE connection’s request-id
response header — not part of any stream frame; stamped by the
transport. None when the provider did not report one.
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 more