MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / api_rerank

Function api_rerank

backend/app/routes/inference/rerank.py:23–43  ·  view source on GitHub ↗
(
    request: Request,
    data: RerankRequest,
    auth_info: Dict = Depends(auth_info_required),
)

Source from the content-addressed store, hash-verified

21 response_model=RerankResponse,
22)
23async def api_rerank(
24 request: Request,
25 data: RerankRequest,
26 auth_info: Dict = Depends(auth_info_required),
27):
28 # validate model
29 model: Model = await get_model(
30 model_id=data.model_id,
31 )
32
33 # generate none stream response
34 response = await rerank(
35 model=model,
36 encrypted_credentials=model.encrypted_credentials,
37 query=data.query,
38 documents=data.documents,
39 top_n=data.top_n,
40 )
41 check_http_error(response)
42 data = RerankResult(results=response.json()["data"]["results"])
43 return RerankResponse(data=data, usage=response.json()["usage"])

Callers

nothing calls this directly

Calls 6

get_modelFunction · 0.90
rerankFunction · 0.90
check_http_errorFunction · 0.90
RerankResultClass · 0.90
RerankResponseClass · 0.90
jsonMethod · 0.45

Tested by

no test coverage detected