#[non_exhaustive]pub struct GroundingSupport {
pub start_index: i64,
pub end_index: i64,
pub grounding_score: Option<f64>,
pub grounding_check_required: Option<bool>,
pub sources: Vec<CitationSource>,
/* private fields */
}conversational-search-service or session-service only.Expand description
Grounding support for a claim in answer_text.
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.start_index: i64Required. Index indicates the start of the claim, measured in bytes (UTF-8 unicode).
end_index: i64Required. End of the claim, exclusive.
grounding_score: Option<f64>A score in the range of [0, 1] describing how grounded is a specific claim by the references. Higher value means that the claim is better supported by the reference chunks.
grounding_check_required: Option<bool>Indicates that this claim required grounding check. When the
system decided this claim didn’t require attribution/grounding check,
this field is set to false. In that case, no grounding check was
done for the claim and therefore grounding_score, sources is not
returned.
sources: Vec<CitationSource>Optional. Citation sources for the claim.
Implementations§
Source§impl GroundingSupport
impl GroundingSupport
pub fn new() -> Self
Sourcepub fn set_start_index<T: Into<i64>>(self, v: T) -> Self
pub fn set_start_index<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_end_index<T: Into<i64>>(self, v: T) -> Self
pub fn set_end_index<T: Into<i64>>(self, v: T) -> Self
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.
§Example
let x = GroundingSupport::new().set_grounding_score(42.0);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.
§Example
let x = GroundingSupport::new().set_or_clear_grounding_score(Some(42.0));
let x = GroundingSupport::new().set_or_clear_grounding_score(None::<f32>);Sourcepub fn set_grounding_check_required<T>(self, v: T) -> Self
pub fn set_grounding_check_required<T>(self, v: T) -> Self
Sets the value of grounding_check_required.
§Example
let x = GroundingSupport::new().set_grounding_check_required(true);Sourcepub fn set_or_clear_grounding_check_required<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_grounding_check_required<T>(self, v: Option<T>) -> Self
Sets or clears the value of grounding_check_required.
§Example
let x = GroundingSupport::new().set_or_clear_grounding_check_required(Some(false));
let x = GroundingSupport::new().set_or_clear_grounding_check_required(None::<bool>);Sourcepub fn set_sources<T, V>(self, v: T) -> Self
pub fn set_sources<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for GroundingSupport
impl Clone for GroundingSupport
Source§fn clone(&self) -> GroundingSupport
fn clone(&self) -> GroundingSupport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more