From 117ce1744fcc20a61f8004e9b71bf9acb1579a46 Mon Sep 17 00:00:00 2001 From: Beingpax Date: Sat, 5 Apr 2025 21:56:52 +0545 Subject: [PATCH] Mistral support by Vaygr --- VoiceInk/Services/AIService.swift | 5 +++++ VoiceInk/Views/APIKeyManagementView.swift | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/VoiceInk/Services/AIService.swift b/VoiceInk/Services/AIService.swift index 716d280..f9e9524 100644 --- a/VoiceInk/Services/AIService.swift +++ b/VoiceInk/Services/AIService.swift @@ -6,6 +6,7 @@ enum AIProvider: String, CaseIterable { case deepSeek = "DeepSeek" case gemini = "Gemini" case anthropic = "Anthropic" + case mistral = "Mistral" case ollama = "Ollama" case custom = "Custom" @@ -21,6 +22,8 @@ enum AIProvider: String, CaseIterable { return "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent" case .anthropic: return "https://api.anthropic.com/v1/messages" + case .mistral: + return "https://api.mistral.ai/v1/chat/completions" case .ollama: return UserDefaults.standard.string(forKey: "ollamaBaseURL") ?? "http://localhost:11434" case .custom: @@ -40,6 +43,8 @@ enum AIProvider: String, CaseIterable { return "gemini-2.0-flash" case .anthropic: return "claude-3-5-sonnet-20241022" + case .mistral: + return "mistral-large-2411" case .ollama: return UserDefaults.standard.string(forKey: "ollamaSelectedModel") ?? "mistral" case .custom: diff --git a/VoiceInk/Views/APIKeyManagementView.swift b/VoiceInk/Views/APIKeyManagementView.swift index 7ccbc8f..9aab1c7 100644 --- a/VoiceInk/Views/APIKeyManagementView.swift +++ b/VoiceInk/Views/APIKeyManagementView.swift @@ -508,9 +508,10 @@ struct APIKeyManagementView: View { URL(string: "https://makersuite.google.com/app/apikey")! case .anthropic: URL(string: "https://console.anthropic.com/settings/keys")! + case .mistral: + URL(string: "https://console.mistral.ai/api-keys")! case .ollama, .custom: URL(string: "")! // This case should never be reached - } NSWorkspace.shared.open(url) } label: {