mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-17 23:51:08 +00:00
Merge 1b327bbe38 into c4547d25c5
This commit is contained in:
commit
51d070e0be
3 changed files with 28 additions and 2 deletions
|
|
@ -229,6 +229,7 @@ const bedrockSchema = apiModelIdProviderModelSchema.extend({
|
|||
awsApiKey: z.string().optional(),
|
||||
awsUseApiKey: z.boolean().optional(),
|
||||
awsCustomArn: z.string().optional(),
|
||||
awsCustomArnEnableReasoning: z.boolean().optional(), // Enable reasoning for custom ARNs
|
||||
awsModelContextWindow: z.number().optional(),
|
||||
awsBedrockEndpointEnabled: z.boolean().optional(),
|
||||
awsBedrockEndpoint: z.string().optional(),
|
||||
|
|
|
|||
|
|
@ -390,7 +390,13 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
|
|||
modelConfig.reasoning &&
|
||||
modelConfig.reasoningBudget
|
||||
|
||||
if ((isThinkingExplicitlyEnabled || isThinkingEnabledBySettings) && modelConfig.info.supportsReasoningBudget) {
|
||||
// For custom ARNs, only enable reasoning if explicitly enabled via the awsCustomArnEnableReasoning setting
|
||||
// For regular models, use the standard logic
|
||||
const shouldEnableThinking = this.options.awsCustomArn
|
||||
? this.options.awsCustomArnEnableReasoning && modelConfig.info.supportsReasoningBudget
|
||||
: (isThinkingExplicitlyEnabled || isThinkingEnabledBySettings) && modelConfig.info.supportsReasoningBudget
|
||||
|
||||
if (shouldEnableThinking) {
|
||||
thinkingEnabled = true
|
||||
additionalModelRequestFields = {
|
||||
thinking: {
|
||||
|
|
@ -740,11 +746,16 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
|
|||
|
||||
// For completePrompt, thinking is typically not used, but we should still check
|
||||
// if thinking was somehow enabled in the model config
|
||||
const thinkingEnabled =
|
||||
// For custom ARNs, only enable if explicitly set via awsCustomArnEnableReasoning
|
||||
const thinkingEnabledBySettings =
|
||||
shouldUseReasoningBudget({ model: modelConfig.info, settings: this.options }) &&
|
||||
modelConfig.reasoning &&
|
||||
modelConfig.reasoningBudget
|
||||
|
||||
const thinkingEnabled = this.options.awsCustomArn
|
||||
? this.options.awsCustomArnEnableReasoning && modelConfig.reasoning && modelConfig.reasoningBudget
|
||||
: thinkingEnabledBySettings
|
||||
|
||||
const inferenceConfig: BedrockInferenceConfig = {
|
||||
maxTokens: modelConfig.maxTokens || (modelConfig.info.maxTokens as number),
|
||||
temperature: modelConfig.temperature ?? (this.options.modelTemperature as number),
|
||||
|
|
|
|||
|
|
@ -254,6 +254,20 @@ export const Bedrock = ({ apiConfiguration, setApiConfigurationField, selectedMo
|
|||
</div>
|
||||
</>
|
||||
)}
|
||||
{apiConfiguration?.awsCustomArn && (
|
||||
<div>
|
||||
<Checkbox
|
||||
checked={apiConfiguration?.awsCustomArnEnableReasoning ?? false}
|
||||
onChange={(checked: boolean) => {
|
||||
setApiConfigurationField("awsCustomArnEnableReasoning", checked)
|
||||
}}>
|
||||
Enable Reasoning
|
||||
</Checkbox>
|
||||
<div className="text-sm text-vscode-descriptionForeground mt-1 ml-6">
|
||||
Enable extended thinking for this custom ARN. Only enable if the model supports reasoning.
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue