Struct google_api_proto::google::cloud::aiplatform::v1beta1::Candidate
source · pub struct Candidate {
pub index: i32,
pub content: Option<Content>,
pub avg_logprobs: f64,
pub finish_reason: i32,
pub safety_ratings: Vec<SafetyRating>,
pub finish_message: Option<String>,
pub citation_metadata: Option<CitationMetadata>,
pub grounding_metadata: Option<GroundingMetadata>,
}
Expand description
A response candidate generated from the model.
Fields§
§index: i32
Output only. Index of the candidate.
content: Option<Content>
Output only. Content parts of the candidate.
avg_logprobs: f64
Output only. Average log probability score of the candidate.
finish_reason: i32
Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
safety_ratings: Vec<SafetyRating>
Output only. List of ratings for the safety of a response candidate.
There is at most one rating per category.
finish_message: Option<String>
Output only. Describes the reason the mode stopped generating tokens in
more detail. This is only filled when finish_reason
is set.
citation_metadata: Option<CitationMetadata>
Output only. Source attribution of the generated content.
grounding_metadata: Option<GroundingMetadata>
Output only. Metadata specifies sources used to ground generated content.
Implementations§
source§impl Candidate
impl Candidate
sourcepub fn finish_reason(&self) -> FinishReason
pub fn finish_reason(&self) -> FinishReason
Returns the enum value of finish_reason
, or the default if the field is set to an invalid enum value.
sourcepub fn set_finish_reason(&mut self, value: FinishReason)
pub fn set_finish_reason(&mut self, value: FinishReason)
Sets finish_reason
to the provided enum value.
sourcepub fn finish_message(&self) -> &str
pub fn finish_message(&self) -> &str
Returns the value of finish_message
, or the default value if finish_message
is unset.
Trait Implementations§
source§impl Message for Candidate
impl Message for Candidate
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Candidate
impl PartialEq for Candidate
impl StructuralPartialEq for Candidate
Auto Trait Implementations§
impl !Freeze for Candidate
impl RefUnwindSafe for Candidate
impl Send for Candidate
impl Sync for Candidate
impl Unpin for Candidate
impl UnwindSafe for Candidate
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<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