diff options
author | A.J. Shulman <Shulman.aj@gmail.com> | 2024-08-07 13:08:41 -0400 |
---|---|---|
committer | A.J. Shulman <Shulman.aj@gmail.com> | 2024-08-07 13:08:41 -0400 |
commit | b7c024c8c5b85f91828d6cd20ffc3bfca229af21 (patch) | |
tree | 74536498c0301dbbc53b67f2eaac5fd40a7fa3d9 /src/client/views/nodes/ChatBox/tools/BaseTool.ts | |
parent | a4107cdf6d53654275a678a79eff9962bcd02beb (diff) |
trying to get rules to delete after using rool
Diffstat (limited to 'src/client/views/nodes/ChatBox/tools/BaseTool.ts')
-rw-r--r-- | src/client/views/nodes/ChatBox/tools/BaseTool.ts | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/views/nodes/ChatBox/tools/BaseTool.ts b/src/client/views/nodes/ChatBox/tools/BaseTool.ts index 903161bd5..c7942e359 100644 --- a/src/client/views/nodes/ChatBox/tools/BaseTool.ts +++ b/src/client/views/nodes/ChatBox/tools/BaseTool.ts @@ -11,13 +11,20 @@ export abstract class BaseTool<T extends Record<string, any> = Record<string, an abstract execute(args: T): Promise<any>; - getActionRule(): Record<string, any> { + getActionRule(isCurrentTool: boolean): Record<string, any> { + if (isCurrentTool) { + return { + [this.name]: { + name: this.name, + useRules: this.useRules, + description: this.description, + parameters: this.parameters, + }, + }; + } return { [this.name]: { - name: this.name, - useRules: this.useRules, - description: this.description, - parameters: this.parameters, + description: 'This tool is not currently selected.', }, }; } |