Skip to content

Comments

fix: update deprecated Anthropic default model and stop sending both temperature and top_p#430

Open
themavik wants to merge 1 commit intoawslabs:mainfrom
themavik:fix/392-anthropic-deprecated-model-temperature-topp
Open

fix: update deprecated Anthropic default model and stop sending both temperature and top_p#430
themavik wants to merge 1 commit intoawslabs:mainfrom
themavik:fix/392-anthropic-deprecated-model-temperature-topp

Conversation

@themavik
Copy link

@themavik themavik commented Feb 11, 2026

Summary

Fixes #392

The AnthropicAgent defaults cause API errors on current Anthropic models:

  1. Deprecated model: The default model_id is claude-3-5-sonnet-20240620, which was deprecated in October 2025 and is no longer available.
  2. Conflicting parameters: The default_inference_config includes both temperature (0.1) and topP (0.9). Current Anthropic models reject requests that specify both parameters simultaneously.

Changes

  • Updated model_id default from claude-3-5-sonnet-20240620 to claude-sonnet-4-20250514
  • Removed topP from default_inference_config (keeping only temperature: 0.1)
  • Changed _build_input() to only include temperature and top_p in the API request when they have non-None values, so users who explicitly set one or the other still work correctly

Backward Compatibility

  • Users who explicitly pass inference_config with their own topP or temperature value will still have those values forwarded to the API -- only the default no longer sends both
  • Users who override model_id are unaffected

Test Plan

  • Default AnthropicAgent() no longer triggers "model not found" or "cannot set both temperature and top_p" errors
  • Explicitly setting inference_config={"topP": 0.9} still works (only top_p sent)
  • Explicitly setting inference_config={"temperature": 0.5} still works (only temperature sent)

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: Anthropic default models deprecated and no longer accept both temperature and p val.

1 participant