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

Method post

src/server/handlers/search_handler.py:35–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 # }
34
35 async def post(self):
36 answers = self.searcher.search(json_decode(self.request.body).get("query", ""))
37 result = []
38 for answer in answers:
39 tmp_result = {}
40 # tmp_result["query"] = answer[0]
41 tmp_result["answer"] = answer[1][1]["answer"]
42 tmp_result["match_query"] = answer[1][0]
43 tmp_result["score"] = str(answer[3])
44 result.append(copy.deepcopy(tmp_result))
45 response_body = {"answer": result}
46 self.write(response_body)
47
48def StartSearcherHandler(request_config: dict, searcher: Searcher):
49 # 启动TestClass服务的进程

Callers

nothing calls this directly

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected