refactor provider interface to return models with metadata

- 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
This commit is contained in:
leonardotrapani
2026-02-01 00:33:20 +01:00
parent 51aba743f8
commit c23ac60b8f
10 changed files with 498 additions and 98 deletions
+14
View File
@@ -26,3 +26,17 @@ Started: Sun Feb 1 12:22:47 AM CET 2026
- Helper methods: NeedsDownload(), IsStreaming(), SupportsLanguage(code), SupportsAllLanguages()
- SupportsLanguage("") always returns true (auto always allowed)
- All tests passing, typecheck passes
### Task 4: Refactor Provider interface to return Models
- Updated `internal/provider/provider.go` Provider interface
- Replaced old methods with: Models() []Model, DefaultModel(t ModelType) string, IsLocal() bool
- Added package-level helpers:
- GetModel(providerName, modelID string) (*Model, error)
- ModelsOfType(p Provider, t ModelType) []Model
- FindModelByID(modelID string) (*Model, Provider, error)
- ModelsForLanguage(p Provider, t ModelType, langCode string) []Model
- ValidateModelLanguage(providerName, modelID, langCode string) error
- Updated all providers (openai, groq, mistral, elevenlabs) with full Model metadata
- Updated TUI files to use ModelsOfType instead of old SupportsTranscription/SupportsLLM
- Added comprehensive tests for all new helper functions
- All tests passing, typecheck passes