# 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.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
import { Tool } from "../..";
|
|
|
|
import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
|
|
import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
|
|
|
|
export const searchWebTool: Tool = {
|
|
type: "function",
|
|
displayTitle: "Search Web",
|
|
wouldLikeTo: 'search the web for "{{{ query }}}"',
|
|
isCurrently: 'searching the web for "{{{ query }}}"',
|
|
hasAlready: 'searched the web for "{{{ query }}}"',
|
|
readonly: true,
|
|
group: BUILT_IN_GROUP_NAME,
|
|
function: {
|
|
name: BuiltInToolNames.SearchWeb,
|
|
description:
|
|
"Performs a web search, returning top results. Use this tool sparingly - only for questions that require specialized, external, and/or up-to-date knowledege. Common programming questions do not require web search.",
|
|
parameters: {
|
|
type: "object",
|
|
required: ["query"],
|
|
properties: {
|
|
query: {
|
|
type: "string",
|
|
description: "The natural language search query",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
defaultToolPolicy: "allowedWithoutPermission",
|
|
systemMessageDescription: createSystemMessageExampleCall(
|
|
BuiltInToolNames.SearchWeb,
|
|
`To search the web, use the ${BuiltInToolNames.SearchWeb} tool with a natural language query. For example, to search for the current weather, you would respond with:`,
|
|
[["query", "What is the current weather in San Francisco?"]],
|
|
),
|
|
};
|