#[non_exhaustive]pub struct ChunkInfo {
pub chunk: String,
pub content: String,
pub relevance_score: Option<f32>,
pub document_metadata: Option<DocumentMetadata>,
/* private fields */
}Available on crate features
conversational-search-service or session-service only.Expand description
Chunk information.
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.chunk: StringChunk resource name.
content: StringChunk textual content.
relevance_score: Option<f32>The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
document_metadata: Option<DocumentMetadata>Document metadata.
Implementations§
Source§impl ChunkInfo
impl ChunkInfo
pub fn new() -> Self
Sourcepub fn set_content<T: Into<String>>(self, v: T) -> Self
pub fn set_content<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_relevance_score<T>(self, v: T) -> Self
pub fn set_relevance_score<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_relevance_score<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_relevance_score<T>(self, v: Option<T>) -> Self
Sets or clears the value of relevance_score.
§Example
ⓘ
let x = ChunkInfo::new().set_or_clear_relevance_score(Some(42.0));
let x = ChunkInfo::new().set_or_clear_relevance_score(None::<f32>);Sourcepub fn set_document_metadata<T>(self, v: T) -> Selfwhere
T: Into<DocumentMetadata>,
pub fn set_document_metadata<T>(self, v: T) -> Selfwhere
T: Into<DocumentMetadata>,
Sets the value of document_metadata.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::answer::reference::chunk_info::DocumentMetadata;
let x = ChunkInfo::new().set_document_metadata(DocumentMetadata::default()/* use setters */);Sourcepub fn set_or_clear_document_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<DocumentMetadata>,
pub fn set_or_clear_document_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<DocumentMetadata>,
Sets or clears the value of document_metadata.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::answer::reference::chunk_info::DocumentMetadata;
let x = ChunkInfo::new().set_or_clear_document_metadata(Some(DocumentMetadata::default()/* use setters */));
let x = ChunkInfo::new().set_or_clear_document_metadata(None::<DocumentMetadata>);Trait Implementations§
impl StructuralPartialEq for ChunkInfo
Auto Trait Implementations§
impl Freeze for ChunkInfo
impl RefUnwindSafe for ChunkInfo
impl Send for ChunkInfo
impl Sync for ChunkInfo
impl Unpin for ChunkInfo
impl UnwindSafe for ChunkInfo
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