diff options
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts')
-rw-r--r-- | src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts b/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts index 2e663fed1..b97576095 100644 --- a/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts +++ b/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts @@ -1,6 +1,7 @@ +import { Observation } from '../types/types'; import { BaseTool } from './BaseTool'; -export class DataAnalysisTool extends BaseTool<{ csv_file_name: string | string[] }> { +export class DataAnalysisTool extends BaseTool<{ csv_file_name: { type: string | string[]; description: string; required: boolean } }> { private csv_files_function: () => { filename: string; id: string; text: string }[]; constructor(csv_files: () => { filename: string; id: string; text: string }[]) { @@ -11,12 +12,11 @@ export class DataAnalysisTool extends BaseTool<{ csv_file_name: string | string[ csv_file_name: { type: 'string', description: 'Name(s) of the CSV file(s) to analyze', - required: 'true', - max_inputs: '3', + required: true, }, }, 'Provide the name(s) of up to 3 CSV files to analyze based on the user query and whichever available CSV files may be relevant.', - 'Provides the full CSV file text for your analysis based on the user query and the available CSV file(s). ' + 'Provides the full CSV file text for your analysis based on the user query and the available CSV file(s).' ); this.csv_files_function = csv_files; } @@ -33,9 +33,9 @@ export class DataAnalysisTool extends BaseTool<{ csv_file_name: string | string[ return file?.id; } - async execute(args: { csv_file_name: string | string[] }): Promise<unknown> { + async execute(args: { csv_file_name: string | string[] }): Promise<Observation[]> { const filenames = Array.isArray(args.csv_file_name) ? args.csv_file_name : [args.csv_file_name]; - const results = []; + const results: Observation[] = []; for (const filename of filenames) { const fileContent = this.getFileContent(filename); |