#[non_exhaustive]pub struct ChatCompletionChunk {
pub moderation: Option<Option<ModerationResponse>>,
pub id: String,
pub choices: Vec<StreamChoice>,
pub created: i64,
pub model: String,
pub object: ChunkObject,
pub service_tier: Option<Option<ResponseServiceTier>>,
pub system_fingerprint: Option<Option<String>>,
pub usage: Option<Option<ChunkUsage>>,
pub obfuscation: Option<Option<String>>,
pub rest: Rest,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.moderation: Option<Option<ModerationResponse>>§id: String§choices: Vec<StreamChoice>§created: i64§model: String§object: ChunkObject§service_tier: Option<Option<ResponseServiceTier>>§system_fingerprint: Option<Option<String>>§usage: Option<Option<ChunkUsage>>§obfuscation: Option<Option<String>>§rest: RestImplementations§
Source§impl ChatCompletionChunk
impl ChatCompletionChunk
Sourcepub fn builder(
id: String,
choices: Vec<StreamChoice>,
created: i64,
model: String,
object: ChunkObject,
) -> ChatCompletionChunkBuilder
pub fn builder( id: String, choices: Vec<StreamChoice>, created: i64, model: String, object: ChunkObject, ) -> ChatCompletionChunkBuilder
Start a builder by supplying the required fields in declaration order.
Trait Implementations§
Source§impl Clone for ChatCompletionChunk
impl Clone for ChatCompletionChunk
Source§impl Debug for ChatCompletionChunk
impl Debug for ChatCompletionChunk
Source§impl DeclaredFields for ChatCompletionChunk
impl DeclaredFields for ChatCompletionChunk
fn into_declared(self) -> Self
Source§impl<'de> Deserialize<'de> for ChatCompletionChunk
impl<'de> Deserialize<'de> for ChatCompletionChunk
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
Source§impl FanoutEvent for ChatCompletionChunk
impl FanoutEvent for ChatCompletionChunk
fn project( &mut self, index: usize, id: &str, created: &mut Option<i64>, ) -> Result<(), TransformError>
fn aggregate( values: Vec<Self::Full>, id: String, report: &mut Report, ) -> Result<Self::Full, TransformError>
fn tail(value: &Self::Full, usage: bool) -> Result<Option<Self>, TransformError>
fn equivalent(a: &Self::Full, b: &Self::Full) -> bool
fn visible(&self) -> bool
Source§impl NativeEvent for ChatCompletionChunk
impl NativeEvent for ChatCompletionChunk
const DIALECT: Dialect = Dialect::OpenAiChat
const DONE: bool = true
type Full = GenerateContentResponseBody
type Collector = ChatCollector
fn collector( flow: IdentityFlow, policy: TargetIdPolicy, limits: EventLimits, ) -> Self::Collector
fn collect( collector: &mut Self::Collector, event: Self, ) -> Result<(), TransformError>
fn collect_done(collector: &mut Self::Collector) -> Result<(), TransformError>
fn collected( collector: Self::Collector, ) -> Result<Converted<Collected<Self::Full>>, TransformError>
fn event_name(&self) -> Option<&'static str>
fn is_terminal(&self) -> bool
fn is_usage_only(&self) -> bool
Source§fn tool_declarations(
&self,
complete_tool_names: bool,
) -> Vec<(String, ToolCallKind, Option<String>)>
fn tool_declarations( &self, complete_tool_names: bool, ) -> Vec<(String, ToolCallKind, Option<String>)>
Complete emitted ID, actual call kind, and complete name if already known.
fn responses_history( _value: &Self::Full, ) -> Option<&GenerateContentResponseBody>
Source§impl PartialEq for ChatCompletionChunk
impl PartialEq for ChatCompletionChunk
Source§impl Serialize for ChatCompletionChunk
impl Serialize for ChatCompletionChunk
impl StructuralPartialEq for ChatCompletionChunk
Auto Trait Implementations§
impl Freeze for ChatCompletionChunk
impl RefUnwindSafe for ChatCompletionChunk
impl Send for ChatCompletionChunk
impl Sync for ChatCompletionChunk
impl Unpin for ChatCompletionChunk
impl UnsafeUnpin for ChatCompletionChunk
impl UnwindSafe for ChatCompletionChunk
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