mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-02 13:27:21 +00:00
Improved the tool selection by showing unavailable tools on request (#1116)
This commit is contained in:
1 parent
04546c25ac
commit
1a23479f33
9 files changed
+369
-62
No files matched your search
@@ -128,6 +128,8 @@ What the user switched off disappears; what the organization switched off stays
|
||||
|
||||
Switching a collection off only hides it. A chat, a chat template, a document analysis policy, the defaults of a component, or an assistant plugin which names it keeps naming it, and switching it on again brings it back there. A selection field therefore shows a selection through `ToolRegistry.LeaveOutSwitchedOffByUser` and stores a change through `ToolRegistry.KeepSwitchedOffByUser`, which puts the switched-off collections back. Where the rules of an assistant name a switched-off tool, `ManagedToolsWarning` says that the run goes without it. Switching off `semantic_search` has the data sources searched with every message, as when an organization does it.
|
||||
|
||||
A tool which merely cannot be selected right now is a different matter: the organization switched it off, its settings are missing, the provider lacks the confidence it needs, or the outbound data restriction of the chat keeps all of its tools back. The tool selection lists such a tool behind a button below the others, with the reason and its settings button: the user may fill in the settings, or the tool works again with another provider or in another chat. `ToolSelectionRules.IsSelectable` decides which list a tool belongs to; a selected tool which cannot be selected right now goes behind the button as well, and the button counts it. While a response is running, nothing can be switched at all, and the selection shows all tools in one list.
|
||||
|
||||
## Security
|
||||
|
||||
Treat model-provided tool arguments as untrusted input. Refuse a wrong one rather than guessing what it meant: a placeholder such as `0` is not a page, and reading it as "no page" does something the model did not ask for. The model reads the refusal and tries again, so the message has to name the argument and the value that arrived, say what would be valid, and, for an optional argument, that leaving it out is always possible. `ToolArgumentReader` reads strings, positive integers, and values out of a fixed choice, alone or as a list, and words the refusals so; `WebSearchTool` shows how a tool uses it.
|
||||
|
||||
Reference in new issue
Block a user