-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
While working on #7189, #6700 esp. #7199, I realized that there's no constraint check for top_n parameter at the REST level.
Describe the solution you'd like
Providing https://api.jina.ai/redoc#tag/rerank/operation/rank_v1_rerank_post and https://jina.ai/reranker/ as a spec
top_n<=0- respond with 422, see belowtop_n>=len(documents)ortop_nis absent ;-( although I've got 500 from JINA API when omit it) - just ignore it, respond with score desc docs0<top_n<len(documents)- crop score desc docs
"detail": "[] Validation error: 'body -> jina-reranker-v3 -> top_n' Input should be greater than or equal to 1. Field errors: : Invalid value",
"errors": [
{
"field": "body -> jina-reranker-v3 -> top_n",
"message": "Input should be greater than or equal to 1",
"type": "greater_than_equal",
"input": "0"
}
]
I suppose preliminary check will simplify backends, reducing a need in constraint check.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request