-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
community[patch]: bedrock: add model name to identifying params (cach…
…e keys) (#4758) * bedrock: add model name to identifying params (cache keys) * Fix test * Fix --------- Co-authored-by: jacoblee93 <[email protected]>
- Loading branch information
1 parent
5af48bc
commit f4b0cf8
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
libs/langchain-community/src/chat_models/tests/chatbedrock.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* eslint-disable no-process-env */ | ||
/* eslint-disable @typescript-eslint/no-non-null-assertion */ | ||
|
||
import { BedrockChat } from "../bedrock/web.js"; | ||
|
||
test("Test Bedrock identifying params", async () => { | ||
const region = "us-east-1"; | ||
const model = "anthropic.claude-v2"; | ||
|
||
const bedrock = new BedrockChat({ | ||
maxTokens: 20, | ||
region, | ||
model, | ||
maxRetries: 0, | ||
credentials: { | ||
accessKeyId: "unused", | ||
secretAccessKey: "unused", | ||
sessionToken: "unused", | ||
}, | ||
}); | ||
|
||
expect(bedrock._identifyingParams()).toMatchObject({ | ||
model, | ||
}); | ||
}); |