pub struct ChatCompletionStreamOptions {
pub include_usage: 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.
Implementations§
Trait Implementations§
Source§impl Clone for ChatCompletionStreamOptions
impl Clone for ChatCompletionStreamOptions
Source§fn clone(&self) -> ChatCompletionStreamOptions
fn clone(&self) -> ChatCompletionStreamOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ChatCompletionStreamOptions
impl Debug for ChatCompletionStreamOptions
Source§impl Default for ChatCompletionStreamOptions
impl Default for ChatCompletionStreamOptions
Source§fn default() -> ChatCompletionStreamOptions
fn default() -> ChatCompletionStreamOptions
Returns the “default value” for a type. Read more
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>,
Deserialize this value from the given Serde deserializer. Read more
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§
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
Mutably borrows from an owned value. Read more