diff options
author | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-10-31 00:05:27 -0400 |
---|---|---|
committer | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-10-31 00:05:27 -0400 |
commit | ff934c67fc1fac71e7b3191cc213cfe29983fe2e (patch) | |
tree | 80968ffd93e64d45e76517f4ba5a0bd77b9da9f9 | |
parent | d1fc9d98172210090f5ed1aa8aaa8512f5afd0eb (diff) |
nesting works
-rw-r--r-- | src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx | 6 | ||||
-rw-r--r-- | src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts | 29 |
2 files changed, 24 insertions, 11 deletions
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<FieldViewProps>() { return childDocs; }; + // @action + // createSingleFlashcard = (data: any, options: DocumentOptions) => { + + // } + @action whichDoc = async (doc_type: string, data: string, options: DocumentOptions, id: string): Promise<Doc> => { let doc; @@ -476,6 +481,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { 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, @@ -29,14 +44,6 @@ const example = [ 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', data: 'Cells are the basic building blocks of all living organisms.', @@ -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', |