Skip to content

Commit 6c74e9b

Browse files
PR review cleanup
1 parent 613370a commit 6c74e9b

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

src/__mocks__/jest.setup.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
// Mock the logger globally for all tests
22
jest.mock("../utils/logging", () => ({
33
logger: {
4-
debug: jest.fn().mockImplementation((message, meta) => {
5-
console.log(`DEBUG: ${message}`, meta ? JSON.stringify(meta) : "")
6-
}),
4+
debug: jest.fn(),
75
info: jest.fn(),
86
warn: jest.fn(),
97
error: jest.fn(),
108
fatal: jest.fn(),
119
child: jest.fn().mockReturnValue({
12-
debug: jest.fn().mockImplementation((message, meta) => {
13-
console.log(`DEBUG: ${message}`, meta ? JSON.stringify(meta) : "")
14-
}),
10+
debug: jest.fn(),
1511
info: jest.fn(),
1612
warn: jest.fn(),
1713
error: jest.fn(),

src/api/providers/__tests__/bedrock.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ describe("AwsBedrockHandler", () => {
348348
"arn:aws:bedrock:us-west-2:699475926481:inference-profile/us.meta.llama3-8b-instruct-v1:0",
349349
)
350350

351-
//
351+
//these should not be the default fall back. they should be Llama's config
352352
expect(modelInfo.info.maxTokens).toBe(2048)
353353
expect(modelInfo.info.contextWindow).toBe(4_000)
354354
expect(modelInfo.info.supportsImages).toBe(false)

src/api/providers/bedrock.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,6 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
295295

296296
if (region === "us." || region === "eu.") modelName = modelName.slice(3)
297297
this.costModelConfig = this.getModelByName(modelName)
298-
logger.debug("Updated modelConfig using invokedModelId from a prompt router response", {
299-
ctx: "bedrock",
300-
modelConfig: this.costModelConfig,
301-
})
302298
}
303299

304300
// Handle metadata events for the promptRouter.
@@ -528,21 +524,17 @@ Please check:
528524
modelData.id = this.options.awsCustomArn
529525

530526
if (modelData) {
531-
logger.debug(`Matched custom ARN to model: ${modelName}`, {
532-
ctx: "bedrock",
533-
modelData,
534-
})
535527
return modelData
536528
}
537529
}
538530

539531
// An ARN was used, but no model info match found, use default values based on common patterns
540-
let modelInfo = this.getModelByName(bedrockDefaultPromptRouterModelId)
532+
let model = this.getModelByName(bedrockDefaultPromptRouterModelId)
541533

542534
// For custom ARNs, always return the specific values expected by tests
543535
return {
544536
id: this.options.awsCustomArn,
545-
info: modelInfo.info,
537+
info: model.info,
546538
}
547539
}
548540

@@ -556,11 +548,6 @@ Please check:
556548

557549
// For tests, allow any model ID (but not custom ARNs, which are handled above)
558550
if (process.env.NODE_ENV === "test") {
559-
logger.debug("Return defaults 4", {
560-
ctx: "bedrock",
561-
customArn: this.options.awsCustomArn,
562-
})
563-
564551
return {
565552
id: this.options.apiModelId,
566553
info: {
@@ -662,7 +649,6 @@ Please check:
662649
try {
663650
const outputStr = new TextDecoder().decode(response.output)
664651
const output = JSON.parse(outputStr)
665-
logger.debug("Bedrock response", { ctx: "bedrock", output: output })
666652
if (output.content) {
667653
return output.content
668654
}

0 commit comments

Comments
 (0)