Find Most Similar • Rust AI Agent SDK

find_most_similar: Find the most similar texts to a query. # Arguments * `query` – Query text * `candidates` – List of candidate texts to compare * `top_k` – Number of…

find_most_similar

Async

Method

</div>

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

Find the most similar texts to a query. # Arguments query – Query text candidates – List of candidate texts to compare * top_k – Number of top results to return # Returns List of SimilarityResult sorted by score (descending)

Signature

python
async def find_most_similar(
        &self,
        query: &str,
        candidates: &[&str],
        top_k: usize,
    ) -> Result<Vec<SimilarityResult>>

Parameters

ParamField &str

No description available.

ParamField &[&str]

No description available.

ParamField usize

No description available.

Returns

PreviousNext