- replaced old TranscriptionModels/LLMModels/SupportsX methods with Models() []Model - added DefaultModel(t ModelType), IsLocal() to interface - added helpers: GetModel, ModelsOfType, FindModelByID, ModelsForLanguage, ValidateModelLanguage - all providers now return full Model metadata with SupportedLanguages, AdapterType, Endpoint - groq distil-whisper-large-v3-en marked as english-only - updated TUI to use new interface
61 lines
1.6 KiB
Go
61 lines
1.6 KiB
Go
package provider
|
|
|
|
import "github.com/leonardotrapani/hyprvoice/internal/language"
|
|
|
|
// MistralProvider implements Provider for Mistral services (transcription only)
|
|
type MistralProvider struct{}
|
|
|
|
func (p *MistralProvider) Name() string {
|
|
return "mistral"
|
|
}
|
|
|
|
func (p *MistralProvider) RequiresAPIKey() bool {
|
|
return true
|
|
}
|
|
|
|
func (p *MistralProvider) ValidateAPIKey(key string) bool {
|
|
// Mistral API keys don't have a consistent prefix, just check non-empty
|
|
return len(key) > 0
|
|
}
|
|
|
|
func (p *MistralProvider) IsLocal() bool {
|
|
return false
|
|
}
|
|
|
|
func (p *MistralProvider) Models() []Model {
|
|
allLangs := language.AllLanguageCodes()
|
|
|
|
return []Model{
|
|
{
|
|
ID: "voxtral-mini-latest",
|
|
Name: "Voxtral Mini Latest",
|
|
Description: "Latest Voxtral model, best for most uses",
|
|
Type: Transcription,
|
|
Streaming: false,
|
|
Local: false,
|
|
AdapterType: "openai",
|
|
SupportedLanguages: allLangs,
|
|
Endpoint: &EndpointConfig{BaseURL: "https://api.mistral.ai", Path: "/v1/audio/transcriptions"},
|
|
},
|
|
{
|
|
ID: "voxtral-mini-2507",
|
|
Name: "Voxtral Mini 2507",
|
|
Description: "Stable Voxtral version from July 2025",
|
|
Type: Transcription,
|
|
Streaming: false,
|
|
Local: false,
|
|
AdapterType: "openai",
|
|
SupportedLanguages: allLangs,
|
|
Endpoint: &EndpointConfig{BaseURL: "https://api.mistral.ai", Path: "/v1/audio/transcriptions"},
|
|
},
|
|
}
|
|
}
|
|
|
|
func (p *MistralProvider) DefaultModel(t ModelType) string {
|
|
switch t {
|
|
case Transcription:
|
|
return "voxtral-mini-latest"
|
|
}
|
|
return ""
|
|
}
|