fix: some Qwen3 models only support streaming output. (#32766)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
FFXN
2026-03-01 15:42:44 +08:00
committed by GitHub
parent 46d45e4c39
commit a7789f2c91
2 changed files with 32 additions and 27 deletions

View File

@ -103,16 +103,16 @@ def test__normalize_non_stream_plugin_result__empty_iterator_defaults():
assert result.system_fingerprint is None
def test__normalize_non_stream_plugin_result__closes_chunk_iterator():
def test__normalize_non_stream_plugin_result__accumulates_all_chunks():
"""All chunks are accumulated from the iterator."""
prompt_messages = [UserPromptMessage(content="hi")]
chunk = _make_chunk(content="hello", usage=LLMUsage.empty_usage())
closed: list[bool] = []
def _chunk_iter():
try:
yield chunk
yield _make_chunk(content="ignored", usage=LLMUsage.empty_usage())
yield _make_chunk(content="hello", usage=LLMUsage.empty_usage())
yield _make_chunk(content=" world", usage=LLMUsage.empty_usage())
finally:
closed.append(True)
@ -122,5 +122,5 @@ def test__normalize_non_stream_plugin_result__closes_chunk_iterator():
result=_chunk_iter(),
)
assert result.message.content == "hello"
assert result.message.content == "hello world"
assert closed == [True]