mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-30 01:32:25 +01:00
fix(chatgpt): omit temperature from subscription requests (#6498)
Co-authored-by: Raul <9117159+raultcj@users.noreply.github.com>
This commit is contained in:
+3
-2
@@ -1556,8 +1556,9 @@ def _build_chatgpt_responses_payload(
|
|||||||
"stream": stream,
|
"stream": stream,
|
||||||
"store": False,
|
"store": False,
|
||||||
}
|
}
|
||||||
if not _restricts_temperature(model):
|
# ChatGPT plan Responses requests reject temperature for every model.
|
||||||
payload["temperature"] = temperature
|
# The common caller still passes its preset value, but this provider must
|
||||||
|
# omit the field even for model names outside the known reasoning families.
|
||||||
# ChatGPT Subscription Codex API does not support max_output_tokens —
|
# ChatGPT Subscription Codex API does not support max_output_tokens —
|
||||||
# passing it returns HTTP 400 "Unsupported parameter: max_output_tokens".
|
# passing it returns HTTP 400 "Unsupported parameter: max_output_tokens".
|
||||||
# Do not include it in the payload.
|
# Do not include it in the payload.
|
||||||
|
|||||||
@@ -156,3 +156,18 @@ def test_chatgpt_subscription_payload_omits_max_output_tokens_when_zero():
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert "max_output_tokens" not in payload
|
assert "max_output_tokens" not in payload
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("model", ["gpt-5.6-luna", "gpt-6-luna", "gpt-6-sol", "gpt-6.1-sol", "gpt-4.1"])
|
||||||
|
def test_chatgpt_subscription_payload_omits_temperature_for_every_model(model):
|
||||||
|
payload = llm_core._build_chatgpt_responses_payload(
|
||||||
|
model,
|
||||||
|
[{"role": "user", "content": "Say OK"}],
|
||||||
|
temperature=0.2,
|
||||||
|
max_tokens=37,
|
||||||
|
stream=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert "temperature" not in payload
|
||||||
|
assert payload["stream"] is True
|
||||||
|
assert payload["store"] is False
|
||||||
|
|||||||
Reference in New Issue
Block a user