MCPcopy Create free account
hub / github.com/BeastyZ/ConvSearch-R1 / retrieve_endpoint

Function retrieve_endpoint

src/retrieval/server.py:301–320  ·  view source on GitHub ↗

Endpoint that accepts queries and performs retrieval. Input format: { "queries": ["What is Python?", "Tell me about neural networks."], "topk": 3, "return_scores": true }

(request: QueryRequest)

Source from the content-addressed store, hash-verified

299
300@app.post("/retrieve")
301def retrieve_endpoint(request: QueryRequest) -> JSONResponse:
302 """
303 Endpoint that accepts queries and performs retrieval.
304 Input format:
305 {
306 "queries": ["What is Python?", "Tell me about neural networks."],
307 "topk": 3,
308 "return_scores": true
309 }
310 """
311 # Perform batch retrieval
312 results = retriever.batch_search(
313 query_list=request.queries,
314 query_ids=request.query_ids,
315 num=request.topk,
316 return_score=request.return_scores,
317 max_length=request.max_length
318 )
319
320 return JSONResponse({"result": results})
321
322
323if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

batch_searchMethod · 0.80

Tested by

no test coverage detected