similarity • Rust AI Agent SDK

similarity: Calculate cosine similarity between two texts. # Arguments * `text1` – First text * `text2` – Second text # Returns Cosine similarity score (0.0 to…

similarity

Async

Method

</div>

This is a method of the EmbeddingAgent class in the embedding module.

Calculate cosine similarity between two texts. # Arguments text1 – First text text2 – Second text # Returns Cosine similarity score (0.0 to 1.0)

Signature

python
async def similarity(&self, text1: &str, text2: &str) -> Result<f32>

Parameters

ParamField &str

No description available.

ParamField &str

No description available.