Elffuss BraidHub

kikocis/continue public

4940c71be2bf · 1.3 KiBRawPermalink
1import { Tool } from "../..";
2import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
3import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
4
5export const readFileTool: Tool = {
6 type: "function",
7 displayTitle: "Read File",
8 wouldLikeTo: "read {{{ filepath }}}",
9 isCurrently: "reading {{{ filepath }}}",
10 hasAlready: "viewed {{{ filepath }}}",
11 readonly: true,
12 isInstant: true,
13 group: BUILT_IN_GROUP_NAME,
14 function: {
15 name: BuiltInToolNames.ReadFile,
16 description:
17 "Use this tool if you need to view the contents of an existing file.",
18 parameters: {
19 type: "object",
20 required: ["filepath"],
21 properties: {
22 filepath: {
23 type: "string",
24 description:
25 "The path of the file to read, relative to the root of the workspace (NOT uri or absolute path)",
26 },
27 },
28 },
29 },
30 defaultToolPolicy: "allowedWithoutPermission",
31 systemMessageDescription: createSystemMessageExampleCall(
32 BuiltInToolNames.ReadFile,
33 `To read a file with a known filepath, use the ${BuiltInToolNames.ReadFile} tool. For example, to read a file located at 'path/to/file.txt', you would respond with this:`,
34 [["filepath", "path/to/the_file.txt"]],
35 ),
36};