#[non_exhaustive]pub struct AssistantGroundedContent {
pub content: Option<AssistantContent>,
pub metadata: Option<Metadata>,
/* private fields */
}Available on crate features
assistant-service or conversational-search-service or session-service only.Expand description
A piece of content and possibly its grounding information.
Not all content needs grounding. Phrases like “Of course, I will gladly search it for you.” do not need grounding.
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.content: Option<AssistantContent>The content.
metadata: Option<Metadata>Grounding metadata for various modals. It only supports text for now.
Implementations§
Source§impl AssistantGroundedContent
impl AssistantGroundedContent
pub fn new() -> Self
Sourcepub fn set_content<T>(self, v: T) -> Selfwhere
T: Into<AssistantContent>,
pub fn set_content<T>(self, v: T) -> Selfwhere
T: Into<AssistantContent>,
Sourcepub fn set_or_clear_content<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistantContent>,
pub fn set_or_clear_content<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssistantContent>,
Sets or clears the value of content.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::AssistantContent;
let x = AssistantGroundedContent::new().set_or_clear_content(Some(AssistantContent::default()/* use setters */));
let x = AssistantGroundedContent::new().set_or_clear_content(None::<AssistantContent>);Sourcepub fn set_metadata<T: Into<Option<Metadata>>>(self, v: T) -> Self
pub fn set_metadata<T: Into<Option<Metadata>>>(self, v: T) -> Self
Sets the value of metadata.
Note that all the setters affecting metadata are mutually
exclusive.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::assistant_grounded_content::TextGroundingMetadata;
let x = AssistantGroundedContent::new().set_metadata(Some(
google_cloud_discoveryengine_v1::model::assistant_grounded_content::Metadata::TextGroundingMetadata(TextGroundingMetadata::default().into())));Sourcepub fn text_grounding_metadata(&self) -> Option<&Box<TextGroundingMetadata>>
pub fn text_grounding_metadata(&self) -> Option<&Box<TextGroundingMetadata>>
The value of metadata
if it holds a TextGroundingMetadata, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_grounding_metadata<T: Into<Box<TextGroundingMetadata>>>(
self,
v: T,
) -> Self
pub fn set_text_grounding_metadata<T: Into<Box<TextGroundingMetadata>>>( self, v: T, ) -> Self
Sets the value of metadata
to hold a TextGroundingMetadata.
Note that all the setters affecting metadata are
mutually exclusive.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::assistant_grounded_content::TextGroundingMetadata;
let x = AssistantGroundedContent::new().set_text_grounding_metadata(TextGroundingMetadata::default()/* use setters */);
assert!(x.text_grounding_metadata().is_some());Trait Implementations§
Source§impl Clone for AssistantGroundedContent
impl Clone for AssistantGroundedContent
Source§fn clone(&self) -> AssistantGroundedContent
fn clone(&self) -> AssistantGroundedContent
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 AssistantGroundedContent
impl Debug for AssistantGroundedContent
Source§impl Default for AssistantGroundedContent
impl Default for AssistantGroundedContent
Source§fn default() -> AssistantGroundedContent
fn default() -> AssistantGroundedContent
Returns the “default value” for a type. Read more
Source§impl Message for AssistantGroundedContent
impl Message for AssistantGroundedContent
Source§impl PartialEq for AssistantGroundedContent
impl PartialEq for AssistantGroundedContent
impl StructuralPartialEq for AssistantGroundedContent
Auto Trait Implementations§
impl Freeze for AssistantGroundedContent
impl RefUnwindSafe for AssistantGroundedContent
impl Send for AssistantGroundedContent
impl Sync for AssistantGroundedContent
impl Unpin for AssistantGroundedContent
impl UnwindSafe for AssistantGroundedContent
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