mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-09 03:17:58 +00:00
fix(bedrock): disable temperature for Claude Opus 4.7
Claude Opus 4.7 does not support the temperature parameter (deprecated). Previously, temperature was always sent in inferenceConfig which caused a 400 error: 'temperature is deprecated for this model'. Changes: - Add supportsTemperature: false to anthropic.claude-opus-4-7 model def - Skip sending temperature in inferenceConfig when supportsTemperature is false (both createMessage and completePrompt paths) - The UI already conditionally hides the Custom Temperature setting based on supportsTemperature !== false
This commit is contained in:
parent
36ac4d3e06
commit
a682355230
2 changed files with 9 additions and 2 deletions
|
|
@ -173,6 +173,7 @@ export const bedrockModels = {
|
||||||
supportsImages: true,
|
supportsImages: true,
|
||||||
supportsPromptCache: true,
|
supportsPromptCache: true,
|
||||||
supportsReasoningBudget: true,
|
supportsReasoningBudget: true,
|
||||||
|
supportsTemperature: false, // Temperature is deprecated for this model
|
||||||
inputPrice: 5.0, // $5 per million input tokens (≤200K context)
|
inputPrice: 5.0, // $5 per million input tokens (≤200K context)
|
||||||
outputPrice: 25.0, // $25 per million output tokens (≤200K context)
|
outputPrice: 25.0, // $25 per million output tokens (≤200K context)
|
||||||
cacheWritesPrice: 6.25, // $6.25 per million tokens
|
cacheWritesPrice: 6.25, // $6.25 per million tokens
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,10 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
|
||||||
|
|
||||||
const inferenceConfig: BedrockInferenceConfig = {
|
const inferenceConfig: BedrockInferenceConfig = {
|
||||||
maxTokens: modelConfig.maxTokens || (modelConfig.info.maxTokens as number),
|
maxTokens: modelConfig.maxTokens || (modelConfig.info.maxTokens as number),
|
||||||
|
// Only include temperature if the model supports it (Opus 4.7 deprecated temperature)
|
||||||
|
...(modelConfig.info.supportsTemperature !== false && {
|
||||||
temperature: modelConfig.temperature ?? (this.options.modelTemperature as number),
|
temperature: modelConfig.temperature ?? (this.options.modelTemperature as number),
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if 1M context is enabled for supported Claude 4 models
|
// Check if 1M context is enabled for supported Claude 4 models
|
||||||
|
|
@ -775,7 +778,10 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
|
||||||
|
|
||||||
const inferenceConfig: BedrockInferenceConfig = {
|
const inferenceConfig: BedrockInferenceConfig = {
|
||||||
maxTokens: modelConfig.maxTokens || (modelConfig.info.maxTokens as number),
|
maxTokens: modelConfig.maxTokens || (modelConfig.info.maxTokens as number),
|
||||||
|
// Only include temperature if the model supports it (Opus 4.7 deprecated temperature)
|
||||||
|
...(modelConfig.info.supportsTemperature !== false && {
|
||||||
temperature: modelConfig.temperature ?? (this.options.modelTemperature as number),
|
temperature: modelConfig.temperature ?? (this.options.modelTemperature as number),
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// For completePrompt, use a unique conversation ID based on the prompt
|
// For completePrompt, use a unique conversation ID based on the prompt
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue