Skip to content

Commit e67b9df

Browse files
committed
fix: address greptile review feedback on PR #3708
Use BedrockRuntimeClientConfig from SDK instead of inline type. Add default return value for prepareToolsWithUsageControl mock. Signed-off-by: majiayu000 <1835304752@qq.com>
1 parent 0418a45 commit e67b9df

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

apps/sim/providers/bedrock/index.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ vi.mock('@/providers/models', () => ({
3030
vi.mock('@/providers/utils', () => ({
3131
calculateCost: vi.fn().mockReturnValue({ input: 0, output: 0, total: 0, pricing: null }),
3232
prepareToolExecution: vi.fn(),
33-
prepareToolsWithUsageControl: vi.fn(),
33+
prepareToolsWithUsageControl: vi.fn().mockReturnValue({
34+
tools: [],
35+
toolChoice: 'auto',
36+
forcedTools: [],
37+
}),
3438
sumToolCosts: vi.fn().mockReturnValue(0),
3539
}))
3640

apps/sim/providers/bedrock/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
type Message as BedrockMessage,
33
BedrockRuntimeClient,
4+
type BedrockRuntimeClientConfig,
45
type ContentBlock,
56
type ConversationRole,
67
ConverseCommand,
@@ -68,10 +69,7 @@ export const bedrockProvider: ProviderConfig = {
6869
)
6970
}
7071

71-
const clientConfig: {
72-
region: string
73-
credentials?: { accessKeyId: string; secretAccessKey: string }
74-
} = { region }
72+
const clientConfig: BedrockRuntimeClientConfig = { region }
7573
if (request.bedrockAccessKeyId && request.bedrockSecretKey) {
7674
clientConfig.credentials = {
7775
accessKeyId: request.bedrockAccessKeyId,

0 commit comments

Comments
 (0)