support enable in the reasoning field to enable thingking for thinkin… (#9715)

This commit is contained in:
gongwei-130
2025-08-29 10:57:32 -07:00
committed by GitHub
parent 161e9dc51e
commit 3fd1431df2
2 changed files with 42 additions and 0 deletions

View File

@@ -192,6 +192,20 @@ class TestChatCompletionRequest(unittest.TestCase):
self.assertFalse(request.stream_reasoning)
self.assertEqual(request.chat_template_kwargs, {"custom_param": "value"})
def test_chat_completion_reasoning_effort(self):
"""Test chat completion with reasoning effort"""
messages = [{"role": "user", "content": "Hello"}]
request = ChatCompletionRequest(
model="test-model",
messages=messages,
reasoning={
"enabled": True,
"reasoning_effort": "high",
},
)
self.assertEqual(request.reasoning_effort, "high")
self.assertEqual(request.chat_template_kwargs, {"thinking": True})
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, "