pub struct GroundingMetadata {
pub grounding_chunks: Vec<GroundingChunk>,
pub grounding_supports: Vec<GroundingSupport>,
pub web_search_queries: Vec<String>,
pub search_entry_point: Option<SearchEntryPoint>,
pub retrieval_metadata: Option<RetrievalMetadata>,
pub google_maps_widget_context_token: Option<String>,
pub retrieval_queries: Option<Vec<String>>,
pub source_flagging_uris: Option<Vec<GroundingMetadataSourceFlaggingUri>>,
}Expand description
Grounding 元数据。
Fields§
§grounding_chunks: Vec<GroundingChunk>§grounding_supports: Vec<GroundingSupport>§web_search_queries: Vec<String>§search_entry_point: Option<SearchEntryPoint>§retrieval_metadata: Option<RetrievalMetadata>§google_maps_widget_context_token: Option<String>§retrieval_queries: Option<Vec<String>>§source_flagging_uris: Option<Vec<GroundingMetadataSourceFlaggingUri>>Implementations§
Source§impl GroundingMetadata
impl GroundingMetadata
Sourcepub fn add_citations(&self, text: &str) -> String
pub fn add_citations(&self, text: &str) -> String
生成带内联引用的文本(使用 grounding_supports 的 segment.end_index 位置插入引用序号)。
Sourcepub fn citation_uris(&self) -> Vec<String>
pub fn citation_uris(&self) -> Vec<String>
提取引用链接(按照 grounding_chunks 顺序去重)。
Trait Implementations§
Source§impl Clone for GroundingMetadata
impl Clone for GroundingMetadata
Source§fn clone(&self) -> GroundingMetadata
fn clone(&self) -> GroundingMetadata
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 GroundingMetadata
impl Debug for GroundingMetadata
Source§impl Default for GroundingMetadata
impl Default for GroundingMetadata
Source§fn default() -> GroundingMetadata
fn default() -> GroundingMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GroundingMetadata
impl<'de> Deserialize<'de> for GroundingMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GroundingMetadata
impl RefUnwindSafe for GroundingMetadata
impl Send for GroundingMetadata
impl Sync for GroundingMetadata
impl Unpin for GroundingMetadata
impl UnsafeUnpin for GroundingMetadata
impl UnwindSafe for GroundingMetadata
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