MCPcopy Create free account
hub / github.com/ZBayes/basic_rag / initialize

Method initialize

src/server/handlers/search_handler.py:20–33  ·  view source on GitHub ↗
(self, searcher:Searcher)

Source from the content-addressed store, hash-verified

18class SearcherHandler(RequestHandler):
19
20 def initialize(self, searcher:Searcher):
21 self.searcher = searcher
22 # request_body:
23 # {
24 # "query": "什么人不能吃花生"
25 # }
26
27 # response_body = {
28 # "answer":[{
29 # "match_query":"match_query",
30 # "answer":"answer",
31 # "score":"score"
32 # }]
33 # }
34
35 async def post(self):
36 answers = self.searcher.search(json_decode(self.request.body).get("query", ""))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected