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:
2 files changed
+38
-6
No files matched your search
+1
-1
@@ -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);
|
||||
}
|
||||
}))
|
||||
|
||||
Reference in new issue
Block a user