#[non_exhaustive]pub struct GroundingSupport {
pub segment: Option<Segment>,
pub grounding_chunk_indices: Vec<i32>,
pub confidence_scores: Vec<f32>,
/* private fields */
}Available on crate feature
prediction-service only.Expand description
Grounding support.
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.segment: Option<Segment>Segment of the content this support belongs to.
grounding_chunk_indices: Vec<i32>A list of indices (into ‘grounding_chunk’) specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.
confidence_scores: Vec<f32>Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.
Implementations§
Source§impl GroundingSupport
impl GroundingSupport
pub fn new() -> Self
Sourcepub fn set_segment<T>(self, v: T) -> Self
pub fn set_segment<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_segment<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_segment<T>(self, v: Option<T>) -> Self
Sourcepub fn set_grounding_chunk_indices<T, V>(self, v: T) -> Self
pub fn set_grounding_chunk_indices<T, V>(self, v: T) -> Self
Sets the value of grounding_chunk_indices.
§Example
ⓘ
let x = GroundingSupport::new().set_grounding_chunk_indices([1, 2, 3]);Sourcepub fn set_confidence_scores<T, V>(self, v: T) -> Self
pub fn set_confidence_scores<T, V>(self, v: T) -> Self
Sets the value of confidence_scores.
§Example
ⓘ
let x = GroundingSupport::new().set_confidence_scores([1.0, 2.0, 3.0]);Trait Implementations§
Source§impl Clone for GroundingSupport
impl Clone for GroundingSupport
Source§fn clone(&self) -> GroundingSupport
fn clone(&self) -> GroundingSupport
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 GroundingSupport
impl Debug for GroundingSupport
Source§impl Default for GroundingSupport
impl Default for GroundingSupport
Source§fn default() -> GroundingSupport
fn default() -> GroundingSupport
Returns the “default value” for a type. Read more
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 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
Mutably borrows from an owned value. Read more