Adds dynamic Claude model fetching and management #1
@@ -17,7 +17,9 @@ export default class FreewritingPromptsPlugin extends Plugin {
|
|||||||
noteCommand: NotePromptsCommand;
|
noteCommand: NotePromptsCommand;
|
||||||
|
|
||||||
async onload() {
|
async onload() {
|
||||||
await this.loadSettings();
|
// Load data once and use it for both settings and model cache
|
||||||
|
const data = await this.loadData() as FreewritingPromptsData | null;
|
||||||
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, data);
|
||||||
|
|
||||||
// Initialize services
|
// Initialize services
|
||||||
this.promptGenerator = new PromptGeneratorService(this.settings);
|
this.promptGenerator = new PromptGeneratorService(this.settings);
|
||||||
@@ -26,7 +28,6 @@ export default class FreewritingPromptsPlugin extends Plugin {
|
|||||||
this.noteCommand = new NotePromptsCommand(this.promptGenerator);
|
this.noteCommand = new NotePromptsCommand(this.promptGenerator);
|
||||||
|
|
||||||
// Load model cache
|
// Load model cache
|
||||||
const data = await this.loadData() as FreewritingPromptsData | null;
|
|
||||||
if (data?.modelCache) {
|
if (data?.modelCache) {
|
||||||
this.modelService.loadCache(data.modelCache);
|
this.modelService.loadCache(data.modelCache);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user