pub struct Choice {
pub index: u32,
pub message: Option<Message>,
pub delta: Option<Delta>,
pub finish_reason: Option<String>,
pub native_finish_reason: Option<String>,
pub logprobs: Option<LogProbs>,
}Expand description
One choice in a chat-completions response (also used for streaming chunks).
Fields§
§index: u32Choice index within the response.
message: Option<Message>Full message (non-streaming) or final reconciled message.
delta: Option<Delta>Incremental delta (streaming chunks).
finish_reason: Option<String>Why generation stopped (stop, length, tool_calls, …).
native_finish_reason: Option<String>Provider-native finish reason, when different.
logprobs: Option<LogProbs>Token-level log probabilities, when requested.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Choice
impl<'de> Deserialize<'de> for Choice
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
impl StructuralPartialEq for Choice
Auto Trait Implementations§
impl Freeze for Choice
impl RefUnwindSafe for Choice
impl Send for Choice
impl Sync for Choice
impl Unpin for Choice
impl UnsafeUnpin for Choice
impl UnwindSafe for Choice
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