feat: update custom mode draft
This commit is contained in:
@@ -3,12 +3,11 @@ import { App, MarkdownView, TAbstractFile, TFile, TFolder, Vault, getLanguage, h
|
||||
import { editorStateToPlainText } from '../components/chat-view/chat-input/utils/editor-state-to-plain-text'
|
||||
import { QueryProgressState } from '../components/chat-view/QueryProgress'
|
||||
import { DiffStrategy } from '../core/diff/DiffStrategy'
|
||||
import { SYSTEM_PROMPT } from '../core/prompts/system'
|
||||
import { SystemPrompt } from '../core/prompts/system'
|
||||
import { RAGEngine } from '../core/rag/rag-engine'
|
||||
import { SelectVector } from '../database/schema'
|
||||
import { ChatMessage, ChatUserMessage } from '../types/chat'
|
||||
import { ContentPart, RequestMessage } from '../types/llm/request'
|
||||
import { SystemPromptsManager } from '../core/prompts/system-prompts-manager'
|
||||
import {
|
||||
MentionableBlock,
|
||||
MentionableFile,
|
||||
@@ -116,7 +115,7 @@ export class PromptGenerator {
|
||||
private app: App
|
||||
private settings: InfioSettings
|
||||
private diffStrategy: DiffStrategy
|
||||
private systemPromptsManager: SystemPromptsManager
|
||||
private systemPrompt: SystemPrompt
|
||||
private static readonly EMPTY_ASSISTANT_MESSAGE: RequestMessage = {
|
||||
role: 'assistant',
|
||||
content: '',
|
||||
@@ -132,7 +131,7 @@ export class PromptGenerator {
|
||||
this.app = app
|
||||
this.settings = settings
|
||||
this.diffStrategy = diffStrategy
|
||||
this.systemPromptsManager = new SystemPromptsManager(this.app)
|
||||
this.systemPrompt = new SystemPrompt(this.app)
|
||||
}
|
||||
|
||||
public async generateRequestMessages({
|
||||
@@ -468,7 +467,7 @@ export class PromptGenerator {
|
||||
}
|
||||
|
||||
private async getSystemMessageNew(mode: Mode, filesSearchMethod: string, preferredLanguage: string): Promise<RequestMessage> {
|
||||
const systemPrompt = await this.systemPromptsManager.getSystemPrompt(
|
||||
const prompt = await this.systemPrompt.getSystemPrompt(
|
||||
this.app.vault.getRoot().path,
|
||||
false,
|
||||
mode,
|
||||
@@ -479,7 +478,7 @@ export class PromptGenerator {
|
||||
|
||||
return {
|
||||
role: 'system',
|
||||
content: systemPrompt,
|
||||
content: prompt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user