#[non_exhaustive]pub struct CheckGroundingSpec {
pub citation_threshold: Option<f64>,
pub enable_claim_level_score: Option<bool>,
/* private fields */
}Available on crate feature
grounded-generation-service only.Expand description
Specification for the grounding check.
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.citation_threshold: Option<f64>The threshold (in [0,1]) used for determining whether a fact must be cited for a claim in the answer candidate. Choosing a higher threshold will lead to fewer but very strong citations, while choosing a lower threshold may lead to more but somewhat weaker citations. If unset, the threshold will default to 0.6.
enable_claim_level_score: Option<bool>The control flag that enables claim-level grounding score in the response.
Implementations§
Source§impl CheckGroundingSpec
impl CheckGroundingSpec
pub fn new() -> Self
Sourcepub fn set_citation_threshold<T>(self, v: T) -> Self
pub fn set_citation_threshold<T>(self, v: T) -> Self
Sets the value of citation_threshold.
§Example
ⓘ
let x = CheckGroundingSpec::new().set_citation_threshold(42.0);Sourcepub fn set_or_clear_citation_threshold<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_citation_threshold<T>(self, v: Option<T>) -> Self
Sets or clears the value of citation_threshold.
§Example
ⓘ
let x = CheckGroundingSpec::new().set_or_clear_citation_threshold(Some(42.0));
let x = CheckGroundingSpec::new().set_or_clear_citation_threshold(None::<f32>);Sourcepub fn set_enable_claim_level_score<T>(self, v: T) -> Self
pub fn set_enable_claim_level_score<T>(self, v: T) -> Self
Sets the value of enable_claim_level_score.
§Example
ⓘ
let x = CheckGroundingSpec::new().set_enable_claim_level_score(true);Sourcepub fn set_or_clear_enable_claim_level_score<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_enable_claim_level_score<T>(self, v: Option<T>) -> Self
Sets or clears the value of enable_claim_level_score.
§Example
ⓘ
let x = CheckGroundingSpec::new().set_or_clear_enable_claim_level_score(Some(false));
let x = CheckGroundingSpec::new().set_or_clear_enable_claim_level_score(None::<bool>);Trait Implementations§
Source§impl Clone for CheckGroundingSpec
impl Clone for CheckGroundingSpec
Source§fn clone(&self) -> CheckGroundingSpec
fn clone(&self) -> CheckGroundingSpec
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 CheckGroundingSpec
impl Debug for CheckGroundingSpec
Source§impl Default for CheckGroundingSpec
impl Default for CheckGroundingSpec
Source§fn default() -> CheckGroundingSpec
fn default() -> CheckGroundingSpec
Returns the “default value” for a type. Read more
Source§impl Message for CheckGroundingSpec
impl Message for CheckGroundingSpec
Source§impl PartialEq for CheckGroundingSpec
impl PartialEq for CheckGroundingSpec
impl StructuralPartialEq for CheckGroundingSpec
Auto Trait Implementations§
impl Freeze for CheckGroundingSpec
impl RefUnwindSafe for CheckGroundingSpec
impl Send for CheckGroundingSpec
impl Sync for CheckGroundingSpec
impl Unpin for CheckGroundingSpec
impl UnwindSafe for CheckGroundingSpec
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