Enum google_api_proto::google::cloud::aiplatform::v1::candidate::FinishReason
source · #[repr(i32)]pub enum FinishReason {
Unspecified = 0,
Stop = 1,
MaxTokens = 2,
Safety = 3,
Recitation = 4,
Other = 5,
Blocklist = 6,
ProhibitedContent = 7,
Spii = 8,
}
Expand description
The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
Variants§
Unspecified = 0
The finish reason is unspecified.
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 token generation was stopped as the response was flagged for safety reasons. NOTE: When streaming the Candidate.content will be empty if content filters blocked the output.
Recitation = 4
The token generation was stopped as the response was flagged for unauthorized citations.
Other = 5
All other reasons that stopped the token generation
Blocklist = 6
The token generation was stopped as the response was flagged for the terms which are included from the terminology blocklist.
ProhibitedContent = 7
The token generation was stopped as the response was flagged for the prohibited contents.
Spii = 8
The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents.
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 = DecodeError
type Error = DecodeError
source§fn try_from(value: i32) -> Result<FinishReason, DecodeError>
fn try_from(value: i32) -> Result<FinishReason, DecodeError>
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