summaryrefslogtreecommitdiffstats
path: root/src/client/macros.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2025-01-22 20:51:10 +0800
committerGitHub <noreply@github.com>2025-01-22 20:51:10 +0800
commite0417e8d5bebe25476aaafa22a9ee23d9bd61457 (patch)
tree8edcd3aa9bcd1b012a3a429ad6240e6186caef36 /src/client/macros.rs
parentdf4440a2a049d26c61a540d3254cd885345fbd6c (diff)
downloadaichat-e0417e8d5bebe25476aaafa22a9ee23d9bd61457.tar.gz
feat: add `--sync-models` cli option (#1114)
Diffstat (limited to 'src/client/macros.rs')
-rw-r--r--src/client/macros.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/macros.rs b/src/client/macros.rs
index a76e62b..97171db 100644
--- a/src/client/macros.rs
+++ b/src/client/macros.rs
@@ -52,10 +52,10 @@ macro_rules! register_client {
pub fn list_models(local_config: &$config) -> Vec<Model> {
let client_name = Self::name(local_config);
if local_config.models.is_empty() {
- if let Some(models) = $crate::client::ALL_PREDEFINED_MODELS.iter().find(|v| {
- v.platform == $name ||
+ if let Some(models) = $crate::client::ALL_PROVIDER_MODELS.iter().find(|v| {
+ v.provider == $name ||
($name == OpenAICompatibleClient::NAME
- && local_config.name.as_ref().map(|name| name.starts_with(&v.platform)).unwrap_or_default())
+ && local_config.name.as_ref().map(|name| name.starts_with(&v.provider)).unwrap_or_default())
}) {
return Model::from_config(client_name, &models.models);
}
@@ -83,7 +83,7 @@ macro_rules! register_client {
pub fn list_client_types() -> Vec<&'static str> {
let mut client_types: Vec<_> = vec![$($client::NAME,)+];
- client_types.extend($crate::client::OPENAI_COMPATIBLE_PLATFORMS.iter().map(|(name, _)| *name));
+ client_types.extend($crate::client::OPENAI_COMPATIBLE_PROVIDERS.iter().map(|(name, _)| *name));
client_types
}