* Agent chat: a Mammouth AI preset for OpenAI-compatible endpoints (#5815) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Agent chat: the key test names the Mammouth AI URL too (#5815) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -257,6 +257,7 @@ pub const OPENAI_PRESETS: &[ApiPreset] = &[
|
||||
ApiPreset { name: "Ollama", base_url: "http://localhost:11434/v1" },
|
||||
ApiPreset { name: "LM Studio", base_url: "http://localhost:1234/v1" },
|
||||
ApiPreset { name: "OpenAI", base_url: "https://api.openai.com/v1" },
|
||||
ApiPreset { name: "Mammouth AI", base_url: "https://api.mammouth.ai/v1" },
|
||||
];
|
||||
|
||||
/// Anthropic-compatible endpoints people use. The base URL is the one their documentation calls
|
||||
@@ -305,6 +306,7 @@ mod tests {
|
||||
#[test]
|
||||
fn keys_go_only_over_https_or_to_this_computer() {
|
||||
assert!(key_safe_for("https://api.openai.com/v1"));
|
||||
assert!(key_safe_for("https://api.mammouth.ai/v1"));
|
||||
assert!(key_safe_for("http://localhost:11434/v1"));
|
||||
assert!(key_safe_for("http://127.0.0.1:1234/v1"));
|
||||
assert!(key_safe_for("http://[::1]:8080/v1"));
|
||||
@@ -346,6 +348,7 @@ mod tests {
|
||||
assert_eq!(Kind::Api.id(), "api");
|
||||
assert_eq!(Kind::Anthropic.id(), "anthropic");
|
||||
assert!(presets(Protocol::OpenAi).iter().all(|p| !p.name.is_empty() && p.base_url.starts_with("http")));
|
||||
assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == "Mammouth AI" && key_safe_for(p.base_url)));
|
||||
assert!(presets(Protocol::Anthropic).iter().any(|p| p.base_url == "https://api.anthropic.com/v1"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user