From 9092494778abd55b6aa299fe06b4f70e7c7a767f Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Mon, 7 Jul 2025 14:39:06 -0400 Subject: changes (seeing if they work) --- .../chatbot/tools/dynamic/AlignDocumentsTool.ts | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/client/views/nodes/chatbot/tools/dynamic/AlignDocumentsTool.ts (limited to 'src/client/views/nodes/chatbot/tools/dynamic/AlignDocumentsTool.ts') diff --git a/src/client/views/nodes/chatbot/tools/dynamic/AlignDocumentsTool.ts b/src/client/views/nodes/chatbot/tools/dynamic/AlignDocumentsTool.ts new file mode 100644 index 000000000..53a1dd50d --- /dev/null +++ b/src/client/views/nodes/chatbot/tools/dynamic/AlignDocumentsTool.ts @@ -0,0 +1,42 @@ +import { Observation } from '../../types/types'; +import { ParametersType, ToolInfo } from '../../types/tool_types'; +import { BaseTool } from '../BaseTool'; + +const alignDocumentsParams = [ + { + name: 'alignmenttype', + type: 'string', + description: 'The type of alignment: "vertical" or "horizontal".', + required: true + }, + { + name: 'numberofdocuments', + type: 'number', + description: 'The number of documents to align.', + required: true + } + ] as const; + + type AlignDocumentsParamsType = typeof alignDocumentsParams; + + const alignDocumentsInfo: ToolInfo = { + name: 'aligndocumentstool', + description: 'Provides generic alignment guidelines for a specified number of documents to be aligned vertically or horizontally.', + citationRules: 'No citation needed.', + parameterRules: alignDocumentsParams + }; + + export class AlignDocumentsTool extends BaseTool { + constructor() { + super(alignDocumentsInfo); + } + + async execute(args: ParametersType): Promise { + const { alignmenttype, numberofdocuments } = args; + // Provide generic alignment guidelines + const guidelines = Array.from({ length: numberofdocuments }, (_, index) => ({ + position: alignmenttype === 'vertical' ? `Position ${index} vertically` : `Position ${index} horizontally` + })); + return [{ type: 'text', text: `Alignment guidelines: ${JSON.stringify(guidelines)}` }]; + } + } \ No newline at end of file -- cgit v1.2.3-70-g09d2