litellm/tests/unit/llms/openai/decisions
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 OpenAI as a Decisions provider behind a shared decisions format (#45214) 2026-10-08 04:57:41 +00:00
test_openai_decisions_transformation.py fix(decisions): match OpenAI format answers to questions by name (#52597) 2026-11-18 12:55:45 -08:00