aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2024-12-18 11:46:14 -0500
committerA.J. Shulman <Shulman.aj@gmail.com>2024-12-18 11:46:14 -0500
commitad1e0cf62187e0f8bbb19b4720b7681585361de9 (patch)
tree673dd63ddc1808e6e89dab5021c2136cbbe843c8 /src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts
parent9e447814b551c352709296ae562f1f50480320f5 (diff)
better
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts')
-rw-r--r--src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts25
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;
}