update settings, add search files method

This commit is contained in:
duanfuxiang
2025-03-17 11:05:41 +08:00
parent da488f1c39
commit 9488146162
4 changed files with 54 additions and 21 deletions

View File

@@ -158,7 +158,15 @@ export class PromptGenerator {
},
]
console.log('this.settings.mode', this.settings.mode)
const systemMessage = await this.getSystemMessageNew(this.settings.mode)
let filesSearchMethod = this.settings.filesSearchMethod
if (filesSearchMethod === 'auto' && this.settings.embeddingModelId && this.settings.embeddingModelId !== '') {
filesSearchMethod = 'semantic'
} else {
filesSearchMethod = 'regex'
}
console.log('filesSearchMethod: ', filesSearchMethod)
const systemMessage = await this.getSystemMessageNew(this.settings.mode, filesSearchMethod)
const requestMessages: RequestMessage[] = [
systemMessage,
@@ -446,8 +454,8 @@ export class PromptGenerator {
}
}
private async getSystemMessageNew(mode: Mode): Promise<RequestMessage> {
const systemPrompt = await SYSTEM_PROMPT(this.app.vault.getRoot().path, false, mode)
private async getSystemMessageNew(mode: Mode, filesSearchMethod: string): Promise<RequestMessage> {
const systemPrompt = await SYSTEM_PROMPT(this.app.vault.getRoot().path, false, mode, filesSearchMethod)
return {
role: 'system',