Enhances model service fallback and caching logic

Improves model retrieval strategy for scenarios with invalid/missing API keys

Adds immediate fallback model generation when API key is invalid
Ensures consistent model caching for both API and fallback scenarios
Sorts model options alphabetically for improved user experience

Introduces new getFallbackOptions() method for direct fallback access
Refactors model refresh and error handling to provide more robust model selection
This commit is contained in:
AlexKucera committed 2025-10-24 11:00:42 +02:00
1 parent c3d4888c98
commit fcc495aa8f
2 files changed
+38 -6

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ export class FreewritingCleanupSettingTab extends PluginSettingTab {
await this.refreshModels();
} else if (this.modelDropdown) {
// Show fallback immediately when key is cleared
this.availableModels = await this.plugin.modelService.getAvailableModels();
this.availableModels = this.plugin.modelService.getFallbackOptions();
this.populateModelDropdown(this.modelDropdown);
}
}))