pub struct StreamChoice {
pub index: Option<i32>,
pub delta: Option<Delta>,
pub finish_reason: Option<String>,
}Expand description
Represents a single choice within a streaming response chunk.
Each choice contains a delta with incremental content updates and metadata about the generation process.
§Fields
index- Position of this choice in the results arraydelta- Partial content update for this choicefinish_reason- Reason why generation stopped (on final chunk)
Fields§
§index: Option<i32>Index position of this choice in the results array.
delta: Option<Delta>Delta payload containing partial content updates.
This field contains the incremental content that should be appended to the accumulated response.
finish_reason: Option<String>Reason why the generation process finished.
This field typically appears only on the final chunk of a choice, indicating why generation stopped (e.g., “stop”, “length”, etc.).
Trait Implementations§
Source§impl Clone for StreamChoice
impl Clone for StreamChoice
Source§fn clone(&self) -> StreamChoice
fn clone(&self) -> StreamChoice
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 StreamChoice
impl Debug for StreamChoice
Source§impl<'de> Deserialize<'de> for StreamChoice
impl<'de> Deserialize<'de> for StreamChoice
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 StreamChoice
impl RefUnwindSafe for StreamChoice
impl Send for StreamChoice
impl Sync for StreamChoice
impl Unpin for StreamChoice
impl UnsafeUnpin for StreamChoice
impl UnwindSafe for StreamChoice
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