Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/entrypoints/openai/chat_completion/test_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,10 @@ async def test_chat_completion_n_parameter_non_streaming(
chat_completion = await client.chat.completions.create(
model=model_name,
messages=messages,
max_completion_tokens=20,
temperature=0.7,
max_completion_tokens=50,
temperature=1.0,
n=3,
seed=42,
stream=False,
)

Expand All @@ -859,7 +860,6 @@ async def test_chat_completion_n_parameter_non_streaming(
assert choice.message.content is not None
assert len(choice.message.content) > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The comment was removed, but it provided useful context for the assertion that follows. If the assertion is intended to verify diversity, the comment should be kept or updated to reflect the new deterministic approach.

Suggested change
# Verify all responses are different (deterministic with seed=42)

# Verify all responses are different (highly likely with temperature > 0)
contents = [choice.message.content for choice in chat_completion.choices]
assert len(set(contents)) > 1, "Expected different responses with n=3"

Expand Down
Loading