Skip to content

Fix Anthropic provider ignoring the randomness (temperature) setting#2

Open
Montana wants to merge 1 commit into
boozallen:mainfrom
Montana:fix/anthropic-temperature
Open

Fix Anthropic provider ignoring the randomness (temperature) setting#2
Montana wants to merge 1 commit into
boozallen:mainfrom
Montana:fix/anthropic-temperature

Conversation

@Montana

@Montana Montana commented Jul 2, 2026

Copy link
Copy Markdown

AnthropicSource never passed the user's randomness setting to the Anthropic API in completion() or chatCompletion(), so the randomness slider had no effect for Anthropic models and requests always used the API default temperature.

All other providers already map randomness to temperature (OpenAI, Gemini, Bedrock, Azure OpenAI). PALM constrains randomness to 0-1, which matches Anthropic's supported temperature range, so the value can be passed through directly.

Description

Type of change (check as many as applicable)

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation
  • Maintenance (version updates, config changes, etc)
  • Third-Party/Dependency integration change (schema changes, new/removed/updated APIs)

Work Remaining

How Has This Been Tested?

Pull Request Checklist

  • I have added this PR to the CHANGELOG.md where most applicable
  • I have applied an applicable label to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have attached screenshots (if applicable)
  • I have updated the application's SBOM (if applicable)
  • I have updated the DRAFT_RELEASE_NOTES.md (if applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • After creating this PR, I have resolved any issues with the automated PR checks

AnthropicSource never passed the user's randomness setting to the
Anthropic API in completion() or chatCompletion(), so the randomness
slider had no effect for Anthropic models and requests always used the
API default temperature.

All other providers already map randomness to temperature (OpenAI,
Gemini, Bedrock, Azure OpenAI). PALM constrains randomness to 0-1,
which matches Anthropic's supported temperature range, so the value
can be passed through directly.
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.

1 participant