aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ChatBox/tools.ts
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2024-09-07 12:43:05 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2024-09-07 12:43:05 -0400
commit4791cd23af08da70895204a3a7fbaf889d9af2d5 (patch)
treec4c2534e64724d62bae9152763f1a74cd5a963e0 /src/client/views/nodes/ChatBox/tools.ts
parent210f8f5f1cd19e9416a12524cce119b273334fd3 (diff)
completely restructured, added comments, and significantly reduced the length of the prompt (~72% shorter and cheaper)
Diffstat (limited to 'src/client/views/nodes/ChatBox/tools.ts')
-rw-r--r--src/client/views/nodes/ChatBox/tools.ts26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/client/views/nodes/ChatBox/tools.ts b/src/client/views/nodes/ChatBox/tools.ts
deleted file mode 100644
index 4035280a8..000000000
--- a/src/client/views/nodes/ChatBox/tools.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { DocCast } from '../../../../fields/Types';
-import { DocServer } from '../../../DocServer';
-import { Docs } from '../../../documents/Documents';
-import { DocUtils } from '../../../documents/DocUtils';
-import { TabDocView } from '../../collections/TabDocView';
-import { DocumentView } from '../DocumentView';
-import { OpenWhere } from '../OpenWhere';
-
-export function retrieval(json: any): string {
- return '';
-}
-
-export function create_collection(docView: DocumentView, document_ids: string[], title: string): string {
- const docs = document_ids.map(doc_id => DocCast(DocServer.GetCachedRefField(doc_id)));
- const collection = Docs.Create.FreeformDocument(docs, { title });
- docView._props.addDocTab(collection, OpenWhere.addRight); //in future, create popup prompting user where to add
- return 'Collection created in Dash called ' + title;
-}
-
-export function create_link(docView: DocumentView, document_ids: string[]): string {
- //Make document_ids a size 2 array
- const docs = document_ids.map(doc_id => DocCast(DocServer.GetCachedRefField(doc_id)));
- const linkDoc = DocUtils.MakeLink(docs[0], docs[1], {})!;
- DocumentView.linkCommonAncestor(linkDoc)?.ComponentView?.addDocument?.(linkDoc);
- return 'Link created between ' + docs[0].title + ' and ' + docs[1].title;
-}