Align finish reason and stream mode in openai api (#4388)

This commit is contained in:
Xihuai Wang
2025-03-27 15:16:52 +08:00
committed by GitHub
parent 44f47d3ee1
commit 1afe3d0798
3 changed files with 87 additions and 80 deletions

View File

@@ -258,7 +258,12 @@ class TestOpenAIServer(CustomTestCase):
ret_num_top_logprobs == logprobs
), f"{ret_num_top_logprobs} vs {logprobs}"
assert isinstance(data.content, str) or response.choices[0].finish_reason
assert (
isinstance(data.content, str)
or isinstance(data.reasoning_content, str)
or len(data.tool_calls) > 0
or response.choices[0].finish_reason
)
assert response.id
assert response.created