#[non_exhaustive]pub struct DocumentChunk {
pub parent: String,
pub id: String,
pub content: String,
pub document: Option<Document>,
pub relevance_score: Option<f64>,
/* private fields */
}Expand description
A DocumentChunk represents a piece of content from a
Document in the DeveloperKnowledge
corpus. To fetch the entire document content, pass the parent to
DeveloperKnowledge.GetDocument
or
DeveloperKnowledge.BatchGetDocuments.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent: StringOutput only. Contains the resource name of the document this chunk is from.
Format: documents/{uri_without_scheme}
Example: documents/docs.cloud.google.com/storage/docs/creating-buckets
id: StringOutput only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.
content: StringOutput only. Contains the content of the document chunk.
document: Option<Document>Output only. Represents metadata about the
Document this chunk is from. The
DocumentView of this
Document message will be set to
DOCUMENT_VIEW_BASIC. It is included here for convenience so that clients
do not need to call
DeveloperKnowledge.GetDocument
or
DeveloperKnowledge.BatchGetDocuments
if they only need the metadata fields. Otherwise, clients should use
DeveloperKnowledge.GetDocument
or
DeveloperKnowledge.BatchGetDocuments
to fetch the full document content.
relevance_score: Option<f64>Output only. Represents the relevance score of the chunk to the search query. Higher score indicates higher chunk relevance. The score is in range [0.0, 1.0].
Implementations§
Source§impl DocumentChunk
impl DocumentChunk
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> 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_document<T>(self, v: T) -> Self
pub fn set_document<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_document<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_document<T>(self, v: Option<T>) -> Self
Sourcepub fn set_relevance_score<T>(self, v: T) -> Self
pub fn set_relevance_score<T>(self, v: T) -> Self
Sets the value of relevance_score.
§Example
let x = DocumentChunk::new().set_relevance_score(42.0);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 = DocumentChunk::new().set_or_clear_relevance_score(Some(42.0));
let x = DocumentChunk::new().set_or_clear_relevance_score(None::<f32>);Trait Implementations§
Source§impl Clone for DocumentChunk
impl Clone for DocumentChunk
Source§fn clone(&self) -> DocumentChunk
fn clone(&self) -> DocumentChunk
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more