summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-12-04 21:03:59 +0800
committerGitHub <noreply@github.com>2024-12-04 21:03:59 +0800
commit3a3388375be05758d5f5574cce1d0f8eb7bdd604 (patch)
treecc8e19e218c20f28a04feca33850fce4bb2cbe98 /src/main.rs
parent7d42fe9429f75d195f865b07cef10d040d5397f2 (diff)
downloadaichat-3a3388375be05758d5f5574cce1d0f8eb7bdd604.tar.gz
refactor: improve retrieve model (#1036)
- check the model type while retrieve model - select chat/reranker model even if it is missed in client models - find predefined-models for openai-compatible client with startsWith - remove client::ApiType
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 77b72c2..97fbf72 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,9 @@ mod utils;
extern crate log;
use crate::cli::Cli;
-use crate::client::{call_chat_completions, call_chat_completions_streaming, list_chat_models};
+use crate::client::{
+ call_chat_completions, call_chat_completions_streaming, list_models, ModelType,
+};
use crate::config::{
ensure_parent_exists, list_agents, load_env_file, Config, GlobalConfig, Input, WorkingMode,
CODE_ROLE, EXPLAIN_SHELL_ROLE, SHELL_ROLE, TEMP_SESSION_NAME,
@@ -69,7 +71,7 @@ async fn run(config: GlobalConfig, cli: Cli, text: Option<String>) -> Result<()>
}
if cli.list_models {
- for model in list_chat_models(&config.read()) {
+ for model in list_models(&config.read(), ModelType::Chat) {
println!("{}", model.id());
}
return Ok(());