pub struct ChatCompletionStreamOptions {
pub include_usage: Option<bool>,
pub include_obfuscation: Option<bool>,
}chat-completion-types only.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 ChatCompletionStreamOptions
impl Clone for ChatCompletionStreamOptions
Source§fn clone(&self) -> ChatCompletionStreamOptions
fn clone(&self) -> ChatCompletionStreamOptions
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChatCompletionStreamOptions
impl Debug for ChatCompletionStreamOptions
Source§impl<'de> Deserialize<'de> for ChatCompletionStreamOptions
impl<'de> Deserialize<'de> for ChatCompletionStreamOptions
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>,
impl Copy for ChatCompletionStreamOptions
impl StructuralPartialEq for ChatCompletionStreamOptions
Auto Trait Implementations§
impl Freeze for ChatCompletionStreamOptions
impl RefUnwindSafe for ChatCompletionStreamOptions
impl Send for ChatCompletionStreamOptions
impl Sync for ChatCompletionStreamOptions
impl Unpin for ChatCompletionStreamOptions
impl UnwindSafe for ChatCompletionStreamOptions
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)