Skip to content

Commit ca2be85

Browse files
committed
fixes from copilot review
Signed-off-by: Mark Kurtz <[email protected]>
1 parent b1cce19 commit ca2be85

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/guidellm/mock_server/handlers/chat_completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ async def generate_stream(stream_response):
251251
await stream_response.write(f"data: {json.dumps(final_chunk)}\n\n")
252252

253253
# Send usage if requested
254-
if req.stream_options and req.stream_options.get("include_usage"):
254+
if req.stream_options and req.stream_options.include_usage:
255255
usage_chunk = {
256256
"id": completion_id,
257257
"object": "chat.completion.chunk",

src/guidellm/mock_server/handlers/completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ async def generate_stream(stream_response):
251251
await stream_response.write(f"data: {json.dumps(final_chunk)}\n\n")
252252

253253
# Send usage if requested
254-
if req.stream_options and req.stream_options.get("include_usage"):
254+
if req.stream_options and req.stream_options.include_usage:
255255
usage_chunk = {
256256
"id": completion_id,
257257
"object": "text_completion",

tests/unit/mock_server/test_server.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,11 @@ async def test_streaming_completions(self, mock_server_instance):
378378
except json.JSONDecodeError:
379379
continue
380380

381-
assert len(chunks) > 0
382-
# Verify chunk structure
383-
for chunk in chunks:
384-
assert "choices" in chunk
385-
assert len(chunk["choices"]) > 0
381+
assert len(chunks) > 0
382+
# Verify chunk structure
383+
for chunk in chunks:
384+
assert "choices" in chunk
385+
assert len(chunk["choices"]) > 0
386386

387387
@pytest.mark.smoke
388388
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)