autorag.embed¶
Ollama-backed embedder for document and chunk text.
Wraps langchain_ollama.OllamaEmbeddings and resolves its base
URL and model from the environment so the same defaults apply across
the CLI, SDK, and server:
AUTORAG_OLLAMA_BASE_URL— defaults tohttp://localhost:11434.AUTORAG_EMBED_MODEL— defaults tonomic-embed-text.
- class autorag.embed.Embedder(base_url=None, model=None)[source]¶
Bases:
objectThin wrapper around
OllamaEmbeddings.Exposes
embed_texts()for raw strings andembed_chunks()for in-place enrichment ofChunkobjects.- Parameters:
- embed_texts(texts)[source]¶
Embed a list of strings, returning one vector per input.
Raises
RuntimeErrorwith the configured Ollama URL on connection or model errors. Empty input returns[]without touching the network.