pub struct Choice {
pub text: String,
pub index: i32,
pub logprobs: Option<Logprobs>,
pub finish_reason: Option<String>,
}
Expand description
Represents a single completion choice.
Contains the generated text and additional metadata.
Fields§
§text: String
The generated text.
index: i32
The index of this choice in the returned list.
logprobs: Option<Logprobs>
The log probabilities of the tokens, if requested.
finish_reason: Option<String>
The reason why the completion ended (e.g., “stop”, “length”).
Implementations§
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