Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aibridge/intercept/messages/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ func bedrockModelSupportsAdaptiveThinking(model string) bool {
//
// See https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-opus-4-7.html
func bedrockModelRequiresAdaptiveThinking(model string) bool {
return strings.Contains(model, "anthropic.claude-opus-4-7")
return strings.Contains(model, "anthropic.claude-opus-4-7") ||
strings.Contains(model, "anthropic.claude-opus-4-8")
}

// filterBedrockBetaFlags removes unsupported beta flags from the Anthropic-Beta
Expand Down
6 changes: 6 additions & 0 deletions aibridge/intercept/messages/base_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,12 @@ func TestAugmentRequestForBedrock_AdaptiveThinking(t *testing.T) {
requestBody: `{"max_tokens":10000,"thinking":{"type":"enabled","budget_tokens":8000}}`,
expectThinkingType: "adaptive",
},
{
name: "opus_4_8_model_with_enabled_thinking_is_converted_to_adaptive_and_drops_budget",
bedrockModel: "eu.anthropic.claude-opus-4-8",
requestBody: `{"max_tokens":10000,"thinking":{"type":"enabled","budget_tokens":5000}}`,
expectThinkingType: "adaptive",
},
{
// Opus 4.7 on Bedrock rejects output_config.format (structured
// outputs) with a 400 even though it accepts output_config.effort.
Expand Down
Loading