mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
- Add planning mode toggle and AskUserQuestion function for interactive planning - Fix Gemini cross-provider function call detection using toolId presence - Update OpenAI naming service to handle new response format - Improve system prompts by removing complexity gate, streamlining to action-first principle - Add InputDisplay component and question mode to ChatInput - Refactor execution plan error messages to show all incomplete steps - Update tests to reflect cross-provider function call format changes
37 lines
No EOL
1.4 KiB
TypeScript
37 lines
No EOL
1.4 KiB
TypeScript
import { Resolve } from "Services/DependencyService";
|
|
import { Services } from "Services/Services";
|
|
import { SystemInstruction } from "./SystemPrompt";
|
|
import type { FileSystemService } from "Services/FileSystemService";
|
|
import type { SettingsService } from "Services/SettingsService";
|
|
import { PlanningAgentSystemPrompt } from "AIPrompts/PlanningAgentSystemPrompt";
|
|
import { PlanningEnabledAppendix } from "./PlanningEnabledAppendix";
|
|
|
|
export interface IPrompt {
|
|
systemInstruction(planningMode?: boolean): string;
|
|
planningInstruction(): string;
|
|
userInstruction(): Promise<string>;
|
|
}
|
|
|
|
export class AIPrompt implements IPrompt {
|
|
|
|
private readonly settingsService: SettingsService;
|
|
private readonly fileSystemService: FileSystemService;
|
|
|
|
public constructor() {
|
|
this.settingsService = Resolve<SettingsService>(Services.SettingsService);
|
|
this.fileSystemService = Resolve<FileSystemService>(Services.FileSystemService);
|
|
}
|
|
|
|
public systemInstruction(planningMode: boolean = false): string {
|
|
return planningMode ? SystemInstruction + PlanningEnabledAppendix : SystemInstruction;
|
|
}
|
|
|
|
public planningInstruction(): string {
|
|
return PlanningAgentSystemPrompt;
|
|
}
|
|
|
|
public async userInstruction(): Promise<string> {
|
|
const result = await this.fileSystemService.readFile(this.settingsService.settings.userInstruction, true);
|
|
return result instanceof Error ? "" : result;
|
|
}
|
|
} |