From ff934c67fc1fac71e7b3191cc213cfe29983fe2e Mon Sep 17 00:00:00 2001 From: alyssaf16 Date: Thu, 31 Oct 2024 00:05:27 -0400 Subject: nesting works --- .../nodes/chatbot/chatboxcomponents/ChatBox.tsx | 6 +++++ .../nodes/chatbot/tools/CreateDocumentTool.ts | 29 ++++++++++++++-------- 2 files changed, 24 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx index 4a39ee388..e2508d752 100644 --- a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx +++ b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx @@ -468,6 +468,11 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { return childDocs; }; + // @action + // createSingleFlashcard = (data: any, options: DocumentOptions) => { + + // } + @action whichDoc = async (doc_type: string, data: string, options: DocumentOptions, id: string): Promise => { let doc; @@ -476,6 +481,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { doc = DocCast(Docs.Create.TextDocument(data, options)); break; case 'flashcard': + // doc = this.createSingleFlashcard(data, options); doc = this.createFlashcard(data, options); break; case 'image': diff --git a/src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts b/src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts index 0b83ff24f..7d74c3b15 100644 --- a/src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts +++ b/src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts @@ -12,7 +12,22 @@ const example = [ { doc_type: 'flashcard', title: 'Photosynthesis', - data: { 'What is photosynthesis?': 'The process by which plants make food.' }, + data: [ + { + doc_type: 'text', + title: 'Front Photosynthesis', + data: 'What is photosynthesis?', + width: 300, + height: 300, + }, + { + doc_type: 'text', + title: 'back_photosynthesis', + data: 'The process by which plants make food.', + width: 300, + height: 300, + }, + ], backgroundColor: '#00ff00', width: 300, height: 300, @@ -28,14 +43,6 @@ const example = [ doc_type: 'collection', title: 'Advanced Biology', data: [ - { - doc_type: 'flashcard', - title: 'Respiration', - data: { 'What is respiration?': 'Conversion of oxygen and glucose to energy.' }, - backgroundColor: '#00ff00', - width: 300, - height: 300, - }, { doc_type: 'text', title: 'Cell Structure', @@ -110,9 +117,9 @@ const docInstructions = { // ], }, text: 'Provide text content as a plain string. Example: "This is a standalone text document."', - flashcard: 'A dictionary mapping the front to the back of the flashcard. Example: {"Question":"Answer"}', + flashcard: 'Two text documents with content for the front and back.', flashcardDeck: 'A collection of flashcards under a common theme.', - image: 'A URL to an image. Example: "https://example.com/image.jpg"', + image: 'A URL to an image for data. Example: "https://example.com/image.jpg"', web: 'A URL to a webpage. Example: "https://example.com"', equation: 'Create a equation document.', noteboard: 'Create a noteboard document', -- cgit v1.2.3-70-g09d2