summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-06 09:10:42 +0800
committerGitHub <noreply@github.com>2024-04-06 09:10:42 +0800
commite28b53a405256f040db329fbb23676b0e9f10774 (patch)
tree0117999e705599a582c7e0baa6e3112365f96cf9 /src
parent2654542601df9cc472ccc17487d8852dcb2c0d1d (diff)
downloadaichat-e28b53a405256f040db329fbb23676b0e9f10774.tar.gz
refactor: update models (#388)
Diffstat (limited to 'src')
-rw-r--r--src/client/ernie.rs3
-rw-r--r--src/client/mistral.rs8
-rw-r--r--src/client/openai.rs8
-rw-r--r--src/client/qianwen.rs6
4 files changed, 13 insertions, 12 deletions
diff --git a/src/client/ernie.rs b/src/client/ernie.rs
index 5c8b563..060f89b 100644
--- a/src/client/ernie.rs
+++ b/src/client/ernie.rs
@@ -15,7 +15,7 @@ use std::{env, sync::Mutex};
const API_BASE: &str = "https://aip.baidubce.com/rpc/2.0/ai_custom/v1";
const ACCESS_TOKEN_URL: &str = "https://aip.baidubce.com/oauth/2.0/token";
-const MODELS: [(&str, usize, &str); 6] = [
+const MODELS: [(&str, usize, &str); 7] = [
// https://cloud.baidu.com/doc/WENXINWORKSHOP/s/clntwmv7t
("ernie-4.0-8k", 5120, "/wenxinworkshop/chat/completions_pro"),
(
@@ -35,6 +35,7 @@ const MODELS: [(&str, usize, &str); 6] = [
"/wenxinworkshop/chat/ernie-speed-128k",
),
("ernie-lite-8k", 7168, "/wenxinworkshop/chat/ernie-lite-8k"),
+ ("ernie-tiny-8k", 7168, "/wenxinworkshop/chat/ernie-tiny-8k"),
];
lazy_static! {
diff --git a/src/client/mistral.rs b/src/client/mistral.rs
index 36478b8..0ebb631 100644
--- a/src/client/mistral.rs
+++ b/src/client/mistral.rs
@@ -12,11 +12,11 @@ const API_URL: &str = "https://api.mistral.ai/v1/chat/completions";
const MODELS: [(&str, usize, &str); 5] = [
// https://docs.mistral.ai/platform/endpoints/
- ("mistral-large-latest", 32000, "text"),
- ("mistral-medium-latest", 32000, "text"),
- ("mistral-small-latest", 32000, "text"),
- ("open-mixtral-8x7b", 32000, "text"),
("open-mistral-7b", 32000, "text"),
+ ("open-mixtral-8x7b", 32000, "text"),
+ ("mistral-small-latest", 32000, "text"),
+ ("mistral-medium-latest", 32000, "text"),
+ ("mistral-large-latest", 32000, "text"),
];
diff --git a/src/client/openai.rs b/src/client/openai.rs
index a1bd3db..83dd65d 100644
--- a/src/client/openai.rs
+++ b/src/client/openai.rs
@@ -13,13 +13,13 @@ use serde_json::{json, Value};
const API_BASE: &str = "https://api.openai.com/v1";
const MODELS: [(&str, usize, &str); 5] = [
- // https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
- ("gpt-4-turbo-preview", 128000, "text"),
- ("gpt-4-vision-preview", 128000, "text,vision"),
- ("gpt-4-1106-preview", 128000, "text"),
// https://platform.openai.com/docs/models/gpt-3-5-turbo
("gpt-3.5-turbo", 16385, "text"),
("gpt-3.5-turbo-1106", 16385, "text"),
+ // https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
+ ("gpt-4-turbo-preview", 128000, "text"),
+ ("gpt-4-1106-preview", 128000, "text"),
+ ("gpt-4-vision-preview", 128000, "text,vision"),
];
pub const OPENAI_TOKENS_COUNT_FACTORS: TokensCountFactors = (5, 2);
diff --git a/src/client/qianwen.rs b/src/client/qianwen.rs
index a95556b..3e69dae 100644
--- a/src/client/qianwen.rs
+++ b/src/client/qianwen.rs
@@ -28,13 +28,13 @@ const API_URL_VL: &str =
const MODELS: [(&str, usize, &str); 6] = [
// https://help.aliyun.com/zh/dashscope/developer-reference/api-details
+ ("qwen-turbo", 6000, "text"),
+ ("qwen-plus", 30000, "text"),
("qwen-max", 6000, "text"),
("qwen-max-longcontext", 28000, "text"),
- ("qwen-plus", 30000, "text"),
- ("qwen-turbo", 6000, "text"),
// https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-plus-api
- ("qwen-vl-max", 0, "text,vision"),
("qwen-vl-plus", 0, "text,vision"),
+ ("qwen-vl-max", 0, "text,vision"),
];
const TOKENS_COUNT_FACTORS: TokensCountFactors = (4, 14);