refactor tui to use model metadata for descriptions

- getTranscriptionModelOptions now uses provider.ModelsOfType() instead of hardcoded switch
- getLLMModelOptions now uses provider.ModelsOfType() instead of hardcoded switch
- added currentLang param to show language compatibility warnings on models
- buildModelLabel adds [size] for local models, [streaming] for streaming
- mapConfigProviderToRegistry maps config names to registry names
This commit is contained in:
leonardotrapani
2026-02-01 01:26:02 +01:00
parent c05a3c8c2a
commit 575b55b524
4 changed files with 101 additions and 42 deletions
+12 -1
View File
@@ -263,4 +263,15 @@ Started: Sun Feb 1 12:22:47 AM CET 2026
- Cloud models: prints 'nothing to remove'
- Not installed: returns error 'model is not installed'
- Installed: calls `whisper.Remove()`, prints success message
- All verification scenarios tested, typecheck passes
- All verification scenarios tested, typecheck passes
### Task 27: Refactor TUI to use Model metadata for descriptions
- Refactored `getTranscriptionModelOptions()` to use `provider.ModelsOfType()` instead of hardcoded switch
- Added `currentLang` parameter to show language compatibility warnings
- Created `buildModelLabel()` helper: formats "Name (Description)", adds [size] for local, [streaming] for streaming models
- Created `mapConfigProviderToRegistry()` to map config provider names (groq-transcription, mistral-transcription) to registry names
- Refactored `getLLMModelOptions()` to use `provider.ModelsOfType()` instead of hardcoded switch
- Created `buildLLMModelLabel()` helper for LLM model formatting
- Added `getLangName()` helper to get human-readable language name from code
- Added language import to configure_transcription.go
- All tests passing, typecheck passes