#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GroundingSupport
impl Debug for GroundingSupport
Source§impl Default for GroundingSupport
impl Default for GroundingSupport
Source§fn default() -> GroundingSupport
fn default() -> GroundingSupport
Source§impl Message for GroundingSupport
impl Message for GroundingSupport
Source§impl PartialEq for GroundingSupport
impl PartialEq for GroundingSupport
impl StructuralPartialEq for GroundingSupport
Auto Trait Implementations§
impl Freeze for GroundingSupport
impl RefUnwindSafe for GroundingSupport
impl Send for GroundingSupport
impl Sync for GroundingSupport
impl Unpin for GroundingSupport
impl UnsafeUnpin for GroundingSupport
impl UnwindSafe for GroundingSupport
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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