pub struct Choice {
pub finish_reason: String,
pub index: u64,
pub logprobs: Option<Value>,
pub message: Message,
}
Expand description
Represents a single choice in a chat completion response.
finish_reason
: The reason the generation finished, such as “stop” or “length”.index
: The index of the choice within the list of choices.logprobs
: Optional log probabilities for the tokens in the generated text.message
: The message associated with this choice, containing the role, content, and optional name.
Fields§
§finish_reason: String
§index: u64
§logprobs: Option<Value>
§message: Message
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
Auto Trait Implementations§
impl Freeze for Choice
impl RefUnwindSafe for Choice
impl Send for Choice
impl Sync for Choice
impl Unpin 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