pub struct EmbeddingVector {
pub data: Vec<f32>,
pub model_id: String,
pub dimensions: i32,
}Expand description
Embedding vector with dynamic dimensions. Supports any embedding model dimension (e.g., 384, 768, 1536, 3072).
Fields§
§data: Vec<f32>The embedding data as a vector of f32 values.
model_id: StringIdentifier of the model that produced this embedding.
dimensions: i32Number of dimensions (must match data.len()).
Implementations§
Source§impl EmbeddingVector
impl EmbeddingVector
Sourcepub fn cosine_similarity(&self, other: &EmbeddingVector) -> CellstateResult<f32>
pub fn cosine_similarity(&self, other: &EmbeddingVector) -> CellstateResult<f32>
Compute cosine similarity between two embedding vectors.
Trait Implementations§
Source§impl Clone for EmbeddingVector
impl Clone for EmbeddingVector
Source§fn clone(&self) -> EmbeddingVector
fn clone(&self) -> EmbeddingVector
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 ComposeSchema for EmbeddingVector
impl ComposeSchema for EmbeddingVector
Source§impl Debug for EmbeddingVector
impl Debug for EmbeddingVector
Source§impl<'de> Deserialize<'de> for EmbeddingVector
impl<'de> Deserialize<'de> for EmbeddingVector
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 EmbeddingVector
impl PartialEq for EmbeddingVector
Source§impl Serialize for EmbeddingVector
impl Serialize for EmbeddingVector
Source§impl ToSchema for EmbeddingVector
impl ToSchema for EmbeddingVector
impl StructuralPartialEq for EmbeddingVector
Auto Trait Implementations§
impl Freeze for EmbeddingVector
impl RefUnwindSafe for EmbeddingVector
impl Send for EmbeddingVector
impl Sync for EmbeddingVector
impl Unpin for EmbeddingVector
impl UnwindSafe for EmbeddingVector
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