From 9c6c9f10a27d0993636b453f39d8934c95c5c2b2 Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 23 Apr 2024 18:14:47 +0800 Subject: feat: builtin models can be overwrited by models config (#429) --- src/client/openai_compatible.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/client/openai_compatible.rs') diff --git a/src/client/openai_compatible.rs b/src/client/openai_compatible.rs index f25d931..b4cb5f4 100644 --- a/src/client/openai_compatible.rs +++ b/src/client/openai_compatible.rs @@ -1,5 +1,5 @@ use super::openai::openai_build_body; -use super::{convert_models, ExtraConfig, Model, ModelConfig, OpenAICompatibleClient, PromptType, SendData}; +use super::{ExtraConfig, Model, ModelConfig, OpenAICompatibleClient, PromptType, SendData}; use crate::utils::PromptKind; @@ -21,6 +21,7 @@ pub struct OpenAICompatibleConfig { openai_compatible_client!(OpenAICompatibleClient); impl OpenAICompatibleClient { + list_models_fn!(OpenAICompatibleConfig); config_get_fn!(api_key, get_api_key); pub const PROMPTS: [PromptType<'static>; 5] = [ @@ -36,11 +37,6 @@ impl OpenAICompatibleClient { ), ]; - pub fn list_models(local_config: &OpenAICompatibleConfig) -> Vec { - let client_name = Self::name(local_config); - convert_models(client_name, &local_config.models) - } - fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result { let api_key = self.get_api_key().ok(); -- cgit v1.2.3