pub struct StreamOptions {
pub include_obfuscation: bool,
pub include_usage: bool,
}Fields§
§include_obfuscation: boolWhen 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.
include_usage: boolIf 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 Clone for StreamOptions
impl Clone for StreamOptions
Source§fn clone(&self) -> StreamOptions
fn clone(&self) -> StreamOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more