continue-custom/core/tools/definitions/createNewFile.ts
2025-03-18 13:28:12 -07:00

29 lines
819 B
TypeScript

import { Tool } from "../..";
import { BuiltInToolNames } from "../builtIn";
export const createNewFileTool: Tool = {
type: "function",
displayTitle: "Create New File",
wouldLikeTo: "create a new file",
readonly: false,
function: {
name: BuiltInToolNames.CreateNewFile,
description:
"Create a new file. Only use this when a file doesn't exist and should be created",
parameters: {
type: "object",
required: ["filepath", "contents"],
properties: {
filepath: {
type: "string",
description:
"The path where the new file should be created, relative to the root of the workspace",
},
contents: {
type: "string",
description: "The contents to write to the new file",
},
},
},
},
};