Skip to content

Commit d37cec9

Browse files
committed
Add BedrockThinkingConfig interface and update payload structure
1 parent 9a2d743 commit d37cec9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/api/providers/bedrock.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,23 @@ interface BedrockInferenceConfig {
4646
topP?: number
4747
}
4848

49+
// Define interface for Bedrock thinking configuration
50+
interface BedrockThinkingConfig {
51+
thinking: {
52+
type: "enabled"
53+
budget_tokens: number
54+
}
55+
[key: string]: any // Add index signature to be compatible with DocumentType
56+
}
57+
4958
// Define interface for Bedrock payload
5059
interface BedrockPayload {
5160
modelId: BedrockModelId | string
5261
messages: Message[]
5362
system?: SystemContentBlock[]
5463
inferenceConfig: BedrockInferenceConfig
5564
anthropic_version?: string
56-
additionalModelRequestFields?: any
65+
additionalModelRequestFields?: BedrockThinkingConfig
5766
}
5867

5968
// Define types for stream events based on AWS SDK
@@ -315,7 +324,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
315324
conversationId,
316325
)
317326

318-
let additionalModelRequestFields: any | undefined
327+
let additionalModelRequestFields: BedrockThinkingConfig | undefined
319328
let thinkingEnabled = false
320329

321330
if (

0 commit comments

Comments
 (0)