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)}` }]; } }