embedding • AI Agent SDK
Embedding module for PraisonAI Agents.
embedding
AI Agent
Embedding module for PraisonAI Agents.
This module provides a unified embedding API that can be used throughout the praisonaiagents package. It consolidates embedding functionality that was previously duplicated in memory.py and knowledge.py.
Usage:
>>> from praisonaiagents import embedding
>>> result = embedding("Hello world")
>>> print(result.embeddings[0][:5])
>>> from praisonaiagents.embedding import embedding, EmbeddingResult
>>> result = embedding(["Hello", "World"])
>>> print(len(result))
2The module uses lazy imports to avoid loading litellm until actually needed, ensuring zero performance impact on import time.
Import
from praisonaiagents import embedding