pub struct StreamResponse {
pub id: String,
pub choices: Vec<CreateChatCompletionStreamResponseChoicesInner>,
pub created: i32,
pub model: String,
pub service_tier: Option<Option<ServiceTier>>,
pub system_fingerprint: Option<String>,
pub object: Object,
pub usage: Option<Box<CompletionUsage>>,
}Expand description
Re-export commonly used types from openai-client-base for convenience CreateChatCompletionStreamResponse : Represents a streamed chunk of a chat completion response returned by the model, based on the provided input. Learn more.
Fields§
§id: StringA unique identifier for the chat completion. Each chunk has the same ID.
choices: Vec<CreateChatCompletionStreamResponseChoicesInner>A list of chat completion choices. Can contain more than one elements if n is greater than 1. Can also be empty for the last chunk if you set stream_options: {\"include_usage\": true}.
created: i32The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
model: StringThe model to generate the completion.
service_tier: Option<Option<ServiceTier>>§system_fingerprint: Option<String>This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
object: ObjectThe object type, which is always chat.completion.chunk.
usage: Option<Box<CompletionUsage>>Implementations§
Source§impl CreateChatCompletionStreamResponse
impl CreateChatCompletionStreamResponse
Sourcepub fn builder() -> CreateChatCompletionStreamResponseBuilder
pub fn builder() -> CreateChatCompletionStreamResponseBuilder
Create an instance of CreateChatCompletionStreamResponse using the builder syntax
Source§impl CreateChatCompletionStreamResponse
impl CreateChatCompletionStreamResponse
Sourcepub fn new(
id: String,
choices: Vec<CreateChatCompletionStreamResponseChoicesInner>,
created: i32,
model: String,
object: Object,
) -> CreateChatCompletionStreamResponse
pub fn new( id: String, choices: Vec<CreateChatCompletionStreamResponseChoicesInner>, created: i32, model: String, object: Object, ) -> CreateChatCompletionStreamResponse
Represents a streamed chunk of a chat completion response returned by the model, based on the provided input. Learn more.
Trait Implementations§
Source§impl Clone for CreateChatCompletionStreamResponse
impl Clone for CreateChatCompletionStreamResponse
Source§fn clone(&self) -> CreateChatCompletionStreamResponse
fn clone(&self) -> CreateChatCompletionStreamResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for CreateChatCompletionStreamResponse
impl Default for CreateChatCompletionStreamResponse
Source§fn default() -> CreateChatCompletionStreamResponse
fn default() -> CreateChatCompletionStreamResponse
Source§impl<'de> Deserialize<'de> for CreateChatCompletionStreamResponse
impl<'de> Deserialize<'de> for CreateChatCompletionStreamResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateChatCompletionStreamResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateChatCompletionStreamResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CreateChatCompletionStreamResponse
impl PartialEq for CreateChatCompletionStreamResponse
Source§fn eq(&self, other: &CreateChatCompletionStreamResponse) -> bool
fn eq(&self, other: &CreateChatCompletionStreamResponse) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CreateChatCompletionStreamResponse
impl Serialize for CreateChatCompletionStreamResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CreateChatCompletionStreamResponse
Auto Trait Implementations§
impl Freeze for CreateChatCompletionStreamResponse
impl RefUnwindSafe for CreateChatCompletionStreamResponse
impl Send for CreateChatCompletionStreamResponse
impl Sync for CreateChatCompletionStreamResponse
impl Unpin for CreateChatCompletionStreamResponse
impl UnwindSafe for CreateChatCompletionStreamResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.