Struct anchor_chain::vector::document::Document   
source · pub struct Document {
    pub id: String,
    pub text: String,
    pub embedding: Option<Vec<f32>>,
    pub embedding_name: Option<String>,
    pub metadata: Option<Value>,
}Expand description
Document structure for serializing and deserializing when working with vector databases.
The id field is a unique identifier for the document. If not provided, it will be generated
using a hash of the text field. The text field is the main content of the document. The
embedding field is an optional field that can be used to store a vector embedding of the
document. The embedding_name field is the name of the field that the embedding is stored in.
The metadata field is an optional field that can be used to store additional metadata about
the document.
Fields§
§id: String§text: String§embedding: Option<Vec<f32>>§embedding_name: Option<String>§metadata: Option<Value>Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Document
 
impl<'de> Deserialize<'de> for Document
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 Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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