litellm/tests/unit/proxy/decisions_endpoints
kenneth-berri 038c871bac
fix(decisions): match OpenAI format answers to questions by name (#52597)
* fix(decisions): match OpenAI format answers to questions by name

An OpenAI format provider that returned answers in a different order than the
questions had each value relabeled with the name of the question at the same
position, so a caller read the probability of one question under the name of
another. Answers are now matched to questions by name. A response that cannot
be matched (a name no question has, a repeated name, or more answers than
questions) is a 500 provider error instead of a guess.

Fixes #52456

Co-authored-by: Sudhir Vissa <sudhirvissa@gmail.com>

* refactor(decisions): return the answer matching failure as a value

The matcher now returns the validation error and openai_response_to_ir raises
it, so the helper that decides the match does not throw.

---------

Co-authored-by: Sudhir Vissa <sudhirvissa@gmail.com>
2026-11-18 12:55:45 -08:00
..
__init__.py feat(decisions): add unified /v1/decisions endpoint for Jev-compatible providers (#44236) 2026-10-03 17:38:38 +00:00
test_endpoints.py fix(decisions): match OpenAI format answers to questions by name (#52597) 2026-11-18 12:55:45 -08:00