assistant2: Add tool selector (#26480)

This PR adds a tool selector to Assistant 2 to facilitate customizing
the tools that the model sees:

<img width="1297" alt="Screenshot 2025-03-11 at 4 25 31 PM"
src="https://github.com/user-attachments/assets/7a656343-83bc-4546-9430-6a5f7ff1fd08"
/>

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-11 16:50:18 -04:00 committed by GitHub
parent 0cf6259fec
commit 4e6c37d23b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 166 additions and 33 deletions

View file

@ -355,16 +355,13 @@ impl Thread {
input_schema: ScriptingTool::input_schema(),
});
tools.extend(
self.tools()
.tools(cx)
.into_iter()
.map(|tool| LanguageModelRequestTool {
name: tool.name(),
description: tool.description(),
input_schema: tool.input_schema(),
}),
);
tools.extend(self.tools().enabled_tools(cx).into_iter().map(|tool| {
LanguageModelRequestTool {
name: tool.name(),
description: tool.description(),
input_schema: tool.input_schema(),
}
}));
request.tools = tools;
}