feat: solution for 'Агент с RAG-памятью'
CI / build (push) Has been cancelled

This commit is contained in:
2026-06-30 15:36:47 +03:00
parent 1279deaaa6
commit 42fd00d924
4 changed files with 198 additions and 249 deletions
+18
View File
@@ -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)