fix: update deprecated Anthropic default model and stop sending both temperature and top_p#430
Open
themavik wants to merge 1 commit intoawslabs:mainfrom
Conversation
…temperature and top_p
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #392
The
AnthropicAgentdefaults cause API errors on current Anthropic models:model_idisclaude-3-5-sonnet-20240620, which was deprecated in October 2025 and is no longer available.default_inference_configincludes bothtemperature(0.1) andtopP(0.9). Current Anthropic models reject requests that specify both parameters simultaneously.Changes
model_iddefault fromclaude-3-5-sonnet-20240620toclaude-sonnet-4-20250514topPfromdefault_inference_config(keeping onlytemperature: 0.1)_build_input()to only includetemperatureandtop_pin the API request when they have non-None values, so users who explicitly set one or the other still work correctlyBackward Compatibility
inference_configwith their owntopPortemperaturevalue will still have those values forwarded to the API -- only the default no longer sends bothmodel_idare unaffectedTest Plan
AnthropicAgent()no longer triggers "model not found" or "cannot set both temperature and top_p" errorsinference_config={"topP": 0.9}still works (onlytop_psent)inference_config={"temperature": 0.5}still works (onlytemperaturesent)