pub struct ChatCompletionStreamOptionsVariant0 {
pub include_usage: Option<bool>,
pub include_obfuscation: Option<bool>,
}Expand description
Options for streaming response. Only set this when you set stream: true.
Fields§
§include_usage: Option<bool>If set, an additional chunk will be streamed before the data: [DONE]
message. The usage field on this chunk shows the token usage statistics
for the entire request, and the choices field will always be an empty
array.
All other chunks will also include a usage field, but with a null
value. NOTE: If the stream is interrupted, you may not receive the
final usage chunk which contains the total token usage for the request.
include_obfuscation: Option<bool>When true, stream obfuscation will be enabled. Stream obfuscation adds
random characters to an obfuscation field on streaming delta events to
normalize payload sizes as a mitigation to certain side-channel attacks.
These obfuscation fields are included by default, but add a small amount
of overhead to the data stream. You can set include_obfuscation to
false to optimize for bandwidth if you trust the network links between
your application and the OpenAI API.
Trait Implementations§
Source§impl Clone for ChatCompletionStreamOptionsVariant0
impl Clone for ChatCompletionStreamOptionsVariant0
Source§fn clone(&self) -> ChatCompletionStreamOptionsVariant0
fn clone(&self) -> ChatCompletionStreamOptionsVariant0
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for ChatCompletionStreamOptionsVariant0
impl<'de> Deserialize<'de> for ChatCompletionStreamOptionsVariant0
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<ChatCompletionStreamOptionsVariant0> for ChatCompletionStreamOptions
impl From<ChatCompletionStreamOptionsVariant0> for ChatCompletionStreamOptions
Source§fn from(value: ChatCompletionStreamOptionsVariant0) -> Self
fn from(value: ChatCompletionStreamOptionsVariant0) -> Self
Source§impl PartialEq for ChatCompletionStreamOptionsVariant0
impl PartialEq for ChatCompletionStreamOptionsVariant0
Source§fn eq(&self, other: &ChatCompletionStreamOptionsVariant0) -> bool
fn eq(&self, other: &ChatCompletionStreamOptionsVariant0) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ChatCompletionStreamOptionsVariant0
Auto Trait Implementations§
impl Freeze for ChatCompletionStreamOptionsVariant0
impl RefUnwindSafe for ChatCompletionStreamOptionsVariant0
impl Send for ChatCompletionStreamOptionsVariant0
impl Sync for ChatCompletionStreamOptionsVariant0
impl Unpin for ChatCompletionStreamOptionsVariant0
impl UnsafeUnpin for ChatCompletionStreamOptionsVariant0
impl UnwindSafe for ChatCompletionStreamOptionsVariant0
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,
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> 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