feat: solution for 'Повторный экзамен: FAQ-бот — ChromaDB + один MCP-tool'

This commit is contained in:
2026-07-01 15:04:34 +03:00
parent e42f7eac1e
commit f522dcfa80
7 changed files with 223 additions and 289 deletions
+14
View File
@@ -0,0 +1,14 @@
from langchain_ollama import OllamaEmbeddings
from src.config import settings
# Instantiate the Ollama embeddings once for reuse
ollama_embeddings = OllamaEmbeddings(
model=settings.ollama_embed_model,
base_url=f"{settings.ollama_host}:{settings.ollama_port}"
)
def get_embedding(text: str):
"""
Return the embedding vector for a single text string.
"""
return ollama_embeddings.embed_query(text)