aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ChatBox/tools/BaseTool.ts
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2024-07-10 16:16:26 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2024-07-10 16:16:26 -0400
commitcab0311e2fd9a6379628c000d11ddcd805e01f64 (patch)
tree60cb3f397426cb3931c13ebe3b8a1e8eb98480dd /src/client/views/nodes/ChatBox/tools/BaseTool.ts
parentd0e09ff3526e4f6b9aad824fad1020d083a87631 (diff)
first attempt at integrating everything
Diffstat (limited to 'src/client/views/nodes/ChatBox/tools/BaseTool.ts')
-rw-r--r--src/client/views/nodes/ChatBox/tools/BaseTool.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/views/nodes/ChatBox/tools/BaseTool.ts b/src/client/views/nodes/ChatBox/tools/BaseTool.ts
new file mode 100644
index 000000000..3511d9528
--- /dev/null
+++ b/src/client/views/nodes/ChatBox/tools/BaseTool.ts
@@ -0,0 +1,24 @@
+import { Tool } from '../types';
+
+export abstract class BaseTool implements Tool {
+ constructor(
+ public name: string,
+ public description: string,
+ public parameters: Record<string, any>,
+ public useRules: string,
+ public briefSummary: string
+ ) {}
+
+ abstract execute(args: Record<string, any>): Promise<any>;
+
+ getActionRule(): Record<string, any> {
+ return {
+ [this.name]: {
+ name: this.name,
+ useRules: this.useRules,
+ description: this.description,
+ parameters: this.parameters,
+ },
+ };
+ }
+}