This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
Embeddings module that provides an OllamaEmbeddings instance.
|
||||
"""
|
||||
|
||||
import os
|
||||
from langchain_community.embeddings import OllamaEmbeddings
|
||||
|
||||
def get_embedding_model() -> OllamaEmbeddings:
|
||||
"""
|
||||
Returns an OllamaEmbeddings instance configured with the model name
|
||||
specified by the OLLAMA_MODEL environment variable or defaults to
|
||||
'mistral'.
|
||||
|
||||
Returns:
|
||||
OllamaEmbeddings: The embedding model instance.
|
||||
"""
|
||||
model_name = os.getenv("OLLAMA_MODEL", "mistral")
|
||||
return OllamaEmbeddings(model=model_name)
|
||||
Reference in New Issue
Block a user