feat: solution for 'Повторный экзамен: FAQ-бот — ChromaDB + один MCP-tool'
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user