aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/NoTool.ts
blob: a92e3fa236f2ce3af6a5bca9dddd6c8a6a1db719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { BaseTool } from './BaseTool';
import { Observation } from '../types/types';
import { ParametersType } from './ToolTypes';

const noToolParams = [] as const;

type NoToolParamsType = typeof noToolParams;

export class NoTool extends BaseTool<NoToolParamsType> {
    constructor() {
        super('noTool', 'A placeholder tool that performs no action', noToolParams, 'This tool does not require any input or perform any action.', 'Does nothing.');
    }

    async execute(args: ParametersType<NoToolParamsType>): Promise<Observation[]> {
        // Since there are no parameters, args will be an empty object
        return [{ type: 'text', text: 'This tool does nothing.' }];
    }
}