feat: add dynamic model fetching from Anthropic API #2
+12
-3
@@ -25,14 +25,23 @@ export class FreewritingCleanupSettingTab extends PluginSettingTab {
|
|||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
async display(): Promise<void> {
|
display(): void {
|
||||||
const { containerEl } = this;
|
const { containerEl } = this;
|
||||||
containerEl.empty();
|
containerEl.empty();
|
||||||
|
|
||||||
containerEl.createEl('h2', { text: 'Freewriting Cleanup Settings' });
|
containerEl.createEl('h2', { text: 'Freewriting Cleanup Settings' });
|
||||||
|
|
||||||
// Load models asynchronously
|
// Load models asynchronously in the background
|
||||||
await this.loadModels();
|
this.loadModels()
|
||||||
|
.then(() => {
|
||||||
|
// Update dropdown UI when models are loaded
|
||||||
|
if (this.modelDropdown) {
|
||||||
|
this.populateModelDropdown(this.modelDropdown);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error loading models in background:', error);
|
||||||
|
});
|
||||||
|
|
||||||
// MARK: - API Configuration
|
// MARK: - API Configuration
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user