feat: add Mistral AI as first-class alternative provider

This commit is contained in:
2026-03-01 14:41:42 +01:00
parent 886083ebc9
commit c911ec2354
22 changed files with 1425 additions and 167 deletions

View File

@@ -422,6 +422,7 @@ export interface ChatModel {
id: string;
name: string;
provider?: string;
vision?: boolean;
}
export interface ModelCatalogEntry {
@@ -450,6 +451,7 @@ export interface ChatReadyStatus {
ready: boolean;
error?: string;
backend?: string;
providers?: { opencode: boolean; mistral: boolean };
}
export interface ChatApiKeyStatus {
@@ -825,12 +827,23 @@ export interface ElectronAPI {
setApiKey: (apiKey: string) => Promise<{ success: boolean; error?: string }>;
getApiKey: () => Promise<ChatApiKeyStatus>;
// Mistral API Key
validateMistralApiKey: (apiKey: string) => Promise<{ isValid: boolean; models: ChatModel[] }>;
setMistralApiKey: (apiKey: string) => Promise<{ success: boolean; error?: string }>;
getMistralApiKey: () => Promise<ChatApiKeyStatus>;
// Settings
getAvailableModels: () => Promise<{ success: boolean; models?: ChatModel[]; selectedModel?: string; error?: string }>;
setDefaultModel: (modelId: string) => Promise<{ success: boolean; error?: string }>;
getSystemPrompt: () => Promise<{ success: boolean; prompt?: string; error?: string }>;
setSystemPrompt: (prompt: string) => Promise<{ success: boolean; error?: string }>;
// Per-purpose model preferences
getTitleModel: () => Promise<{ success: boolean; modelId?: string | null; error?: string }>;
setTitleModel: (modelId: string | null) => Promise<{ success: boolean; error?: string }>;
getImageAnalysisModel: () => Promise<{ success: boolean; modelId?: string | null; error?: string }>;
setImageAnalysisModel: (modelId: string | null) => Promise<{ success: boolean; error?: string }>;
// Model Catalog
refreshModelCatalog: () => Promise<ModelCatalogRefreshResult>;
getModelCatalog: () => Promise<{ success: boolean; entries: ModelCatalogEntry[]; error?: string }>;