andy-stack_vaultkeeper-ai/AIClasses/FunctionDefinitions/Functions/ReadVaultFile.ts
Andrew Beal 9f8d0b5ee8 feat: rename ReadFile to ReadVaultFile and add WriteVaultFile function
- Rename ReadFile to ReadVaultFile for consistency
- Add WriteVaultFile function for destructive operations
- Fix array concatenation bug in getQueryActions
- Return all vault files when search yields no results
- Update SearchVaultFiles description to clarify fallback behavior
- Improve error handling in writeFile to return error details
- Reorder system prompt sections for better clarity
2025-10-14 22:42:52 +01:00

25 lines
No EOL
1.1 KiB
TypeScript

import { AIFunction } from "Enums/AIFunction";
import type { IAIFunctionDefinition } from "../IAIFunctionDefinition";
export const ReadVaultFile: IAIFunctionDefinition = {
name: AIFunction.ReadVaultFile,
description: `Reads and returns the complete content of a specific file from the vault.
Call this when you need to access existing note content to answer questions,
provide summaries, verify information, or gather context before making updates.
Use proactively before updating files to understand current content and avoid
data loss. Essential for any operation that references or builds upon existing notes.`,
parameters: {
type: "object",
properties: {
file_path: {
type: "string",
description: "The full path to the file within the vault (e.g., 'folder/note.md')"
},
user_message: {
type: "string",
description: "A short message to be displayed to the user explaining why you're reading this file (e.g., 'Reading your daily note to check tasks')"
}
},
required: ["file_path", "user_message"]
}
}