summaryrefslogtreecommitdiffstats
path: root/src/client/azure_openai.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-23 18:14:47 +0800
committerGitHub <noreply@github.com>2024-04-23 18:14:47 +0800
commit9c6c9f10a27d0993636b453f39d8934c95c5c2b2 (patch)
tree268598294b234c7eac87fc70d1e2d1b32ac88a78 /src/client/azure_openai.rs
parentd1aafa11153ab689c21c2c57c47da52337d8e8d1 (diff)
downloadaichat-9c6c9f10a27d0993636b453f39d8934c95c5c2b2.tar.gz
feat: builtin models can be overwrited by models config (#429)
Diffstat (limited to 'src/client/azure_openai.rs')
-rw-r--r--src/client/azure_openai.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/client/azure_openai.rs b/src/client/azure_openai.rs
index 1726bbe..9e96692 100644
--- a/src/client/azure_openai.rs
+++ b/src/client/azure_openai.rs
@@ -1,5 +1,5 @@
use super::openai::openai_build_body;
-use super::{convert_models, AzureOpenAIClient, ExtraConfig, Model, ModelConfig, PromptType, SendData};
+use super::{AzureOpenAIClient, ExtraConfig, Model, ModelConfig, PromptType, SendData};
use crate::utils::PromptKind;
@@ -20,6 +20,7 @@ pub struct AzureOpenAIConfig {
openai_compatible_client!(AzureOpenAIClient);
impl AzureOpenAIClient {
+ list_models_fn!(AzureOpenAIConfig);
config_get_fn!(api_base, get_api_base);
config_get_fn!(api_key, get_api_key);
@@ -35,11 +36,6 @@ impl AzureOpenAIClient {
),
];
- pub fn list_models(local_config: &AzureOpenAIConfig) -> Vec<Model> {
- let client_name = Self::name(local_config);
- convert_models(client_name, &local_config.models)
- }
-
fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result<RequestBuilder> {
let api_base = self.get_api_base()?;
let api_key = self.get_api_key()?;