pub struct ChatCompletionChunk {
pub id: String,
pub object: String,
pub created: u64,
pub model: String,
pub choices: Vec<ChunkChoice>,
pub usage: Option<Usage>,
pub system_fingerprint: Option<String>,
}Fields§
§id: String§object: String§created: u64§model: String§choices: Vec<ChunkChoice>§usage: Option<Usage>§system_fingerprint: Option<String>Implementations§
Source§impl ChatCompletionChunk
impl ChatCompletionChunk
Sourcepub fn content(&self) -> Option<&str>
pub fn content(&self) -> Option<&str>
Text delta from the first choice, if non-empty.
Empty-string deltas (keepalives, boundary markers) collapse to None.
Sourcepub fn reasoning_content(&self) -> Option<&str>
pub fn reasoning_content(&self) -> Option<&str>
Reasoning-content delta from the first choice, if non-empty.
Empty-string deltas collapse to None.
Sourcepub fn tool_calls(&self) -> &[ToolCallDelta]
pub fn tool_calls(&self) -> &[ToolCallDelta]
Tool-call deltas from the first choice. Empty slice if none.
Sourcepub fn finish_reason(&self) -> Option<&FinishReason>
pub fn finish_reason(&self) -> Option<&FinishReason>
Finish reason from the first choice, if present.
Trait Implementations§
Source§impl Clone for ChatCompletionChunk
impl Clone for ChatCompletionChunk
Source§fn clone(&self) -> ChatCompletionChunk
fn clone(&self) -> ChatCompletionChunk
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 ChatCompletionChunk
impl Debug for ChatCompletionChunk
Source§impl Default for ChatCompletionChunk
impl Default for ChatCompletionChunk
Source§fn default() -> ChatCompletionChunk
fn default() -> ChatCompletionChunk
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ChatCompletionChunk
impl<'de> Deserialize<'de> for ChatCompletionChunk
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChatCompletionChunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChatCompletionChunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ChatCompletionChunk
impl Serialize for ChatCompletionChunk
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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