pub struct EmbeddingRecord {
pub id: Uuid,
pub session_id: Option<Uuid>,
pub model: String,
pub vector: Vec<f32>,
pub metadata: Value,
pub created_at: DateTime<Utc>,
}Expand description
Embedding record with a dense vector and associated metadata.
Fields§
§id: UuidUnique record identifier.
session_id: Option<Uuid>Optional session association.
model: StringModel that produced the embedding.
vector: Vec<f32>Dense embedding vector (list of f32 components).
metadata: ValueApplication-specific metadata.
created_at: DateTime<Utc>When the record was created.
Implementations§
Source§impl EmbeddingRecord
impl EmbeddingRecord
Sourcepub fn new(model: impl Into<String>, vector: Vec<f32>) -> Self
pub fn new(model: impl Into<String>, vector: Vec<f32>) -> Self
Creates a new embedding record with a generated UUIDv7 ID and current timestamp.
session_id and metadata are initialized to None and Value::Null respectively.
Sourcepub fn with_session(self, session_id: Uuid) -> Self
pub fn with_session(self, session_id: Uuid) -> Self
Associates this embedding record with a session, consuming and returning self.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Sets metadata on the embedding record, consuming and returning self.
Trait Implementations§
Source§impl Clone for EmbeddingRecord
impl Clone for EmbeddingRecord
Source§fn clone(&self) -> EmbeddingRecord
fn clone(&self) -> EmbeddingRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EmbeddingRecord
impl Debug for EmbeddingRecord
Source§impl<'de> Deserialize<'de> for EmbeddingRecord
impl<'de> Deserialize<'de> for EmbeddingRecord
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 EmbeddingRecord
impl PartialEq for EmbeddingRecord
Source§fn eq(&self, other: &EmbeddingRecord) -> bool
fn eq(&self, other: &EmbeddingRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EmbeddingRecord
impl Serialize for EmbeddingRecord
impl StructuralPartialEq for EmbeddingRecord
Auto Trait Implementations§
impl Freeze for EmbeddingRecord
impl RefUnwindSafe for EmbeddingRecord
impl Send for EmbeddingRecord
impl Sync for EmbeddingRecord
impl Unpin for EmbeddingRecord
impl UnsafeUnpin for EmbeddingRecord
impl UnwindSafe for EmbeddingRecord
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