pub struct ChatCompletionStreamOptions {
pub include_usage: Option<bool>,
}
Expand description
§on openapi.yaml
ChatCompletionStreamOptions:
description: >
Options for streaming response. Only set this when you set `stream:
true`.
type: object
nullable: true
default: null
properties:
include_usage:
type: boolean
description: >
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.
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.
Trait Implementations§
Source§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>,
Deserialize this value from the given Serde deserializer. Read more
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