Skip to content

Commit

Permalink
🔧 fix: model key retrieval logic to account for Bedrock region
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila committed Dec 18, 2024
1 parent d3cafee commit 51b28a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/data-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "librechat-data-provider",
"version": "0.7.64",
"version": "0.7.65",
"description": "data services for librechat apps",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
6 changes: 5 additions & 1 deletion packages/data-provider/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export enum BedrockProviders {

export const getModelKey = (endpoint: EModelEndpoint | string, model: string) => {
if (endpoint === EModelEndpoint.bedrock) {
return model.split('.')[0] as BedrockProviders;
const parts = model.split('.');
const provider = [parts[0], parts[1]].find((part) =>
Object.values(BedrockProviders).includes(part as BedrockProviders),
);
return (provider ?? parts[0]) as BedrockProviders;
}
return model;
};
Expand Down

0 comments on commit 51b28a0

Please sign in to comment.