# Conflicts: # core/index.d.ts # core/tools/definitions/codebaseTool.ts # core/tools/definitions/createNewFile.ts # core/tools/definitions/createRuleBlock.ts # core/tools/definitions/editFile.ts # core/tools/definitions/fetchUrlContent.ts # core/tools/definitions/globSearch.ts # core/tools/definitions/grepSearch.ts # core/tools/definitions/ls.ts # core/tools/definitions/readCurrentlyOpenFile.ts # core/tools/definitions/readFile.ts # core/tools/definitions/requestRule.ts # core/tools/definitions/runTerminalCommand.ts # core/tools/definitions/searchAndReplaceInFile.ts # core/tools/definitions/searchWeb.ts # core/tools/definitions/viewDiff.ts # core/tools/definitions/viewRepoMap.ts # core/tools/definitions/viewSubdirectory.ts
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { Tool } from "../..";
|
|
import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
|
|
import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
|
|
|
|
export const fetchUrlContentTool: Tool = {
|
|
type: "function",
|
|
displayTitle: "Read URL",
|
|
wouldLikeTo: "fetch {{{ url }}}",
|
|
isCurrently: "fetching {{{ url }}}",
|
|
hasAlready: "viewed {{{ url }}}",
|
|
readonly: true,
|
|
isInstant: true,
|
|
group: BUILT_IN_GROUP_NAME,
|
|
function: {
|
|
name: BuiltInToolNames.FetchUrlContent,
|
|
description:
|
|
"Can be used to view the contents of a website using a URL. Do NOT use this for files.",
|
|
parameters: {
|
|
type: "object",
|
|
required: ["url"],
|
|
properties: {
|
|
url: {
|
|
type: "string",
|
|
description: "The URL to read",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
defaultToolPolicy: "allowedWithPermission",
|
|
systemMessageDescription: createSystemMessageExampleCall(
|
|
BuiltInToolNames.FetchUrlContent,
|
|
`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:`,
|
|
[["url", "https://example.com"]],
|
|
),
|
|
};
|