EmbeddingAgent
Defined in the Embedding Agent module.AI Agent A specialized agent for generating text embeddings. Provides:
- Single text embedding
- Batch text embedding
- Similarity calculation between texts
- OpenAI:
text-embedding-3-small,text-embedding-3-large,text-embedding-ada-002 - Azure:
azure/text-embedding-3-small - Cohere:
cohere/embed-english-v3.0,cohere/embed-multilingual-v3.0 - Voyage:
voyage/voyage-3,voyage/voyage-3-lite - Mistral:
mistral/mistral-embed
Constructor
Optional[str]
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional
No description available.
Union[bool, int]
default:"True"
No description available.
Methods
console()
Lazily initialize Rich Console.
litellm()
Lazy load litellm module when needed.
embed()
Generate embedding for a single text.
embed_batch()
Generate embeddings for multiple texts.
similarity()
Calculate cosine similarity between two texts.
find_most_similar()
Find the most similar texts to a query.
aembed()
Async version of embed().
aembed_batch()
Async version of embed_batch().
asimilarity()
Async version of similarity().
Usage
Source
View on GitHub
praisonaiagents/agent/embedding_agent.py at line 47
