Enum google_api_proto::google::ai::generativelanguage::v1beta::candidate::FinishReason
source · #[repr(i32)]pub enum FinishReason {
Unspecified = 0,
Stop = 1,
MaxTokens = 2,
Safety = 3,
Recitation = 4,
Other = 5,
}
Expand description
Defines the reason why the model stopped generating tokens.
Variants§
Unspecified = 0
Default value. This value is unused.
Stop = 1
Natural stop point of the model or provided stop sequence.
MaxTokens = 2
The maximum number of tokens as specified in the request was reached.
Safety = 3
The candidate content was flagged for safety reasons.
Recitation = 4
The candidate content was flagged for recitation reasons.
Other = 5
Unknown reason.
Implementations§
source§impl FinishReason
impl FinishReason
source§impl FinishReason
impl FinishReason
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for FinishReason
impl Clone for FinishReason
source§fn clone(&self) -> FinishReason
fn clone(&self) -> FinishReason
Returns a copy 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 FinishReason
impl Debug for FinishReason
source§impl Default for FinishReason
impl Default for FinishReason
source§fn default() -> FinishReason
fn default() -> FinishReason
Returns the “default value” for a type. Read more
source§impl From<FinishReason> for i32
impl From<FinishReason> for i32
source§fn from(value: FinishReason) -> i32
fn from(value: FinishReason) -> i32
Converts to this type from the input type.
source§impl Hash for FinishReason
impl Hash for FinishReason
source§impl Ord for FinishReason
impl Ord for FinishReason
source§fn cmp(&self, other: &FinishReason) -> Ordering
fn cmp(&self, other: &FinishReason) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for FinishReason
impl PartialEq for FinishReason
source§fn eq(&self, other: &FinishReason) -> bool
fn eq(&self, other: &FinishReason) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FinishReason
impl PartialOrd for FinishReason
source§fn partial_cmp(&self, other: &FinishReason) -> Option<Ordering>
fn partial_cmp(&self, other: &FinishReason) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for FinishReason
impl TryFrom<i32> for FinishReason
§type Error = DecodeError
type Error = DecodeError
The type returned in the event of a conversion error.
source§fn try_from(value: i32) -> Result<FinishReason, DecodeError>
fn try_from(value: i32) -> Result<FinishReason, DecodeError>
Performs the conversion.
impl Copy for FinishReason
impl Eq for FinishReason
impl StructuralPartialEq for FinishReason
Auto Trait Implementations§
impl Freeze for FinishReason
impl RefUnwindSafe for FinishReason
impl Send for FinishReason
impl Sync for FinishReason
impl Unpin for FinishReason
impl UnwindSafe for FinishReason
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request