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,
MalformedFunctionCall = 9,
}
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
Token generation reached a natural stopping point or a configured stop sequence.
MaxTokens = 2
Token generation reached the configured maximum output tokens.
Safety = 3
Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][google.cloud.aiplatform.v1.Candidate.content] is empty if content filters blocks the output.
Recitation = 4
Token generation stopped because the content potentially contains copyright violations.
Other = 5
All other reasons that stopped the token generation.
Blocklist = 6
Token generation stopped because the content contains forbidden terms.
ProhibitedContent = 7
Token generation stopped for potentially containing prohibited content.
Spii = 8
Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII).
MalformedFunctionCall = 9
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