feat: Add 'none' reasoning effort to ChatCompletionRequest (#20556)
This commit is contained in:
@@ -192,6 +192,30 @@ class TestChatCompletionRequest(unittest.TestCase):
|
||||
self.assertEqual(request.reasoning_effort, "high")
|
||||
self.assertEqual(request.chat_template_kwargs, {"thinking": True})
|
||||
|
||||
def test_chat_completion_reasoning_effort_none(self):
|
||||
"""Test reasoning_effort='none' disables thinking"""
|
||||
messages = [{"role": "user", "content": "Hello"}]
|
||||
request = ChatCompletionRequest(
|
||||
model="test-model",
|
||||
messages=messages,
|
||||
reasoning_effort="none",
|
||||
)
|
||||
self.assertEqual(request.reasoning_effort, "none")
|
||||
self.assertFalse(request.chat_template_kwargs.get("thinking"))
|
||||
self.assertFalse(request.chat_template_kwargs.get("enable_thinking"))
|
||||
|
||||
def test_chat_completion_reasoning_effort_none_from_reasoning_dict(self):
|
||||
"""Test reasoning_effort='none' via nested reasoning dict"""
|
||||
messages = [{"role": "user", "content": "Hello"}]
|
||||
request = ChatCompletionRequest(
|
||||
model="test-model",
|
||||
messages=messages,
|
||||
reasoning={"effort": "none"},
|
||||
)
|
||||
self.assertEqual(request.reasoning_effort, "none")
|
||||
self.assertFalse(request.chat_template_kwargs.get("thinking"))
|
||||
self.assertFalse(request.chat_template_kwargs.get("enable_thinking"))
|
||||
|
||||
def test_chat_completion_json_format(self):
|
||||
"""Test chat completion json format"""
|
||||
transcript = "Good morning! It's 7:00 AM, and I'm just waking up. Today is going to be a busy day, "
|
||||
|
||||
Reference in New Issue
Block a user