generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 363
Extended Thinking を Sonnet 4.5 でも使えるようにする #1306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,13 +108,21 @@ export const defaultVideoGenerationModel: Model = { | |
| }; | ||
|
|
||
| // Model Params | ||
| const CLAUDE_4_5_DEFAULT_PARAMS: ConverseInferenceParams = { | ||
| const CLAUDE_SONNET_4_DEFAULT_PARAMS: ConverseInferenceParams = { | ||
| inferenceConfig: { | ||
| maxTokens: 64000, | ||
| temperature: 1, | ||
| }, | ||
| }; | ||
|
|
||
| const CLAUDE_OPUS_4_DEFAULT_PARAMS: ConverseInferenceParams = { | ||
| inferenceConfig: { | ||
| maxTokens: 32000, | ||
| temperature: 1, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. マネジメントコンソールのデフォルト値かつ、最近のLLMはTemperature及びTopPを最大化する傾向(ベンチマーク時に高目に設定してそれで精度が出ている)にあるので、高い数値を設定しています。 |
||
| topP: 0.999, | ||
| }, | ||
| }; | ||
|
|
||
| const CLAUDE_3_5_DEFAULT_PARAMS: ConverseInferenceParams = { | ||
| inferenceConfig: { | ||
| maxTokens: 8192, | ||
|
|
@@ -472,9 +480,7 @@ const createConverseCommandInput = ( | |
| ...params.inferenceConfig, | ||
| temperature: 1, // reasoning requires temperature to be 1 | ||
| topP: undefined, // reasoning does not require topP | ||
| maxTokens: | ||
| (model.modelParameters?.reasoningConfig?.budgetTokens || 0) + | ||
| (params.inferenceConfig?.maxTokens || 0), | ||
| maxTokens: params.inferenceConfig?.maxTokens, | ||
| }; | ||
| converseCommandInput.additionalModelRequestFields = { | ||
| reasoning_config: { | ||
|
|
@@ -929,79 +935,79 @@ export const BEDROCK_TEXT_GEN_MODELS: { | |
| }; | ||
| } = { | ||
| 'us.anthropic.claude-opus-4-1-20250805-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_OPUS_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'us.anthropic.claude-opus-4-20250514-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_OPUS_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'global.anthropic.claude-sonnet-4-5-20250929-v1:0': { | ||
| defaultParams: CLAUDE_4_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'us.anthropic.claude-sonnet-4-5-20250929-v1:0': { | ||
| defaultParams: CLAUDE_4_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'eu.anthropic.claude-sonnet-4-5-20250929-v1:0': { | ||
| defaultParams: CLAUDE_4_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'jp.anthropic.claude-sonnet-4-5-20250929-v1:0': { | ||
| defaultParams: CLAUDE_4_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'global.anthropic.claude-sonnet-4-20250514-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'us.anthropic.claude-sonnet-4-20250514-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'eu.anthropic.claude-sonnet-4-20250514-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'apac.anthropic.claude-sonnet-4-20250514-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
|
|
@@ -1041,23 +1047,23 @@ export const BEDROCK_TEXT_GEN_MODELS: { | |
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'us.anthropic.claude-3-7-sonnet-20250219-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'eu.anthropic.claude-3-7-sonnet-20250219-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
| extractConverseOutput: extractConverseOutput, | ||
| extractConverseStreamOutput: extractConverseStreamOutput, | ||
| }, | ||
| 'apac.anthropic.claude-3-7-sonnet-20250219-v1:0': { | ||
| defaultParams: CLAUDE_3_5_DEFAULT_PARAMS, | ||
| defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS, | ||
| usecaseParams: USECASE_DEFAULT_PARAMS, | ||
| createConverseCommandInput: createConverseCommandInput, | ||
| createConverseStreamCommandInput: createConverseStreamCommandInput, | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
もともと 4.5 用に作っていたものですが、sonnet 4 系(と例外で3.7)としてまとめられるのでこの表記に変えました。