fix: use None instead of Reasoning() for reasoning parameter

The ResponsesAPIResponse.reasoning field expects Optional[Dict[str, Any]],
not a Reasoning object. Passing an empty Reasoning() object causes a mypy type error.

Fix: Pass None instead of Reasoning() since the field is optional and we're
not providing any reasoning data.

Fixes mypy error:
Argument "reasoning" to "ResponsesAPIResponse" has incompatible type
"Reasoning"; expected "dict[str, Any] | None"
This commit is contained in:
Julio Quinteros Pro 2026-02-13 05:48:16 -03:00
parent caf6db972f
commit 8014643f27

View file

@ -1500,7 +1500,7 @@ class LiteLLMCompletionResponsesConfig:
previous_response_id=getattr(
chat_completion_response, "previous_response_id", None
),
reasoning=dict(Reasoning()),
reasoning=None,
status=LiteLLMCompletionResponsesConfig._map_chat_completion_finish_reason_to_responses_status(
finish_reason
),