1.2 KiB
1.2 KiB
REMOVE_TOOL Keyword
Syntax
REMOVE_TOOL "tool-path.bas"
Parameters
"tool-path.bas"– Relative path to a.basfile that was previously added withADD_TOOL.
Description
REMOVE_TOOL disassociates a previously added tool from the current conversation session. After execution, the tool’s keywords are no longer available for invocation in the same dialog.
The keyword performs the following steps:
- Extracts the tool name from the provided path (removing the
.basextension and any leading.gbdialog/prefix). - Validates that the tool name is not empty.
- Spawns an asynchronous task that:
- Deletes the corresponding row from
session_tool_associationsfor the current session. - Returns a message indicating whether the tool was removed or was not active.
- Deletes the corresponding row from
Example
REMOVE_TOOL "enrollment.bas"
TALK "Enrollment tool removed from this conversation."
If the enrollment.bas tool was active, it will be removed; otherwise the keyword reports that the tool was not active.
Implementation Notes
- The operation runs in a separate thread with its own Tokio runtime to avoid blocking the main engine.
- Errors during database deletion are logged and propagated as runtime errors.