Drop `temperature` and `top_p` for OpenAI GPT-5.6 and GPT-6 on Bedrock Converse instead of failing with a 400
Merged
KI
1mo ago+630+630+012345678901234567890123456789-8-8-0123456789
Setting temperature, top_p or top_k on OpenAI GPT-5.6 Sol/Luna/Terra or GPT-6 Sol/Luna/Astra through bedrock: failed with a 400 from Converse ("This model doesn't support the temperature field"). BedrockConverseModel now drops these settings with a UserWarning for those models, using the same path it already uses for Claude Opus 4.7+.
- Fixes #8667
New public surface
BedrockModelProfile.bedrock_disallows_sampling_settings (default False), set for the six models above in bedrock_openai_model_profile.
Verification
Live probe with raw Converse calls, us-east-1:
- All six models reject
temperature(0.2 and 1),topPandtop_k, including withreasoning.effortset to'none'or'low'. So the settings are always dropped, not only while reasoning is on. - GPT-6 Astra can't turn reasoning off (
'none'is rejected), and rejectstemperatureat every effort level too. openai.gpt-oss-120b-1:0accepts all three settings, so it stays unflagged.
Tests, all recorded live against Converse (us-east-1):
test_bedrock_openai_api_rejects_sampling_settings, per model: Converse's own 400 fortemperature, via the raw client.test_bedrock_openai_drops_sampling_settings, per model: warning emitted,inferenceConfigsent without the settings, body-matched.test_bedrock_openai_gpt_oss_keeps_sampling_settings:gpt-ossstill sendstemperatureandtopP, and gets a 200.test_bedrock_converse_accepts_gpt_5_6_and_gpt_6_models: the flag is set for all six models.
Checklist
- Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver. (Not applicable.)
- PR title is fit for the release changelog.