diff options
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts b/src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts index 6f61b77d4..a4871f7fd 100644 --- a/src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts +++ b/src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts @@ -1,7 +1,7 @@ import { v4 as uuidv4 } from 'uuid'; import { BaseTool } from './BaseTool'; import { Observation } from '../types/types'; -import { ParametersType, Parameter } from '../types/tool_types'; +import { ParametersType, Parameter, ToolInfo } from '../types/tool_types'; import { DocumentOptions, Docs } from '../../../../documents/Documents'; /** @@ -77,13 +77,9 @@ ${supportedDocumentTypes type CreateAnyDocumentToolParamsType = typeof createAnyDocumentToolParams; -export class CreateAnyDocumentTool extends BaseTool<CreateAnyDocumentToolParamsType> { - private _addLinkedDoc: (doc_type: string, data: string | undefined, options: DocumentOptions, id: string) => void; - - constructor(addLinkedDoc: (doc_type: string, data: string | undefined, options: DocumentOptions, id: string) => void) { - super( - 'createAnyDocument', - `Creates any type of document with the provided options and data. Supported document types are: ${supportedDocumentTypes.join(', ')}. dataviz is a csv table tool, so for CSVs, use dataviz. Here are the options for each type: +const createAnyDocToolInfo: ToolInfo<CreateAnyDocumentToolParamsType> = { + name: 'createAnyDocument', + description: `Creates any type of document (in Dash) with the provided options and data. Supported document types are: ${supportedDocumentTypes.join(', ')}. dataviz is a csv table tool, so for CSVs, use dataviz. Here are the options for each type: <supported_document_types> ${supportedDocumentTypes .map( @@ -98,10 +94,15 @@ export class CreateAnyDocumentTool extends BaseTool<CreateAnyDocumentToolParamsT ) .join('\n')} </supported_document_types>`, - createAnyDocumentToolParams, - 'Provide the document type, data, and options for the document. Options should be a valid JSON string containing the document options specific to the document type.', - `Creates any type of document with the provided options and data. Supported document types are: ${supportedDocumentTypes.join(', ')}.` - ); + parameterRules: createAnyDocumentToolParams, + citationRules: 'No citation needed.', +}; + +export class CreateAnyDocumentTool extends BaseTool<CreateAnyDocumentToolParamsType> { + private _addLinkedDoc: (doc_type: string, data: string | undefined, options: DocumentOptions, id: string) => void; + + constructor(addLinkedDoc: (doc_type: string, data: string | undefined, options: DocumentOptions, id: string) => void) { + super(createAnyDocToolInfo); this._addLinkedDoc = addLinkedDoc; } |
