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

This commit is contained in:
2026-06-29 17:22:50 +03:00
parent 27f5bd29f5
commit 32ff1fdb43
9 changed files with 265 additions and 12 deletions
+18
View File
@@ -0,0 +1,18 @@
from typing import List, Dict
from .vector_store import QdrantVectorStore
class MCPTool:
"""
A simple tool that uses the vector store to answer queries.
"""
def __init__(self, vector_store: QdrantVectorStore):
self.vector_store = vector_store
def answer(self, query: str, top_k: int = 3) -> List[Dict]:
"""
Return the top_k most relevant documents for the query.
"""
return self.vector_store.search(query, top_k=top_k)