Add 'none' reasoning effort to ChatCompletionRequest (#36238)

Signed-off-by: Julien Denize <julien.denize@mistral.ai>
This commit is contained in:
Julien Denize
2026-03-11 15:45:34 +00:00
committed by GitHub
parent 35db669f1d
commit a3ea760ea5
3 changed files with 14 additions and 2 deletions
@@ -179,7 +179,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
| ChatCompletionNamedToolChoiceParam
| None
) = "none"
reasoning_effort: Literal["low", "medium", "high"] | None = None
reasoning_effort: Literal["none", "low", "medium", "high"] | None = None
include_reasoning: bool = True
parallel_tool_calls: bool | None = True
@@ -778,3 +778,10 @@ class ChatCompletionRequest(OpenAIBaseModel):
)
return data
@model_validator(mode="before")
@classmethod
def set_include_reasoning_for_none_effort(cls, data: Any) -> Any:
if data.get("reasoning_effort") == "none":
data["include_reasoning"] = False
return data