去掉sdk的引入,客户端也能直连

This commit is contained in:
glay
2024-11-20 15:25:36 +08:00
parent 9d3f1d2529
commit f60c237b16
9 changed files with 643 additions and 601 deletions

View File

@@ -241,9 +241,10 @@ export const ChatGLM = {
};
export const Bedrock = {
ChatPath: "converse",
ChatPath: "model", // Simplified path since we'll append the full path in bedrock.ts
ApiVersion: "2023-11-01",
getEndpoint: (region: string = "us-west-2") =>`https://bedrock-runtime.${region}.amazonaws.com`,
getEndpoint: (region: string = "us-west-2") =>
`https://bedrock-runtime.${region}.amazonaws.com`,
};
export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
@@ -326,19 +327,43 @@ const openaiModels = [
];
const bedrockModels = [
// Amazon Titan Models
"amazon.titan-text-express-v1",
"amazon.titan-text-lite-v1",
"amazon.titan-text-agile-v1",
// Cohere Models
"cohere.command-light-text-v14",
"cohere.command-r-plus-v1:0",
"cohere.command-r-v1:0",
"cohere.command-text-v14",
// Claude Models
"anthropic.claude-3-haiku-20240307-v1:0",
"anthropic.claude-3-5-haiku-20241022-v1:0",
"anthropic.claude-3-sonnet-20240229-v1:0",
"anthropic.claude-3-5-sonnet-20241022-v2:0",
"anthropic.claude-3-opus-20240229-v1:0",
"anthropic.claude-2.1",
"anthropic.claude-v2",
"anthropic.claude-v1",
"anthropic.claude-instant-v1",
// Meta Llama Models
"us.meta.llama3-2-11b-instruct-v1:0",
"us.meta.llama3-2-90b-instruct-v1:0",
//Mistral
"meta.llama2-13b-chat-v1",
"meta.llama2-70b-chat-v1",
"meta.llama3-8b-instruct-v1:0",
"meta.llama3-2-11b-instruct-v1:0",
"meta.llama3-2-90b-instruct-v1:0",
// Mistral Models
"mistral.mistral-7b-instruct-v0:2",
"mistral.mistral-large-2402-v1:0",
"mistral.mistral-large-2407-v1:0",
// AI21 Models
"ai21.j2-mid-v1",
"ai21.j2-ultra-v1",
];
const googleModels = [