MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/optillm / test_n_parameter

Function test_n_parameter

tests/test_api_compatibility.py:43–59  ·  view source on GitHub ↗

Test n parameter for multiple completions

(client)

Source from the content-addressed store, hash-verified

41
42
43def test_n_parameter(client):
44 """Test n parameter for multiple completions"""
45 n = 3
46 response = client.chat.completions.create(
47 model=TEST_MODEL,
48 messages=[
49 {"role": "user", "content": "Write a one-line joke"}
50 ],
51 n=n,
52 temperature=0.8,
53 max_tokens=50
54 )
55
56 assert len(response.choices) == n
57 # Check all responses are different (with high temperature)
58 contents = [choice.message.content for choice in response.choices]
59 assert len(set(contents)) > 1 # At least some different responses
60
61
62def test_approach_prefix(client):

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected