#[non_exhaustive]pub struct Answer {Show 14 fields
pub name: String,
pub state: State,
pub answer_text: String,
pub grounding_score: Option<f64>,
pub citations: Vec<Citation>,
pub grounding_supports: Vec<GroundingSupport>,
pub references: Vec<Reference>,
pub related_questions: Vec<String>,
pub steps: Vec<Step>,
pub query_understanding_info: Option<QueryUnderstandingInfo>,
pub answer_skipped_reasons: Vec<AnswerSkippedReason>,
pub create_time: Option<Timestamp>,
pub complete_time: Option<Timestamp>,
pub safety_ratings: Vec<SafetyRating>,
/* private fields */
}Expand description
Defines an answer.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringImmutable. Fully qualified name
projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*
state: StateThe state of the answer generation.
answer_text: StringThe textual answer.
grounding_score: Option<f64>A score in the range of [0, 1] describing how grounded the answer is by the reference chunks.
citations: Vec<Citation>Citations.
grounding_supports: Vec<GroundingSupport>Optional. Grounding supports.
references: Vec<Reference>References.
Suggested related questions.
steps: Vec<Step>Answer generation steps.
query_understanding_info: Option<QueryUnderstandingInfo>Query understanding information.
answer_skipped_reasons: Vec<AnswerSkippedReason>Additional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
create_time: Option<Timestamp>Output only. Answer creation timestamp.
complete_time: Option<Timestamp>Output only. Answer completed timestamp.
safety_ratings: Vec<SafetyRating>Optional. Safety ratings.
Implementations§
Source§impl Answer
impl Answer
pub fn new() -> Self
Sourcepub fn set_answer_text<T: Into<String>>(self, v: T) -> Self
pub fn set_answer_text<T: Into<String>>(self, v: T) -> Self
Sets the value of answer_text.
Sourcepub fn set_grounding_score<T>(self, v: T) -> Self
pub fn set_grounding_score<T>(self, v: T) -> Self
Sets the value of grounding_score.
Sourcepub fn set_or_clear_grounding_score<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_grounding_score<T>(self, v: Option<T>) -> Self
Sets or clears the value of grounding_score.
Sourcepub fn set_citations<T, V>(self, v: T) -> Self
pub fn set_citations<T, V>(self, v: T) -> Self
Sets the value of citations.
Sourcepub fn set_grounding_supports<T, V>(self, v: T) -> Self
pub fn set_grounding_supports<T, V>(self, v: T) -> Self
Sets the value of grounding_supports.
Sourcepub fn set_references<T, V>(self, v: T) -> Self
pub fn set_references<T, V>(self, v: T) -> Self
Sets the value of references.
Sets the value of related_questions.
Sourcepub fn set_query_understanding_info<T>(self, v: T) -> Selfwhere
T: Into<QueryUnderstandingInfo>,
pub fn set_query_understanding_info<T>(self, v: T) -> Selfwhere
T: Into<QueryUnderstandingInfo>,
Sets the value of query_understanding_info.
Sourcepub fn set_or_clear_query_understanding_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryUnderstandingInfo>,
pub fn set_or_clear_query_understanding_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryUnderstandingInfo>,
Sets or clears the value of query_understanding_info.
Sourcepub fn set_answer_skipped_reasons<T, V>(self, v: T) -> Self
pub fn set_answer_skipped_reasons<T, V>(self, v: T) -> Self
Sets the value of answer_skipped_reasons.
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
Sourcepub fn set_complete_time<T>(self, v: T) -> Self
pub fn set_complete_time<T>(self, v: T) -> Self
Sets the value of complete_time.
Sourcepub fn set_or_clear_complete_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_complete_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of complete_time.
Sourcepub fn set_safety_ratings<T, V>(self, v: T) -> Self
pub fn set_safety_ratings<T, V>(self, v: T) -> Self
Sets the value of safety_ratings.