pub enum TextGeneratorResult {
Token(TextProbability),
Finish(FinishReason),
}
Expand description
Enumerates possible results from a text generation process.
This enum is used to encapsulate the outcomes of text generation, including both the generation of a new token and the conclusion of the generation process.
Variants§
Token(TextProbability)
Represents a generated piece of text along with its probability.
The String
is the generated text, and the f32
is the probability associated with it.
Finish(FinishReason)
Indicates the completion of the text generation process.
This variant is used when the generation process reaches an end, either due to reaching a specified limit or encountering a stopping condition.
Trait Implementations§
source§impl Debug for TextGeneratorResult
impl Debug for TextGeneratorResult
source§impl PartialEq for TextGeneratorResult
impl PartialEq for TextGeneratorResult
source§fn eq(&self, other: &TextGeneratorResult) -> bool
fn eq(&self, other: &TextGeneratorResult) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TextGeneratorResult
Auto Trait Implementations§
impl RefUnwindSafe for TextGeneratorResult
impl Send for TextGeneratorResult
impl Sync for TextGeneratorResult
impl Unpin for TextGeneratorResult
impl UnwindSafe for TextGeneratorResult
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