Reject choice questions without criteria on vela3-fast and drop the score claim

#2
by subin - opened
vLLM Semantic Router org

vela3_server.py promises a 422 with invalid_questions for malformed questions, but a choice question with no criteria, empty criteria or a string as criteria reached options_of and the server answered 500 (KeyError, StopIteration, AttributeError). A list of options also gave 500, although router questions and vela3-fast-vision accept one.

system_one now checks choice criteria before the decision backbone runs, as vela3-fast-vision does: an object of options goes through unchanged, a list becomes options without descriptions, and anything else gets invalid_question with "choice questions need criteria: {option: description or null} or a list of options", which the server turns into a 422.

The README listed Score as an answer type and score as a decision question, but the package answers score with invalid_question (unsupported question type). Both mentions are removed. Score support is not added.

Tested through the HTTP server with the decision backbone loaded on CPU. Missing, empty and string criteria now give 422 instead of 500. A list ["refund", "cancel"] gives 200 with the same probabilities as {"refund": null, "cancel": null}, and a valid choice and yes/no request gives the same answers before and after.

vLLM Semantic Router org

Thanks, merged.

adaamko changed pull request status to merged

Sign up or log in to comment