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.
OllamaEmbedder
openhermes
ollama
ollama pull openhermes
from agno.agent import AgentKnowledge from agno.vectordb.pgvector import PgVector from agno.embedder.ollama import OllamaEmbedder # 将句子嵌入数据库 embeddings = OllamaEmbedder(id="openhermes").get_embedding("The quick brown fox jumps over the lazy dog.") # 打印嵌入及其维度 print(f"Embeddings: {embeddings[:5]}") print(f"Dimensions: {len(embeddings)}") # 在知识库中使用 embedder knowledge_base = AgentKnowledge( vector_db=PgVector( db_url="postgresql+psycopg://ai:ai@localhost:5532/ai", table_name="ollama_embeddings", embedder=OllamaEmbedder(), ), num_documents=2, )
model
str
"openhermes"
dimensions
int
4096
host
timeout
Any
options
client_kwargs
Optional[Dict[str, Any]]
ollama_client
Optional[OllamaClient]
OllamaClient