fix: update index when tool selection strategy changes (#2991)

This commit is contained in:
Wendy Tang
2025-06-23 11:45:54 -07:00
committed by GitHub
parent ce7eabf20d
commit cebdbdb3d2
5 changed files with 213 additions and 24 deletions
+15 -2
View File
@@ -44,13 +44,26 @@ pub fn vector_search_tool() -> Tool {
}
pub fn vector_search_tool_prompt() -> String {
r#"# Tool Selection Instructions
format!(
r#"# Tool Selection Instructions
Important: the user has opted to dynamically enable tools, so although an extension could be enabled, \
please invoke the vector search tool to actually retrieve the most relevant tools to use according to the user's messages.
For example, if the user has 3 extensions enabled, but they are asking for a tool to read a pdf file, \
you would invoke the vector_search tool to find the most relevant read pdf tool.
By dynamically enabling tools, you (Goose) as the agent save context window space and allow the user to dynamically retrieve the most relevant tools.
Be sure to format the query to search rather than pass in the user's messages directly."#.to_string()
Be sure to format the query to search rather than pass in the user's messages directly.
In addition to the extension names available to you, you also have platform extension tools available to you.
The platform extension contains the following tools:
- {}
- {}
- {}
- {}
"#,
PLATFORM_SEARCH_AVAILABLE_EXTENSIONS_TOOL_NAME,
PLATFORM_MANAGE_EXTENSIONS_TOOL_NAME,
PLATFORM_READ_RESOURCE_TOOL_NAME,
PLATFORM_LIST_RESOURCES_TOOL_NAME
)
}
pub fn llm_search_tool() -> Tool {