Elffuss BraidHub

kikocis/continue public

4940c71be2bf · 1.2 KiBRawPermalink
1import { Tool } from "../..";
2import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
3import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
4
5export const fetchUrlContentTool: Tool = {
6 type: "function",
7 displayTitle: "Read URL",
8 wouldLikeTo: "fetch {{{ url }}}",
9 isCurrently: "fetching {{{ url }}}",
10 hasAlready: "viewed {{{ url }}}",
11 readonly: true,
12 isInstant: true,
13 group: BUILT_IN_GROUP_NAME,
14 function: {
15 name: BuiltInToolNames.FetchUrlContent,
16 description:
17 "Can be used to view the contents of a website using a URL. Do NOT use this for files.",
18 parameters: {
19 type: "object",
20 required: ["url"],
21 properties: {
22 url: {
23 type: "string",
24 description: "The URL to read",
25 },
26 },
27 },
28 },
29 defaultToolPolicy: "allowedWithPermission",
30 systemMessageDescription: createSystemMessageExampleCall(
31 BuiltInToolNames.FetchUrlContent,
32 `To fetch the content of a URL, use the ${BuiltInToolNames.FetchUrlContent} tool. For example, to read the contents of a webpage, you might respond with:`,
33 [["url", "https://example.com"]],
34 ),
35};