From 9a8b302432a3f9bfa1e467dde027fc92dacce3e2 Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 7 Nov 2023 10:56:28 +0800 Subject: refactor: remove Model.client_index, match client by name (#218) --- src/client/qianwen.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/qianwen.rs') diff --git a/src/client/qianwen.rs b/src/client/qianwen.rs index 162fcc2..b8e0d6f 100644 --- a/src/client/qianwen.rs +++ b/src/client/qianwen.rs @@ -54,11 +54,11 @@ impl QianwenClient { pub const PROMPTS: [PromptType<'static>; 1] = [("api_key", "API Key:", true, PromptKind::String)]; - pub fn list_models(local_config: &QianwenConfig, client_index: usize) -> Vec { + pub fn list_models(local_config: &QianwenConfig) -> Vec { let client_name = Self::name(local_config); MODELS .into_iter() - .map(|(name, max_tokens)| Model::new(client_index, client_name, name).set_max_tokens(Some(max_tokens))) + .map(|(name, max_tokens)| Model::new(client_name, name).set_max_tokens(Some(max_tokens))) .collect() } -- cgit v1.2.3