-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add web_search tool and wire into prompts, tools, and UI #10678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import type OpenAI from "openai" | ||
|
|
||
| const WEB_SEARCH_DESCRIPTION = `Search the public web for up-to-date information and return a concise list of results with titles, URLs, and snippets. Use this tool when you need real-time or external context that is not available in the local workspace. | ||
| Parameters: | ||
| - query: (required) The search query to run. | ||
| - max_results: (optional) Maximum number of results to return (default: 5, max: 10). | ||
| Example: Searching for release notes | ||
| { "query": "Cline 3.48.0 web search tool", "max_results": 5 }` | ||
|
|
||
| const QUERY_PARAMETER_DESCRIPTION = `Search query string` | ||
|
|
||
| const MAX_RESULTS_PARAMETER_DESCRIPTION = `Optional cap on number of results (1-10)` | ||
|
|
||
| export default { | ||
| type: "function", | ||
| function: { | ||
| name: "web_search", | ||
| description: WEB_SEARCH_DESCRIPTION, | ||
| strict: true, | ||
| parameters: { | ||
| type: "object", | ||
| properties: { | ||
| query: { | ||
| type: "string", | ||
| description: QUERY_PARAMETER_DESCRIPTION, | ||
| }, | ||
| max_results: { | ||
| type: ["integer", "null"], | ||
| description: MAX_RESULTS_PARAMETER_DESCRIPTION, | ||
| }, | ||
| }, | ||
| required: ["query", "max_results"], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Fix it with Roo Code or mention @roomote and request a fix. |
||
| additionalProperties: false, | ||
| }, | ||
| }, | ||
| } satisfies OpenAI.Chat.ChatCompletionTool | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| export function getWebSearchDescription(): string { | ||
| return `## web_search | ||
| Description: Search the public web for up-to-date information and return a concise list of results with titles, URLs, and snippets. Use this tool when you need real-time or external context that is not available in the local workspace. | ||
|
|
||
| Parameters: | ||
| - query: (required) The search query to run. | ||
| - max_results: (optional) Maximum number of results to return (default: 5, max: 10). | ||
|
|
||
| Usage: | ||
| <web_search> | ||
| <query>Your search query</query> | ||
| <max_results>5</max_results> | ||
| </web_search> | ||
|
|
||
| Example: | ||
| <web_search> | ||
| <query>OpenAI Responses API web search tool</query> | ||
| <max_results>3</max_results> | ||
| </web_search>` | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
web_searchis treated as a browser tool in filtering (browserToolEnabled) and grouped underbrowser, but it is categorized as a search tool in the CLI UI. This mismatch is confusing for users and makes browser enable/disable semantics harder to reason about. Consider categorizingwebSearch/web_searchunder the browser tool group in the CLI UI as well.Fix it with Roo Code or mention @roomote and request a fix.