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.
HuggingfaceCustomEmbedder
from agno.agent import AgentKnowledge from agno.vectordb.pgvector import PgVector from agno.embedder.huggingface import HuggingfaceCustomEmbedder # 将句子嵌入到数据库中 embeddings = HuggingfaceCustomEmbedder().get_embedding("The quick brown fox jumps over the lazy dog.") # 打印嵌入向量及其维度 print(f"Embeddings: {embeddings[:5]}") print(f"Dimensions: {len(embeddings)}") # 在知识库中使用嵌入器 knowledge_base = AgentKnowledge( vector_db=PgVector( db_url="postgresql+psycopg://ai:ai@localhost:5532/ai", table_name="huggingface_embeddings", embedder=HuggingfaceCustomEmbedder(), ), num_documents=2, )
dimensions
int
model
str
all-MiniLM-L6-v2
api_key
client_params
Optional[Dict[str, Any]]
huggingface_client
Any