mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-07-30 06:32:17 +00:00
fix: expose MiniMax in init provider lists
This commit is contained in:
@@ -1476,9 +1476,30 @@ fn provider_list() -> Vec<(&'static str, &'static str, &'static str, &'static st
|
||||
"openrouter/google/gemini-2.5-flash",
|
||||
"OpenRouter",
|
||||
),
|
||||
("minimax", "MINIMAX_API_KEY", "MiniMax-M2.7", "MiniMax"),
|
||||
]
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod provider_list_tests {
|
||||
use super::provider_list;
|
||||
|
||||
#[test]
|
||||
fn provider_list_includes_minimax() {
|
||||
let minimax = provider_list()
|
||||
.into_iter()
|
||||
.find(|(provider, _, _, _)| *provider == "minimax");
|
||||
assert!(
|
||||
minimax.is_some(),
|
||||
"MiniMax should be exposed by provider_list()"
|
||||
);
|
||||
let (_, env_var, model, display) = minimax.unwrap();
|
||||
assert_eq!(env_var, "MINIMAX_API_KEY");
|
||||
assert_eq!(model, "MiniMax-M2.7");
|
||||
assert_eq!(display, "MiniMax");
|
||||
}
|
||||
}
|
||||
|
||||
/// Quick probe to check if Ollama is running on localhost.
|
||||
fn check_ollama_available() -> bool {
|
||||
std::net::TcpStream::connect_timeout(
|
||||
|
||||
@@ -148,6 +148,14 @@ const PROVIDERS: &[ProviderInfo] = &[
|
||||
needs_key: true,
|
||||
hint: "",
|
||||
},
|
||||
ProviderInfo {
|
||||
name: "minimax",
|
||||
display: "MiniMax",
|
||||
env_var: "MINIMAX_API_KEY",
|
||||
default_model: "MiniMax-M2.7",
|
||||
needs_key: true,
|
||||
hint: "",
|
||||
},
|
||||
ProviderInfo {
|
||||
name: "huggingface",
|
||||
display: "Hugging Face",
|
||||
@@ -258,6 +266,23 @@ pub enum InitResult {
|
||||
Cancelled,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::PROVIDERS;
|
||||
|
||||
#[test]
|
||||
fn init_wizard_lists_minimax_provider() {
|
||||
let minimax = PROVIDERS.iter().find(|provider| provider.name == "minimax");
|
||||
assert!(
|
||||
minimax.is_some(),
|
||||
"MiniMax should be selectable in openfang init"
|
||||
);
|
||||
let minimax = minimax.unwrap();
|
||||
assert_eq!(minimax.env_var, "MINIMAX_API_KEY");
|
||||
assert_eq!(minimax.default_model, "MiniMax-M2.7");
|
||||
}
|
||||
}
|
||||
|
||||
// ── Internal state ─────────────────────────────────────────────────────────
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
|
||||
@@ -85,6 +85,12 @@ const PROVIDERS: &[ProviderInfo] = &[
|
||||
default_model: "qwen-plus",
|
||||
needs_key: true,
|
||||
},
|
||||
ProviderInfo {
|
||||
name: "minimax",
|
||||
env_var: "MINIMAX_API_KEY",
|
||||
default_model: "MiniMax-M2.7",
|
||||
needs_key: true,
|
||||
},
|
||||
ProviderInfo {
|
||||
name: "perplexity",
|
||||
env_var: "PERPLEXITY_API_KEY",
|
||||
@@ -689,3 +695,20 @@ fn draw_done(f: &mut Frame, area: Rect, state: &WizardState) {
|
||||
f.render_widget(cont, chunks[1]);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::PROVIDERS;
|
||||
|
||||
#[test]
|
||||
fn wizard_lists_minimax_provider() {
|
||||
let minimax = PROVIDERS.iter().find(|provider| provider.name == "minimax");
|
||||
assert!(
|
||||
minimax.is_some(),
|
||||
"MiniMax should be selectable in wizard provider list"
|
||||
);
|
||||
let minimax = minimax.unwrap();
|
||||
assert_eq!(minimax.env_var, "MINIMAX_API_KEY");
|
||||
assert_eq!(minimax.default_model, "MiniMax-M2.7");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user