Simplifies prompt generation model usage

Updates prompt generation to use the model type directly, removing the need for casting.

This change streamlines the prompt generation process and enhances type safety.
This commit is contained in:
AlexKucera committed 2025-09-20 10:53:36 +02:00
1 parent eaab2012db
commit 2fbe582c4d
1 file changed
+3 -3
+3 -3
View File
@@ -24,7 +24,7 @@ export class PromptGeneratorService {
async generateStaggeredPrompts(settings: FreewritingPromptsSettings): Promise<string[]> {
return this.generatePrompts(
settings.staggeredCount,
settings.model as AnthropicModel,
settings.model,
settings.systemPrompt,
settings.staggeredExamplePrompt,
'staggered'
@@ -34,7 +34,7 @@ export class PromptGeneratorService {
async generateNotePrompts(settings: FreewritingPromptsSettings): Promise<string[]> {
return this.generatePrompts(
settings.noteCount,
settings.model as AnthropicModel,
settings.model,
settings.systemPrompt,
settings.freewritingExamplePrompt,
'note'
@@ -73,7 +73,7 @@ export class PromptGeneratorService {
try {
new Notice('Generating prompts...');
const prompts = await this.client.generatePrompts(count, model, systemPrompt, examplePrompt);
const prompts = await this.client.generatePrompts(count, model, systemPrompt, examplePrompt, type);
const generatedPrompts: GeneratedPrompt[] = prompts.map(text => ({
text,