Smartsheet-JB-Brown 11 месяцев назад
Родитель
Сommit
6c74e9ba7b

+ 2 - 6
src/__mocks__/jest.setup.ts

@@ -1,17 +1,13 @@
 // Mock the logger globally for all tests
 jest.mock("../utils/logging", () => ({
 	logger: {
-		debug: jest.fn().mockImplementation((message, meta) => {
-			console.log(`DEBUG: ${message}`, meta ? JSON.stringify(meta) : "")
-		}),
+		debug: jest.fn(),
 		info: jest.fn(),
 		warn: jest.fn(),
 		error: jest.fn(),
 		fatal: jest.fn(),
 		child: jest.fn().mockReturnValue({
-			debug: jest.fn().mockImplementation((message, meta) => {
-				console.log(`DEBUG: ${message}`, meta ? JSON.stringify(meta) : "")
-			}),
+			debug: jest.fn(),
 			info: jest.fn(),
 			warn: jest.fn(),
 			error: jest.fn(),

+ 1 - 1
src/api/providers/__tests__/bedrock.test.ts

@@ -348,7 +348,7 @@ describe("AwsBedrockHandler", () => {
 				"arn:aws:bedrock:us-west-2:699475926481:inference-profile/us.meta.llama3-8b-instruct-v1:0",
 			)
 
-			//
+			//these should not be the default fall back. they should be Llama's config
 			expect(modelInfo.info.maxTokens).toBe(2048)
 			expect(modelInfo.info.contextWindow).toBe(4_000)
 			expect(modelInfo.info.supportsImages).toBe(false)

+ 2 - 16
src/api/providers/bedrock.ts

@@ -295,10 +295,6 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
 
 							if (region === "us." || region === "eu.") modelName = modelName.slice(3)
 							this.costModelConfig = this.getModelByName(modelName)
-							logger.debug("Updated modelConfig using invokedModelId from a prompt router response", {
-								ctx: "bedrock",
-								modelConfig: this.costModelConfig,
-							})
 						}
 
 						// Handle metadata events for the promptRouter.
@@ -528,21 +524,17 @@ Please check:
 				modelData.id = this.options.awsCustomArn
 
 				if (modelData) {
-					logger.debug(`Matched custom ARN to model: ${modelName}`, {
-						ctx: "bedrock",
-						modelData,
-					})
 					return modelData
 				}
 			}
 
 			// An ARN was used, but no model info match found, use default values based on common patterns
-			let modelInfo = this.getModelByName(bedrockDefaultPromptRouterModelId)
+			let model = this.getModelByName(bedrockDefaultPromptRouterModelId)
 
 			// For custom ARNs, always return the specific values expected by tests
 			return {
 				id: this.options.awsCustomArn,
-				info: modelInfo.info,
+				info: model.info,
 			}
 		}
 
@@ -556,11 +548,6 @@ Please check:
 
 			// For tests, allow any model ID (but not custom ARNs, which are handled above)
 			if (process.env.NODE_ENV === "test") {
-				logger.debug("Return defaults 4", {
-					ctx: "bedrock",
-					customArn: this.options.awsCustomArn,
-				})
-
 				return {
 					id: this.options.apiModelId,
 					info: {
@@ -662,7 +649,6 @@ Please check:
 				try {
 					const outputStr = new TextDecoder().decode(response.output)
 					const output = JSON.parse(outputStr)
-					logger.debug("Bedrock response", { ctx: "bedrock", output: output })
 					if (output.content) {
 						return output.content
 					}