diff options
author | eleanor-park <eleanor_park@brown.edu> | 2024-10-30 19:39:46 -0400 |
---|---|---|
committer | eleanor-park <eleanor_park@brown.edu> | 2024-10-30 19:39:46 -0400 |
commit | c11c760db62f78a07b624b98b209e6ee86036c8e (patch) | |
tree | c9587b50042a5115373e91ba8ecf9b76913cd321 /src/client/views/nodes/chatbot/tools/CreateCollectionTool.ts | |
parent | b5944e87f9d4f3149161de4de0d76db486461c76 (diff) | |
parent | 4c768162e0436115a05b9c8b0e4d837d626d45ba (diff) |
Merge branch 'master' into eleanor-gptdraw
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/CreateCollectionTool.ts')
-rw-r--r-- | src/client/views/nodes/chatbot/tools/CreateCollectionTool.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/client/views/nodes/chatbot/tools/CreateCollectionTool.ts b/src/client/views/nodes/chatbot/tools/CreateCollectionTool.ts deleted file mode 100644 index 1e479a62c..000000000 --- a/src/client/views/nodes/chatbot/tools/CreateCollectionTool.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { DocCast } from '../../../../../fields/Types'; -import { DocServer } from '../../../../DocServer'; -import { Docs } from '../../../../documents/Documents'; -import { DocumentView } from '../../DocumentView'; -import { OpenWhere } from '../../OpenWhere'; -import { BaseTool } from './BaseTool'; - -export class GetDocsContentTool extends BaseTool<{ title: string; document_ids: string[] }> { - private _docView: DocumentView; - constructor(docView: DocumentView) { - super( - 'retrieveDocs', - 'Retrieves the contents of all Documents that the user is interacting with in Dash ', - { - title: { - type: 'string', - description: 'the title of the collection that you will be making', - required: 'true', - max_inputs: '1', - }, - }, - 'Provide a mathematical expression to calculate that would work with JavaScript eval().', - 'Runs a calculation and returns the number - uses JavaScript so be sure to use floating point syntax if necessary' - ); - this._docView = docView; - } - - async execute(args: { title: string; document_ids: string[] }): Promise<unknown> { - // Note: Using eval() can be dangerous. Consider using a safer alternative. - const docs = args.document_ids.map(doc_id => DocCast(DocServer.GetCachedRefField(doc_id))); - const collection = Docs.Create.FreeformDocument(docs, { title: args.title }); - this._docView._props.addDocTab(collection, OpenWhere.addRight); //in future, create popup prompting user where to add - return [{ type: 'text', text: 'Collection created in Dash called ' + args.title }]; - } -} -//export function create_collection(docView: DocumentView, document_ids: string[], title: string): string {} |