Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
OpenAIEmbedder
from phi.agent import AgentKnowledge from phi.vectordb.pgvector import PgVector from phi.embedder.openai import OpenAIEmbedder embeddings = OpenAIEmbedder().get_embedding("Embed me") # Print the embeddings and their dimensions print(f"Embeddings: {embeddings[:5]}") print(f"Dimensions: {len(embeddings)}") # Example usage: knowledge_base = AgentKnowledge( vector_db=PgVector( db_url="postgresql+psycopg://ai:ai@localhost:5532/ai", table_name="openai_embeddings", embedder=OpenAIEmbedder(), ), num_documents=2, )
model
str
"text-embedding-ada-002"
dimensions
int
1536
encoding_format
Literal['float', 'base64']
"float"
user
api_key
organization
base_url
request_params
Optional[Dict[str, Any]]
client_params
openai_client
Optional[OpenAIClient]
Was this page helpful?