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,
Language = 6,
Other = 5,
Blocklist = 7,
ProhibitedContent = 8,
Spii = 9,
MalformedFunctionCall = 10,
}
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 response candidate content was flagged for safety reasons.
Recitation = 4
The response candidate content was flagged for recitation reasons.
Language = 6
The response candidate content was flagged for using an unsupported language.
Other = 5
Unknown reason.
Blocklist = 7
Token generation stopped because the content contains forbidden terms.
ProhibitedContent = 8
Token generation stopped for potentially containing prohibited content.
Spii = 9
Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
MalformedFunctionCall = 10
The function call generated by the model is invalid.
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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
source§impl From<FinishReason> for i32
impl From<FinishReason> for i32
source§fn from(value: FinishReason) -> i32
fn from(value: FinishReason) -> i32
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,
source§impl PartialEq for FinishReason
impl PartialEq for FinishReason
source§fn eq(&self, other: &FinishReason) -> bool
fn eq(&self, other: &FinishReason) -> bool
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
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for FinishReason
impl TryFrom<i32> for FinishReason
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
source§fn try_from(value: i32) -> Result<FinishReason, UnknownEnumValue>
fn try_from(value: i32) -> Result<FinishReason, UnknownEnumValue>
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
§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
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
§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
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>
T
in a tonic::Request