fn cosine_similarity(a: &[f32], b: &[f32]) -> f32Expand description
Calculates cosine similarity between two embedding vectors.
Returns a value in the range [0.0, 1.0] where:
- 1.0 = identical vectors
- 0.0 = orthogonal vectors
ยงPanics
This function does not panic. If vectors have different lengths or zero magnitude, it returns 0.0 to indicate no similarity.