#[non_exhaustive]pub struct CheckGroundingRequest {
pub grounding_config: String,
pub answer_candidate: String,
pub facts: Vec<GroundingFact>,
pub grounding_spec: Option<CheckGroundingSpec>,
pub user_labels: HashMap<String, String>,
/* private fields */
}Available on crate feature
grounded-generation-service only.Expand description
Request message for 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.grounding_config: StringRequired. The resource name of the grounding config, such as
projects/*/locations/global/groundingConfigs/default_grounding_config.
answer_candidate: StringAnswer candidate to check. It can have a maximum length of 4096 tokens.
facts: Vec<GroundingFact>List of facts for the grounding check. We support up to 200 facts.
grounding_spec: Option<CheckGroundingSpec>Configuration of the grounding check.
user_labels: HashMap<String, String>The user labels applied to a resource must meet the following requirements:
- Each resource can have multiple labels, up to a maximum of 64.
- Each label must be a key-value pair.
- Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
- The key portion of a label must be unique. However, you can use the same key with multiple resources.
- Keys must start with a lowercase letter or international character.
See Google Cloud Document for more details.
Implementations§
Source§impl CheckGroundingRequest
impl CheckGroundingRequest
pub fn new() -> Self
Sourcepub fn set_grounding_config<T: Into<String>>(self, v: T) -> Self
pub fn set_grounding_config<T: Into<String>>(self, v: T) -> Self
Sets the value of grounding_config.
§Example
ⓘ
let x = CheckGroundingRequest::new().set_grounding_config("example");Sourcepub fn set_answer_candidate<T: Into<String>>(self, v: T) -> Self
pub fn set_answer_candidate<T: Into<String>>(self, v: T) -> Self
Sets the value of answer_candidate.
§Example
ⓘ
let x = CheckGroundingRequest::new().set_answer_candidate("example");Sourcepub fn set_grounding_spec<T>(self, v: T) -> Selfwhere
T: Into<CheckGroundingSpec>,
pub fn set_grounding_spec<T>(self, v: T) -> Selfwhere
T: Into<CheckGroundingSpec>,
Sets the value of grounding_spec.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::CheckGroundingSpec;
let x = CheckGroundingRequest::new().set_grounding_spec(CheckGroundingSpec::default()/* use setters */);Sourcepub fn set_or_clear_grounding_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<CheckGroundingSpec>,
pub fn set_or_clear_grounding_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<CheckGroundingSpec>,
Sets or clears the value of grounding_spec.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::CheckGroundingSpec;
let x = CheckGroundingRequest::new().set_or_clear_grounding_spec(Some(CheckGroundingSpec::default()/* use setters */));
let x = CheckGroundingRequest::new().set_or_clear_grounding_spec(None::<CheckGroundingSpec>);Sourcepub fn set_user_labels<T, K, V>(self, v: T) -> Self
pub fn set_user_labels<T, K, V>(self, v: T) -> Self
Sets the value of user_labels.
§Example
ⓘ
let x = CheckGroundingRequest::new().set_user_labels([
("key0", "abc"),
("key1", "xyz"),
]);Trait Implementations§
Source§impl Clone for CheckGroundingRequest
impl Clone for CheckGroundingRequest
Source§fn clone(&self) -> CheckGroundingRequest
fn clone(&self) -> CheckGroundingRequest
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 CheckGroundingRequest
impl Debug for CheckGroundingRequest
Source§impl Default for CheckGroundingRequest
impl Default for CheckGroundingRequest
Source§fn default() -> CheckGroundingRequest
fn default() -> CheckGroundingRequest
Returns the “default value” for a type. Read more
Source§impl Message for CheckGroundingRequest
impl Message for CheckGroundingRequest
Source§impl PartialEq for CheckGroundingRequest
impl PartialEq for CheckGroundingRequest
impl StructuralPartialEq for CheckGroundingRequest
Auto Trait Implementations§
impl Freeze for CheckGroundingRequest
impl RefUnwindSafe for CheckGroundingRequest
impl Send for CheckGroundingRequest
impl Sync for CheckGroundingRequest
impl Unpin for CheckGroundingRequest
impl UnwindSafe for CheckGroundingRequest
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