| 1 | import { Tool } from "../.."; |
| 2 | |
| 3 | import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; |
| 4 | |
| 5 | export const searchWebTool: Tool = { |
| 6 | type: "function", |
| 7 | displayTitle: "Search Web", |
| 8 | wouldLikeTo: 'search the web for "{{{ query }}}"', |
| 9 | isCurrently: 'searching the web for "{{{ query }}}"', |
| 10 | hasAlready: 'searched the web for "{{{ query }}}"', |
| 11 | readonly: true, |
| 12 | group: BUILT_IN_GROUP_NAME, |
| 13 | function: { |
| 14 | name: BuiltInToolNames.SearchWeb, |
| 15 | description: |
| 16 | "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.", |
| 17 | parameters: { |
| 18 | type: "object", |
| 19 | required: ["query"], |
| 20 | properties: { |
| 21 | query: { |
| 22 | type: "string", |
| 23 | description: "The natural language search query", |
| 24 | }, |
| 25 | }, |
| 26 | }, |
| 27 | }, |
| 28 | defaultToolPolicy: "allowedWithoutPermission", |
| 29 | systemMessageDescription: { |
| 30 | prefix: `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:`, |
| 31 | exampleArgs: [["query", "What is the current weather in San Francisco?"]], |
| 32 | }, |
| 33 | toolCallIcon: "GlobeAltIcon", |
| 34 | }; |