pub fn cosine_similarity(a: &[f32], b: &[f32]) -> f32Expand description
Compute cosine similarity between two embedding vectors.
Returns a value in [-1.0, 1.0]:
1.0= identical direction0.0= orthogonal (unrelated)-1.0= opposite direction
Returns 0.0 for empty vectors or vectors of different lengths.