summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/common.rs29
-rw-r--r--src/client/mod.rs3
2 files changed, 18 insertions, 14 deletions
diff --git a/src/client/common.rs b/src/client/common.rs
index cfbb9d6..99b84b9 100644
--- a/src/client/common.rs
+++ b/src/client/common.rs
@@ -553,24 +553,29 @@ async fn set_client_models_config(client_config: &mut Value, client: &str) -> Re
std::env::var(&env_name).ok()
}),
) {
- if let Ok(fetched_models) = abortable_run_with_spinner(
+ match abortable_run_with_spinner(
fetch_models(api_base, api_key.as_deref()),
"Fetching models",
create_abort_signal(),
)
.await
{
- model_names = MultiSelect::new("LLM models (required):", fetched_models)
- .with_validator(|list: &[ListOption<&String>]| {
- if list.is_empty() {
- Ok(Validation::Invalid(
- "At least one item must be selected".into(),
- ))
- } else {
- Ok(Validation::Valid)
- }
- })
- .prompt()?;
+ Ok(fetched_models) => {
+ model_names = MultiSelect::new("LLM models (required):", fetched_models)
+ .with_validator(|list: &[ListOption<&String>]| {
+ if list.is_empty() {
+ Ok(Validation::Invalid(
+ "At least one item must be selected".into(),
+ ))
+ } else {
+ Ok(Validation::Valid)
+ }
+ })
+ .prompt()?;
+ }
+ Err(err) => {
+ eprintln!("✗ Unable to fetch models: {err}");
+ }
}
}
if model_names.is_empty() {
diff --git a/src/client/mod.rs b/src/client/mod.rs
index c6b65bc..af0ace1 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -33,7 +33,7 @@ register_client!(
(bedrock, "bedrock", BedrockConfig, BedrockClient),
);
-pub const OPENAI_COMPATIBLE_PROVIDERS: [(&str, &str); 25] = [
+pub const OPENAI_COMPATIBLE_PROVIDERS: [(&str, &str); 24] = [
("ai21", "https://api.ai21.com/studio/v1"),
(
"cloudflare",
@@ -53,7 +53,6 @@ pub const OPENAI_COMPATIBLE_PROVIDERS: [(&str, &str); 25] = [
("moonshot", "https://api.moonshot.cn/v1"),
("novita", "https://api.novita.ai/v3/openai"),
("openrouter", "https://openrouter.ai/api/v1"),
- ("ollama", "http://{OLLAMA_HOST}:11434/v1"),
("perplexity", "https://api.perplexity.ai"),
(
"qianwen",