Skip to main content

find_most_similar

Method
This is a method of the EmbeddingAgent class in the embedding_agent module.
Find the most similar texts to a query.

Signature

Parameters

str
required
Query text
List
required
List of candidate texts to compare
int
default:"5"
Number of top results to return
Optional
Override model for this call **kwargs: Additional parameters

Returns

List[Dict[str, Any]]
List of dicts with ‘text’, ‘score’, and ‘index’ keys

Usage

Uses

  • embed_batch
  • scores.sort

Source

View on GitHub

praisonaiagents/agent/embedding_agent.py at line 309