#[non_exhaustive]pub struct CheckGroundingResponse {
pub support_score: Option<f32>,
pub cited_chunks: Vec<FactChunk>,
pub cited_facts: Vec<CheckGroundingFactChunk>,
pub claims: Vec<Claim>,
/* private fields */
}Available on crate feature
grounded-generation-service only.Expand description
Response message for the GroundedGenerationService.CheckGrounding method.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.support_score: Option<f32>The support score for the input answer candidate. Higher the score, higher is the fraction of claims that are supported by the provided facts. This is always set when a response is returned.
cited_chunks: Vec<FactChunk>List of facts cited across all claims in the answer candidate. These are derived from the facts supplied in the request.
cited_facts: Vec<CheckGroundingFactChunk>List of facts cited across all claims in the answer candidate. These are derived from the facts supplied in the request.
claims: Vec<Claim>Claim texts and citation info across all claims in the answer candidate.
Implementations§
Source§impl CheckGroundingResponse
impl CheckGroundingResponse
pub fn new() -> Self
Sourcepub fn set_support_score<T>(self, v: T) -> Self
pub fn set_support_score<T>(self, v: T) -> Self
Sets the value of support_score.
§Example
ⓘ
let x = CheckGroundingResponse::new().set_support_score(42.0);Sourcepub fn set_or_clear_support_score<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_support_score<T>(self, v: Option<T>) -> Self
Sets or clears the value of support_score.
§Example
ⓘ
let x = CheckGroundingResponse::new().set_or_clear_support_score(Some(42.0));
let x = CheckGroundingResponse::new().set_or_clear_support_score(None::<f32>);Sourcepub fn set_cited_chunks<T, V>(self, v: T) -> Self
pub fn set_cited_chunks<T, V>(self, v: T) -> Self
Sets the value of cited_chunks.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::FactChunk;
let x = CheckGroundingResponse::new()
.set_cited_chunks([
FactChunk::default()/* use setters */,
FactChunk::default()/* use (different) setters */,
]);Sourcepub fn set_cited_facts<T, V>(self, v: T) -> Self
pub fn set_cited_facts<T, V>(self, v: T) -> Self
Sets the value of cited_facts.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::check_grounding_response::CheckGroundingFactChunk;
let x = CheckGroundingResponse::new()
.set_cited_facts([
CheckGroundingFactChunk::default()/* use setters */,
CheckGroundingFactChunk::default()/* use (different) setters */,
]);Sourcepub fn set_claims<T, V>(self, v: T) -> Self
pub fn set_claims<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for CheckGroundingResponse
impl Clone for CheckGroundingResponse
Source§fn clone(&self) -> CheckGroundingResponse
fn clone(&self) -> CheckGroundingResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CheckGroundingResponse
impl Debug for CheckGroundingResponse
Source§impl Default for CheckGroundingResponse
impl Default for CheckGroundingResponse
Source§fn default() -> CheckGroundingResponse
fn default() -> CheckGroundingResponse
Returns the “default value” for a type. Read more
Source§impl Message for CheckGroundingResponse
impl Message for CheckGroundingResponse
Source§impl PartialEq for CheckGroundingResponse
impl PartialEq for CheckGroundingResponse
impl StructuralPartialEq for CheckGroundingResponse
Auto Trait Implementations§
impl Freeze for CheckGroundingResponse
impl RefUnwindSafe for CheckGroundingResponse
impl Send for CheckGroundingResponse
impl Sync for CheckGroundingResponse
impl Unpin for CheckGroundingResponse
impl UnwindSafe for CheckGroundingResponse
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
Mutably borrows from an owned value. Read more