Struct rig::embeddings::DocumentEmbeddings
source · pub struct DocumentEmbeddings {
pub id: String,
pub document: Value,
pub embeddings: Vec<Embedding>,
}
Expand description
Struct that holds a document and its embeddings.
The struct is designed to model any kind of documents that can be serialized to JSON (including a simple string).
Moreover, it can hold multiple embeddings for the same document, thus allowing a large document to be retrieved from a query that matches multiple smaller and distinct text documents. For example, if the document is a textbook, a summary of each chapter could serve as the book’s embeddings.
Fields§
§id: String
§document: Value
§embeddings: Vec<Embedding>
Trait Implementations§
source§impl Clone for DocumentEmbeddings
impl Clone for DocumentEmbeddings
source§fn clone(&self) -> DocumentEmbeddings
fn clone(&self) -> DocumentEmbeddings
Returns a copy 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<'de> Deserialize<'de> for DocumentEmbeddings
impl<'de> Deserialize<'de> for DocumentEmbeddings
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
source§impl PartialEq for DocumentEmbeddings
impl PartialEq for DocumentEmbeddings
source§impl Serialize for DocumentEmbeddings
impl Serialize for DocumentEmbeddings
impl Eq for DocumentEmbeddings
impl StructuralPartialEq for DocumentEmbeddings
Auto Trait Implementations§
impl Freeze for DocumentEmbeddings
impl RefUnwindSafe for DocumentEmbeddings
impl Send for DocumentEmbeddings
impl Sync for DocumentEmbeddings
impl Unpin for DocumentEmbeddings
impl UnwindSafe for DocumentEmbeddings
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.