#[non_exhaustive]pub struct ChunkContent {
pub content: String,
pub page_identifier: String,
pub relevance_score: Option<f32>,
/* private fields */
}Available on crate features
conversational-search-service or session-service only.Expand description
Chunk content.
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: StringChunk textual content.
page_identifier: StringPage identifier.
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.
Implementations§
Source§impl ChunkContent
impl ChunkContent
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_page_identifier<T: Into<String>>(self, v: T) -> Self
pub fn set_page_identifier<T: Into<String>>(self, v: T) -> Self
Sets the value of page_identifier.
§Example
ⓘ
let x = ChunkContent::new().set_page_identifier("example");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 = ChunkContent::new().set_or_clear_relevance_score(Some(42.0));
let x = ChunkContent::new().set_or_clear_relevance_score(None::<f32>);Trait Implementations§
Source§impl Clone for ChunkContent
impl Clone for ChunkContent
Source§fn clone(&self) -> ChunkContent
fn clone(&self) -> ChunkContent
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 ChunkContent
impl Debug for ChunkContent
Source§impl Default for ChunkContent
impl Default for ChunkContent
Source§fn default() -> ChunkContent
fn default() -> ChunkContent
Returns the “default value” for a type. Read more
Source§impl Message for ChunkContent
impl Message for ChunkContent
Source§impl PartialEq for ChunkContent
impl PartialEq for ChunkContent
impl StructuralPartialEq for ChunkContent
Auto Trait Implementations§
impl Freeze for ChunkContent
impl RefUnwindSafe for ChunkContent
impl Send for ChunkContent
impl Sync for ChunkContent
impl Unpin for ChunkContent
impl UnwindSafe for ChunkContent
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