pub struct Chunk {
pub id: String,
pub text: String,
pub embedding: Vec<f32>,
pub metadata: HashMap<String, String>,
pub document_id: String,
}Expand description
A segment of a Document with its vector embedding.
Fields§
§id: StringUnique identifier for the chunk.
text: StringThe text content of the chunk.
embedding: Vec<f32>The vector embedding for this chunk’s text.
metadata: HashMap<String, String>Key-value metadata inherited from the parent document plus chunk-specific fields.
document_id: StringThe ID of the parent Document.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chunk
impl<'de> Deserialize<'de> for Chunk
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
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnsafeUnpin for Chunk
impl UnwindSafe for Chunk
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