Copyright | (c) 2025 Tushar Adhatrao |
---|---|
License | MIT |
Maintainer | Tushar Adhatrao <[email protected]> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Langchain.Embeddings.Ollama
Description
Ollama implementation of LangChain's embedding interface. Supports document and query embedding generation through Ollama's API.
Example usage:
-- Create Ollama embeddings configuration ollamaEmb = OllamaEmbeddings { model = "nomic-embed-text:latest" , defaultTruncate = Just True , defaultKeepAlive = Just "5m" } -- Embed query text queryVec <- embedQuery ollamaEmb "What is Haskell?" -- Right [0.12, 0.34, ...] -- Embed document collection doc <- Document "Haskell is a functional programming language" mempty docsVec <- embedDocuments ollamaEmb [doc] -- Right [[0.56, 0.78, ...]]
Synopsis
- data OllamaEmbeddings = OllamaEmbeddings {}
Documentation
data OllamaEmbeddings Source #
Ollama-specific embedding configuration Contains parameters for controlling:
- Model selection
- Input truncation behavior
- Model caching via keep-alive
Example configuration:
>>>
OllamaEmbeddings "nomic-embed" (Just False) (Just "1h")
OllamaEmbeddings {model = "nomic-embed", ...}
Constructors
OllamaEmbeddings | |
Fields
|
Instances
Show OllamaEmbeddings Source # | |
Defined in Langchain.Embeddings.Ollama Methods showsPrec :: Int -> OllamaEmbeddings -> ShowS # show :: OllamaEmbeddings -> String # showList :: [OllamaEmbeddings] -> ShowS # | |
Eq OllamaEmbeddings Source # | |
Defined in Langchain.Embeddings.Ollama Methods (==) :: OllamaEmbeddings -> OllamaEmbeddings -> Bool # (/=) :: OllamaEmbeddings -> OllamaEmbeddings -> Bool # | |
Embeddings OllamaEmbeddings Source # | |
Defined in Langchain.Embeddings.Ollama Methods embedDocuments :: OllamaEmbeddings -> [Document] -> IO (Either String [[Float]]) Source # embedQuery :: OllamaEmbeddings -> Text -> IO (Either String [Float]) Source # |