2025-10-14 21:42:52 +00:00
|
|
|
import { AIFunction } from "Enums/AIFunction";
|
|
|
|
|
import type { IAIFunctionDefinition } from "../IAIFunctionDefinition";
|
|
|
|
|
|
|
|
|
|
export const WriteVaultFile: IAIFunctionDefinition = {
|
|
|
|
|
name: AIFunction.WriteVaultFile,
|
|
|
|
|
description: `Writes content to a file, creating it if it doesn't exist or replacing its contents if it does.
|
2025-12-30 19:07:00 +00:00
|
|
|
|
|
|
|
|
**When to use this tool:**
|
|
|
|
|
- Creating new notes, documents, or files from scratch
|
|
|
|
|
- Completely rewriting a file's contents (when most/all content needs to change)
|
|
|
|
|
- Generating new files from templates or structured data`,
|
2025-10-14 21:42:52 +00:00
|
|
|
parameters: {
|
|
|
|
|
type: "object",
|
|
|
|
|
properties: {
|
|
|
|
|
file_path: {
|
|
|
|
|
type: "string",
|
|
|
|
|
description: "The full path to the file within the vault (e.g., 'folder/note.md')"
|
|
|
|
|
},
|
|
|
|
|
content: {
|
|
|
|
|
type: "string",
|
|
|
|
|
description: "The complete content to write to the file. This will replace any existing content."
|
|
|
|
|
},
|
|
|
|
|
user_message: {
|
|
|
|
|
type: "string",
|
2025-12-05 18:39:01 +00:00
|
|
|
description: "A short message to be displayed to the user explaining what you're writing and why (e.g., 'Creating your daily note for today')"
|
2025-10-14 21:42:52 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
required: ["file_path", "content", "user_message"]
|
|
|
|
|
}
|
|
|
|
|
}
|