mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
- Deleted highlight-default.min.css, katex.min.css, and markdown.css as they are no longer needed. - Implemented StreamingMarkdownService for improved markdown processing with support for math and syntax highlighting. - Added StreamingService for handling streaming requests to the Gemini API with error handling and chunk parsing. - Introduced styles_old.css for enhanced code block styling and better readability.
50 lines
No EOL
1.4 KiB
TypeScript
50 lines
No EOL
1.4 KiB
TypeScript
import type DmsAssistantPlugin from "main";
|
|
import type { Vault } from "obsidian";
|
|
import { Resolve } from "Services/DependencyService";
|
|
import { Services } from "Services/Services";
|
|
|
|
export interface IPrompt {
|
|
getDirectories(): string;
|
|
instructions(): string;
|
|
instructionsReminder(): string;
|
|
responseFormat(): string;
|
|
}
|
|
|
|
export class AIPrompt implements IPrompt {
|
|
|
|
private vault: Vault;
|
|
|
|
public constructor() {
|
|
this.vault = Resolve<DmsAssistantPlugin>(Services.DmsAssistantPlugin).app.vault;
|
|
}
|
|
|
|
public getDirectories(): string {
|
|
let directories: string[] = this.vault.getAllFolders(true).map(folder => folder.path);
|
|
return "Available user directories:" + "\n" + directories.join("\n");
|
|
}
|
|
|
|
public readonly instructionsArr: string[] = [
|
|
/*
|
|
"You are an AI assistant for the Obsidian note taking app.",
|
|
"The user has provided extra context to your responsibilities:",
|
|
"You are a DND expert and can provide detailed information about DND rules, character creation, and gameplay mechanics."
|
|
*/
|
|
];
|
|
public instructions(): string {
|
|
return this.instructionsArr.join("\n");
|
|
}
|
|
|
|
public readonly instructionsReminderArr: string[] = [
|
|
""
|
|
]
|
|
public instructionsReminder(): string {
|
|
return this.instructionsReminderArr.join("\n");
|
|
}
|
|
|
|
public readonly responseFormatArr: string[] = [
|
|
"",
|
|
]
|
|
public responseFormat(): string {
|
|
return this.responseFormatArr.join("\n");
|
|
}
|
|
} |