Skip to main content

similarity

AsyncMethod
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

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

Parameters

text1
&str
required
No description available.
text2
&str
required
No description available.

Returns

Returns
Result<f32>
The result of the operation.