-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[tool_suggest] Improve tool_suggest triggering conditions. #20091
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
50f4f6b
Move tool_suggest into a namespace
mzeng-openai 4755765
Disable parallel tool calls for tool_suggest
mzeng-openai 4b4b97a
Refine tool_suggest schema and logging
mzeng-openai 5aba4e4
Refine tool suggest gating and prompt wording
mzeng-openai 76e5601
Clarify tool suggestion prerequisites
mzeng-openai d518fea
Merge branch 'main' into dev/mzeng/move-toolsuggest-namespace
mzeng-openai 251f330
update
mzeng-openai e43d00b
update
mzeng-openai 95d2591
update
mzeng-openai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 18 additions & 15 deletions
33
codex-rs/core/templates/search_tool/tool_suggest_description.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,29 @@ | ||
| # Tool suggestion discovery | ||
|
|
||
| Suggests a missing connector in an installed plugin, or in narrower cases a not installed but discoverable plugin, when the user clearly wants a capability that is not currently available in the active `tools` list. | ||
| Use this tool only to ask the user to install one known plugin or connector from the list below. The list contains known candidates that are not currently installed. | ||
|
|
||
| Use this ONLY when: | ||
| - You've already tried to find a matching available tool for the user's request but couldn't find a good match. This includes `tool_search` (if available) and other means. | ||
| - For connectors/apps that are not installed but needed for an installed plugin, suggest to install them if the task requirements match precisely. | ||
| - For plugins that are not installed but discoverable, only suggest discoverable and installable plugins when the user's intent very explicitly and unambiguously matches that plugin itself. Do not suggest a plugin just because one of its connectors or capabilities seems relevant. | ||
| Use this ONLY when all of the following are true: | ||
| - The user explicitly wants a specific plugin or connector that is not already available in the current context or active `tools` list. | ||
| - `tool_search` is not available, or it has already been called and did not find or make the requested tool callable. | ||
| - The tool is one of the known installable plugins or connectors listed below. Only ask to install tools from this list. | ||
|
|
||
| Tool suggestions should only use the discoverable tools listed here. DO NOT explore or recommend tools that are not on this list. | ||
| Do not use tool suggestion for adjacent capabilities, broad recommendations, or tools that merely seem useful. The user's intent must clearly match one listed tool. | ||
|
|
||
| Discoverable tools: | ||
| Known plugins/connectors available to install: | ||
| {{discoverable_tools}} | ||
|
|
||
| Workflow: | ||
|
|
||
| 1. Ensure all possible means have been exhausted to find an existing available tool but none of them matches the request intent. | ||
| 2. Match the user's request against the discoverable tools list above. Apply the stricter explicit-and-unambiguous rule for *discoverable tools* like plugin install suggestions; *missing tools* like connector install suggestions continue to use the normal clear-fit standard. | ||
| 3. If one tool clearly fits, call `tool_suggest` with: | ||
| 1. Check the current context and active `tools` list first. If `tool_search` is available, call `tool_search` before calling `tool_suggest`. Do not use tool suggestion if the needed tool is already available, found through `tool_search`, or callable after discovery. | ||
| 2. Match the user's explicit request against the known plugin/connector list above. Only proceed when one listed plugin or connector exactly fits. | ||
| 3. If we found both connectors and plugins to suggest, use plugins first, only use connectors if the corresponding plugin is installed but the connector is not. | ||
| 4. If one tool clearly fits, call `tool_suggest` with: | ||
| - `tool_type`: `connector` or `plugin` | ||
| - `action_type`: `install` or `enable` | ||
| - `tool_id`: exact id from the discoverable tools list above | ||
| - `action_type`: `install` | ||
| - `tool_id`: exact id from the known plugin/connector list above | ||
| - `suggest_reason`: concise one-line user-facing reason this tool can help with the current request | ||
| 4. After the suggestion flow completes: | ||
| - if the user finished the install or enable flow, continue by searching again or using the newly available tool | ||
| - if the user did not finish, continue without that tool, and don't suggest that tool again unless the user explicitly asks you to. | ||
| 5. After the suggestion flow completes: | ||
| - if the user finished the install flow, continue by searching again or using the newly available tool | ||
| - if the user did not finish, continue without that tool, and don't suggest that tool again unless the user explicitly asks for it. | ||
|
|
||
| IMPORTANT: DO NOT call this tool in parallel with other tools. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.