Skip to content

Commit c7d781a

Browse files
Fix streaming test to handle /completion response format
The /completion endpoint returns chunks with 'content' directly, not wrapped in 'choices' array like chat completions endpoint. Co-Authored-By: Alex Peng <[email protected]>
1 parent 8cd247f commit c7d781a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/server/tests/e2e/test_pipeline_workflows.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,8 @@ def test_streaming_pipeline(pipeline_process, e2e_small_model_config):
181181

182182
content = ""
183183
for chunk in chunks:
184-
if chunk.get("choices"):
185-
choice = chunk["choices"][0]
186-
if "content" in choice:
187-
content += choice["content"]
184+
if "content" in chunk:
185+
content += chunk["content"]
188186

189187
assert len(content) > 0, "Should have generated content"
190188

0 commit comments

Comments
 (0)