|
| 1 | +// npx jest src/api/providers/__tests__/bedrock-invokedModelId.test.ts |
| 2 | + |
| 3 | +import { ApiHandlerOptions } from "../../../shared/api" |
| 4 | + |
| 5 | +import { AwsBedrockHandler, StreamEvent } from "../bedrock" |
| 6 | + |
1 | 7 | // Mock AWS SDK credential providers and Bedrock client |
2 | 8 | jest.mock("@aws-sdk/credential-providers", () => ({ |
3 | 9 | fromIni: jest.fn().mockReturnValue({ |
@@ -62,11 +68,6 @@ jest.mock("@aws-sdk/client-bedrock-runtime", () => { |
62 | 68 | } |
63 | 69 | }) |
64 | 70 |
|
65 | | -import { AwsBedrockHandler, StreamEvent } from "../bedrock" |
66 | | -import { ApiHandlerOptions } from "../../../shared/api" |
67 | | -import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime" |
68 | | -const { fromIni } = require("@aws-sdk/credential-providers") |
69 | | - |
70 | 71 | describe("AwsBedrockHandler with invokedModelId", () => { |
71 | 72 | let mockSend: jest.Mock |
72 | 73 |
|
@@ -279,17 +280,6 @@ describe("AwsBedrockHandler with invokedModelId", () => { |
279 | 280 | } |
280 | 281 | }) |
281 | 282 |
|
282 | | - // Mock getModel to return expected values |
283 | | - const getModelSpy = jest.spyOn(handler, "getModel").mockReturnValue({ |
284 | | - id: "anthropic.claude-3-5-sonnet-20241022-v2:0", |
285 | | - info: { |
286 | | - maxTokens: 4096, |
287 | | - contextWindow: 128_000, |
288 | | - supportsPromptCache: false, |
289 | | - supportsImages: true, |
290 | | - }, |
291 | | - }) |
292 | | - |
293 | 283 | // Create a message generator |
294 | 284 | const messageGenerator = handler.createMessage("system prompt", [{ role: "user", content: "user message" }]) |
295 | 285 |
|
|
0 commit comments