From 8e5d4e55b1a5158a1f35adaf044dec545159f426 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 6 Mar 2024 08:35:40 +0800 Subject: refactor: rename model's `max_tokens` to `max_input_tokens` (#339) BREAKING CHANGE: rename model's `max_tokens` to `max_input_tokens` --- src/client/qianwen.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/client/qianwen.rs') diff --git a/src/client/qianwen.rs b/src/client/qianwen.rs index 70c251a..1858030 100644 --- a/src/client/qianwen.rs +++ b/src/client/qianwen.rs @@ -25,10 +25,12 @@ const API_URL_VL: &str = "https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation"; const MODELS: [(&str, usize, &str); 6] = [ - ("qwen-turbo", 8192, "text"), - ("qwen-plus", 32768, "text"), - ("qwen-max", 8192, "text"), - ("qwen-max-longcontext", 30720, "text"), + // 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"), + // https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-plus-api ("qwen-vl-plus", 0, "text,vision"), ("qwen-vl-max", 0, "text,vision"), ]; @@ -78,10 +80,10 @@ impl QianwenClient { let client_name = Self::name(local_config); MODELS .into_iter() - .map(|(name, max_tokens, capabilities)| { + .map(|(name, max_input_tokens, capabilities)| { Model::new(client_name, name) .set_capabilities(capabilities.into()) - .set_max_tokens(Some(max_tokens)) + .set_max_input_tokens(Some(max_input_tokens)) }) .collect() } -- cgit v1.2.3