fix(serve): preserve explicit false against reasoning defaults

This commit is contained in:
Tsury authored and Niko1221 committed 2026-10-14 06:52:38 +02:00
1 parent 69fe40553d
commit e69cbfa568
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -3555,7 +3555,7 @@ class Service:
if effort:
if api == "openai":
ctk = req.get("chat_template_kwargs") if isinstance(req.get("chat_template_kwargs"), dict) else {}
if not req.get("reasoning_effort") and not req.get("reasoning") and \
if req.get("reasoning_effort") in (None, "") and not req.get("reasoning") and \
"enable_thinking" not in ctk and "reasoning_effort" not in ctk:
req["reasoning_effort"] = effort
elif not req.get("thinking") and not req.get("output_config"):
+1
View File
@@ -130,6 +130,7 @@ class EffortPaths(unittest.TestCase):
"thinking": {"type": "enabled", "budget_tokens": 20000}}), "xhigh")
self.assertEqual(self.level("/v1/responses", {"input": "hello", "reasoning": {"effort": "high"}}), "xhigh")
self.assertEqual(self.level("/v1/chat/completions", {"messages": MSG, "reasoning_effort": "none"}), "none")
self.assertEqual(self.level("/v1/chat/completions", {"messages": MSG, "reasoning_effort": False}), "none")
def test_the_chat_settings_shared_with_apps_beat_the_config(self):
self.svc.config_effort = "low"