Skip to content

fix: avoid sending both temperature and topP in Bedrock Converse API (#4004)#3

Open
themavik wants to merge 1 commit intomainfrom
fix/4004-bedrock-temperature-topp
Open

fix: avoid sending both temperature and topP in Bedrock Converse API (#4004)#3
themavik wants to merge 1 commit intomainfrom
fix/4004-bedrock-temperature-topp

Conversation

@themavik
Copy link
Owner

@themavik themavik commented Feb 9, 2026

Fixes mem0ai#4004.

Root cause: _generate_with_tools() and _generate_standard() unconditionally sent both temperature and topP in inferenceConfig. Newer Anthropic Claude models on Bedrock reject this.

Fix: Extracted _build_inference_config() helper that only includes topP when temperature is not set.

…em0ai#4004)

Root cause: The _generate_with_tools() and _generate_standard() methods
unconditionally included both temperature and topP in inferenceConfig.
Newer Anthropic Claude models on Bedrock reject requests containing
both parameters simultaneously with a ValidationException.

Fix: Extract inference config building into _build_inference_config()
helper that only includes topP when temperature is not set. This
prevents the conflict while maintaining backward compatibility for
models that accept both parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AWS Bedrock Converse API rejects requests with both temperature and topP for Anthropic models

1 participant