only_ever_generator 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/bootstrap/app.d.ts +92 -0
  2. package/dist/bootstrap/app.d.ts.map +1 -0
  3. package/dist/bootstrap/app.js +120 -84
  4. package/dist/bootstrap/app.js.map +1 -0
  5. package/dist/card_gen/generate_cards.d.ts +7 -0
  6. package/dist/card_gen/generate_cards.d.ts.map +1 -0
  7. package/dist/card_gen/generate_cards.js +60 -0
  8. package/dist/card_gen/generate_cards.js.map +1 -0
  9. package/dist/config.d.ts +8 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/config.js +4 -1
  12. package/dist/config.js.map +1 -0
  13. package/dist/constants/api_constants.d.ts +3 -0
  14. package/dist/constants/api_constants.d.ts.map +1 -0
  15. package/dist/constants/api_constants.js +11 -0
  16. package/dist/constants/api_constants.js.map +1 -0
  17. package/dist/constants/prompt_data.d.ts +5 -0
  18. package/dist/constants/prompt_data.d.ts.map +1 -0
  19. package/dist/constants/prompt_data.js +303 -0
  20. package/dist/constants/prompt_data.js.map +1 -0
  21. package/dist/constants/prompts/card_gen_prompt.d.ts +2 -0
  22. package/dist/constants/prompts/card_gen_prompt.d.ts.map +1 -0
  23. package/dist/constants/prompts/card_gen_prompt.js +100 -203
  24. package/dist/constants/prompts/card_gen_prompt.js.map +1 -0
  25. package/dist/constants/prompts/typology_prompt.d.ts +2 -0
  26. package/dist/constants/prompts/typology_prompt.d.ts.map +1 -0
  27. package/dist/constants/prompts/typology_prompt.js +78 -34
  28. package/dist/constants/prompts/typology_prompt.js.map +1 -0
  29. package/dist/constants/source_data.d.ts +173 -0
  30. package/dist/constants/source_data.d.ts.map +1 -0
  31. package/dist/constants/source_data.js +962 -10
  32. package/dist/constants/source_data.js.map +1 -0
  33. package/dist/embedding_generation/consolidation/global_consolidation.d.ts +34 -0
  34. package/dist/embedding_generation/consolidation/global_consolidation.d.ts.map +1 -0
  35. package/dist/embedding_generation/consolidation/global_consolidation.js +77 -0
  36. package/dist/embedding_generation/consolidation/global_consolidation.js.map +1 -0
  37. package/dist/embedding_generation/consolidation/local_consolidation.d.ts +39 -0
  38. package/dist/embedding_generation/consolidation/local_consolidation.d.ts.map +1 -0
  39. package/dist/embedding_generation/consolidation/local_consolidation.js +105 -0
  40. package/dist/embedding_generation/consolidation/local_consolidation.js.map +1 -0
  41. package/dist/embedding_generation/consolidation/write_consolidated_data.d.ts +46 -0
  42. package/dist/embedding_generation/consolidation/write_consolidated_data.d.ts.map +1 -0
  43. package/dist/embedding_generation/consolidation/write_consolidated_data.js +69 -0
  44. package/dist/embedding_generation/consolidation/write_consolidated_data.js.map +1 -0
  45. package/dist/embedding_generation/generate_embeddings.d.ts +28 -0
  46. package/dist/embedding_generation/generate_embeddings.d.ts.map +1 -0
  47. package/dist/embedding_generation/generate_embeddings.js +54 -0
  48. package/dist/embedding_generation/generate_embeddings.js.map +1 -0
  49. package/dist/embedding_generation/parse_embedding_response.d.ts +26 -0
  50. package/dist/embedding_generation/parse_embedding_response.d.ts.map +1 -0
  51. package/dist/embedding_generation/parse_embedding_response.js +29 -0
  52. package/dist/embedding_generation/parse_embedding_response.js.map +1 -0
  53. package/dist/gap_fill/calculate_gap_fill.d.ts +5 -0
  54. package/dist/gap_fill/calculate_gap_fill.d.ts.map +1 -0
  55. package/dist/gap_fill/calculate_gap_fill.js +43 -0
  56. package/dist/gap_fill/calculate_gap_fill.js.map +1 -0
  57. package/dist/helper/qdrant_db_methods.d.ts +40 -0
  58. package/dist/helper/qdrant_db_methods.d.ts.map +1 -0
  59. package/dist/helper/qdrant_db_methods.js +63 -0
  60. package/dist/helper/qdrant_db_methods.js.map +1 -0
  61. package/dist/index.d.ts +3 -0
  62. package/dist/index.d.ts.map +1 -0
  63. package/dist/index.js +86 -140
  64. package/dist/index.js.map +1 -0
  65. package/dist/logger.d.ts +6 -0
  66. package/dist/logger.d.ts.map +1 -0
  67. package/dist/logger.js +42 -0
  68. package/dist/logger.js.map +1 -0
  69. package/dist/parse/parse_card/parse_cloze_card.d.ts +10 -0
  70. package/dist/parse/parse_card/parse_cloze_card.d.ts.map +1 -0
  71. package/dist/parse/parse_card/parse_cloze_card.js +126 -0
  72. package/dist/parse/parse_card/parse_cloze_card.js.map +1 -0
  73. package/dist/parse/parse_card/parse_flash_cards.d.ts +19 -0
  74. package/dist/parse/parse_card/parse_flash_cards.d.ts.map +1 -0
  75. package/dist/parse/parse_card/parse_flash_cards.js +34 -0
  76. package/dist/parse/parse_card/parse_flash_cards.js.map +1 -0
  77. package/dist/parse/parse_card/parse_match_card.d.ts +16 -0
  78. package/dist/parse/parse_card/parse_match_card.d.ts.map +1 -0
  79. package/dist/parse/parse_card/parse_match_card.js +82 -0
  80. package/dist/parse/parse_card/parse_match_card.js.map +1 -0
  81. package/dist/parse/parse_card/parse_mcq_card.d.ts +24 -0
  82. package/dist/parse/parse_card/parse_mcq_card.d.ts.map +1 -0
  83. package/dist/parse/parse_card/parse_mcq_card.js +104 -0
  84. package/dist/parse/parse_card/parse_mcq_card.js.map +1 -0
  85. package/dist/parse/parse_card_response.d.ts +19 -0
  86. package/dist/parse/parse_card_response.d.ts.map +1 -0
  87. package/dist/parse/parse_card_response.js +100 -0
  88. package/dist/parse/parse_card_response.js.map +1 -0
  89. package/dist/parse/parse_source_content.d.ts +25 -0
  90. package/dist/parse/parse_source_content.d.ts.map +1 -0
  91. package/dist/parse/parse_source_content.js +186 -0
  92. package/dist/parse/parse_source_content.js.map +1 -0
  93. package/dist/parse/response_format_card.d.ts +177 -0
  94. package/dist/parse/response_format_card.d.ts.map +1 -0
  95. package/dist/parse/response_format_card.js +372 -0
  96. package/dist/parse/response_format_card.js.map +1 -0
  97. package/dist/parse/response_format_typology.d.ts +2 -0
  98. package/dist/parse/response_format_typology.d.ts.map +1 -0
  99. package/dist/{parse_response → parse}/response_format_typology.js +18 -18
  100. package/dist/parse/response_format_typology.js.map +1 -0
  101. package/dist/services/open_ai_service.d.ts +16 -0
  102. package/dist/services/open_ai_service.d.ts.map +1 -0
  103. package/dist/services/open_ai_service.js +92 -0
  104. package/dist/services/open_ai_service.js.map +1 -0
  105. package/dist/services/qdrant_service.d.ts +4 -0
  106. package/dist/services/qdrant_service.d.ts.map +1 -0
  107. package/dist/services/qdrant_service.js +14 -0
  108. package/dist/services/qdrant_service.js.map +1 -0
  109. package/dist/typology-parsed-response.d.ts +62 -0
  110. package/dist/typology-parsed-response.d.ts.map +1 -0
  111. package/dist/typology-parsed-response.js +1936 -0
  112. package/dist/typology-parsed-response.js.map +1 -0
  113. package/dist/typology_gen/generate_typology.d.ts +29 -0
  114. package/dist/typology_gen/generate_typology.d.ts.map +1 -0
  115. package/dist/typology_gen/generate_typology.js +92 -15
  116. package/dist/typology_gen/generate_typology.js.map +1 -0
  117. package/dist/utils/generate_args.d.ts +8 -0
  118. package/dist/utils/generate_args.d.ts.map +1 -0
  119. package/dist/utils/generate_args.js +28 -0
  120. package/dist/utils/generate_args.js.map +1 -0
  121. package/dist/utils/parse_openai_response.d.ts +11 -0
  122. package/dist/utils/parse_openai_response.d.ts.map +1 -0
  123. package/dist/utils/parse_openai_response.js +11 -10
  124. package/dist/utils/parse_openai_response.js.map +1 -0
  125. package/package.json +19 -7
  126. package/prompts.json +23 -0
  127. package/readme.md +16 -13
  128. package/src/bootstrap/app.ts +167 -107
  129. package/src/card_gen/generate_cards.ts +58 -0
  130. package/src/config.ts +5 -3
  131. package/src/constants/api_constants.ts +7 -0
  132. package/src/constants/prompt_data.ts +301 -0
  133. package/src/constants/prompts/card_gen_prompt.ts +101 -208
  134. package/src/constants/prompts/typology_prompt.ts +81 -33
  135. package/src/constants/source_data.ts +1029 -23
  136. package/src/embedding_generation/consolidation/global_consolidation.ts +96 -0
  137. package/src/embedding_generation/consolidation/local_consolidation.ts +141 -0
  138. package/src/embedding_generation/consolidation/write_consolidated_data.ts +98 -0
  139. package/src/embedding_generation/generate_embeddings.ts +41 -0
  140. package/src/embedding_generation/parse_embedding_response.ts +31 -0
  141. package/src/gap_fill/calculate_gap_fill.ts +50 -0
  142. package/src/helper/qdrant_db_methods.ts +77 -0
  143. package/src/index.ts +98 -164
  144. package/src/logger.ts +30 -0
  145. package/src/parse/parse_card/parse_cloze_card.ts +136 -0
  146. package/src/parse/parse_card/parse_flash_cards.ts +33 -0
  147. package/src/parse/parse_card/parse_match_card.ts +94 -0
  148. package/src/parse/parse_card/parse_mcq_card.ts +105 -0
  149. package/src/parse/parse_card_response.ts +117 -0
  150. package/src/parse/parse_source_content.ts +202 -0
  151. package/src/parse/response_format_card.ts +386 -0
  152. package/src/parse/response_format_typology.ts +44 -0
  153. package/src/services/open_ai_service.ts +88 -0
  154. package/src/services/qdrant_service.ts +10 -0
  155. package/src/typology-parsed-response.ts +1932 -0
  156. package/src/typology_gen/generate_typology.ts +101 -12
  157. package/src/utils/generate_args.ts +29 -0
  158. package/src/utils/parse_openai_response.ts +17 -19
  159. package/tsconfig.json +8 -3
  160. package/dist/class/parse/parse_source_content.js +0 -62
  161. package/dist/class/services/open_ai_service.js +0 -25
  162. package/dist/parse_response/response_format_card.js +0 -210
  163. package/dist/service/open_ai_request.js +0 -58
  164. package/src/class/parse/parse_source_content.ts +0 -71
  165. package/src/class/services/open_ai_service.ts +0 -18
  166. package/src/parse_response/response_format_card.ts +0 -211
  167. package/src/parse_response/response_format_typology.ts +0 -44
  168. package/src/service/open_ai_request.ts +0 -46
@@ -1,257 +1,154 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.returnCardGenPrompt = void 0;
3
+ exports.returnCardGenPrompt = returnCardGenPrompt;
4
4
  const promptString = `
5
- As a dedicated assistant at a learning company, your role is to analyze educational content and create test cards that help learners understand and remember key concepts and facts. You will be provided with:
5
+ As a dedicated teaching assistant at a learning company, your role is to create Bloom’s Taxonomy Level 1 test cards based on the provided content, concepts, and facts. Your response should be in JSON format.
6
+ Guidance for creating Bloom Level 1 questions Definition: retrieve, recall, or recognize relevant knowledge (concepts and facts) from long-term memory (e.g., recall dates of important events in U.S. history, remember the components of a bacterial cell).
7
+ Appropriate learning outcome verbs for this level include: cite, define, describe, identify, label, list, match, name, outline, quote, recall, report, reproduce, retrieve, show, state, tabulate, and tell.
6
8
 
9
+ You will be provided with the following:
7
10
  1. Title of the source
8
- 2. Main headings
9
- 3. The content
10
- 4. The field of knowledge it belongs
11
- 5. Key concepts in the source
12
- 6. Important facts in the source.
13
- 7. Summary of the content using cards
11
+ 2. The content
12
+ 3. Key concepts in the source
13
+ 4. Important facts in the source
14
14
 
15
- Follow these steps:
15
+ **Types of cards to generate**
16
+ You will generate the following card types: cloze, flash, match and mcq.
16
17
 
17
- 1. Analyze the content to identify any key concepts missing from the provided list.
18
- 2. Analyze the content to identify any important facts missing from the provided list.
19
- 3. Generate test cards for each concept and fact, tethered to either the entire source or specific headings.
20
- 4. Ensure all concepts and facts have at least one test card.
18
+ **Format your response in the following JSON format:**
21
19
 
22
- Please format your response in the following format.
23
20
  json
24
- "missing_concepts": ["concept1", "concept2", "concept3", "..."],
25
- "missing_facts": ["fact1", "fact2", "fact3", "..."],
21
+ {
26
22
  "test_cards": [
27
23
  {
28
- "type": "flash" | "mcq" | "cloze" | "match",
29
- "card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "right_choice 1": "...", "left_choice 1": "..." },
30
- "card_reference": "source_title#heading",
31
- "concepts": ["Concept1", "Concept2", "..."],
32
- "facts": ["Fact1", "Fact2", "..."]
33
- }
24
+ "type": "{card_type}",
25
+ "card_content": "{content}",
26
+ "concepts": ["concept1", "concept2", "..."],
27
+ "facts": ["fact1", "fact2", "..."]
28
+ },
29
+ {... as many cards as possible}
34
30
  ]
31
+ }
35
32
 
36
- **Criteria**
37
- • Each test card must include at least one concept or fact.
38
- • Flashcards must not exceed 15% of the total number of cards.
39
- • Each concept and fact must have at least one test card.
40
-
41
- Further instructions are provided below.
42
- Concepts are fundamental ideas that form the basis of knowledge in any discipline. They help organize and explain information, making it accessible and relatable.
43
-
44
- You are provided with a list of identified concepts. Review this list and the content to determine if any concepts are missing.
45
-
46
- 1. **Definition of a Concept**: Concepts should be significant ideas within the content that are essential for understanding the main themes.
47
- 2. **Inclusion Criteria**: Include a concept only if it has not been previously included in the list provided to you.
48
33
 
49
- List the concepts in the following JSON format:
34
+ **Note:** Detailed instructions for creating the content for each test card type will be provided subsequently.
50
35
 
51
- json
52
- {
53
- "missing_concepts": ["concept1", "concept2", "concept3", "..."]
54
- }
36
+ **Success Criteria:**
55
37
 
56
- Facts are objective statements supported by empirical evidence or observation, such as data on events, people, numbers, dates, or well-established ideas.
38
+ * Each card must test at least one concept or fact.
39
+ * The concepts and facts in each card MUST MATCH EXACTLY with those provided in the input.
40
+ * Provide clear and concise content for each test card, ensuring it is relevant to the concepts and facts identified.
41
+ * Use appropriate and engaging language to enhance learning and retention.
42
+ * Ensure a balanced distribution of each card type in the final output.
43
+ * Keep generating cards till you have covered all the concepts and facts provided to you.
57
44
 
58
- You are provided with a list of identified facts. Review this list and the content to determine if any facts are missing.
45
+ **Cloze**
59
46
 
60
- 1. **Definition of a Fact**: Standalone information that is concrete and independently verifiable.
61
- 2. **Selection Criteria**: Choose facts based on their significance to the content's main themes or concepts, their educational value, or their foundational role in the subject. Only inlcude those that have not present in the list provided to you.
47
+ A test card where a portion of text is masked for the learner to identify from the provided options.
48
+ Follow the schema below to create new cloze cards specially focus on how correct options are enclosed with in {{}}.
62
49
 
63
- Record the facts in the following JSON format:
50
+ Use the schema below to create new cloze cards.
64
51
 
65
52
  json
66
53
  {
67
- "missing_facts": ["fact1", "fact2", "fact3", "..."]
54
+ "type": "cloze",
55
+ "card_content":
56
+ {
57
+ "prompt": "This is some {{sample}} text for {{showing}} how to create clozes.",
58
+ "correct_options": ["sample", "showing"],
59
+ "incorrect_options": ["incorrect_option1", "incorrect_option2", "..."],
60
+ "explanation": "optional 320 character explanation"
61
+ },
62
+ "concepts": ["concept1", "concept2", "..."],
63
+ "facts": ["fact1", "fact2", ...]
64
+
68
65
  }
69
66
 
70
- After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
71
67
 
72
- 1. Clarity: Ensure the test content is clear and unambiguous.
73
- 2. Specificity: Be specific about what you are asking. Avoid vague or overly broad questions or prompts.
74
- 3. Simplicity: Use simple and direct language. Avoid complex sentences or jargon unless testing understanding of that jargon.
75
- 4. Relevance: Ensure the test content is directly related to the key concepts or facts you want to test.
68
+ * A valid cloze must include at least one or more words
69
+ * When appropriate, include a brief explanation (320 characters max) to help the learner understand the concept or fact and how to answer the question.
70
+ * Minimum clozes required: 1
71
+ * Minimum choices (correct options + incorrect options) required: 2
72
+ * Maximum choices (correct options + incorrect options) allowed: 8
73
+ * Maximum character length for the prompt: 320
74
+ * Maximum character length for an individual cloze: 90
75
+ **Flashcards**
76
76
 
77
- Test cards must be one of the following types:
77
+ Test cards that have a front and a back.
78
78
 
79
- 1. Flashcards: Have a front and back.
79
+ Use the schema below to create new flashcards.
80
80
 
81
81
  json
82
82
  {
83
83
  "type": "flash",
84
84
  "card_content": {
85
85
  "front": "<content for the front>",
86
- "back": "<content for the back>"
86
+ "back": "<content for the back>",
87
+ "explanation": "optional 320 character explanation"
87
88
  },
88
- "card_reference": "source_title#heading",
89
- "concepts": ["Concept1", "Concept2", "..."],
90
- "facts": ["Fact1", "Fact2", "..."]
89
+ "concepts": ["concept1", "concept2", "..."],
90
+ "facts": ["fact1", "fact2", "..."],
91
91
  }
92
92
 
93
- - Each side must not exceed 300 characters.
94
- 2. Multiple Choice Questions (MCQ): Provide multiple choices to pick from. One or more should be correct.
95
93
 
96
- json
97
- {
98
- "type": "mcq",
99
- "card_content": {
100
- "prompt": "<question text>",
101
- "choices": [
102
- {"choice": "choice 1", "is_correct": true or false},
103
- {"choice": "choice 2", "is_correct": true or false},
104
- "... up to 8 choices"
105
- ]
106
- },
107
- "card_reference": "source_title#heading",
108
- "concepts": ["Concept1", "Concept2", "..."],
109
- "facts": ["Fact1", "Fact2", "..."]
110
- }
111
-
112
- • Minimum choices required: 2
113
- • Maximum choices allowed: 8
114
- • Minimum correct choices required: 1
115
- • Maximum character length for the prompt: 320
116
- • Maximum character length for each choice: 42
94
+ * Each side (front and back) must not exceed 320 characters.
95
+ * When appropriate, include a brief explanation (320 characters max) to help the learner understand the concept or fact and how to answer the question.
117
96
 
118
- 3. Cloze: Fill-in-the-blank style test card. Use double curly braces {{}} to indicate a cloze.
119
-
120
- json
121
- {
122
- "type": "cloze",
123
- "card_content": {
124
- "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
125
- "options": [
126
- {"option": "notes", "cloze": "c0"},
127
- {"option": "scale", "cloze": "c1"},
128
- {"option": "mode", "cloze": "c2"},
129
- {"option": "chords", "cloze": "null"},
130
- "... up to 8 choices"
131
- ]
132
- },
133
- "card_reference": "source_title#heading",
134
- "concepts": ["Concept1", "Concept2", "..."],
135
- "facts": ["Fact1", "Fact2", "..."]
136
- }
137
-
138
- • Minimum choices required: 2
139
- • Maximum choices allowed: 8
140
- • Minimum correct choices required: 1
141
- • Maximum character length for the prompt: 320
142
- • Maximum character length for an individual cloze: 90
143
-
144
- 4. Match: Pairing items.
97
+ **Match**
98
+ Provide item pairs.
99
+ Use the schema below to create new match cards.
145
100
 
146
101
  json
147
102
  {
148
103
  "type": "match",
149
- "card_content": {
150
- "right_choice 1": "left_choice 1",
151
- "right_choice 2": "left_choice 2",
152
- "... up to 8 total pairs"
153
- },
154
- "card_reference": "source_title#heading",
155
- "concepts": ["Concept1", "Concept2", "..."],
156
- "facts": ["Fact1", "Fact2", "..."]
157
- }
158
-
159
- • Maximum character length for each item in a pair: 42
160
-
161
-
162
- The schema for each card type is below.
163
-
164
- A flashcard consists of two sides: a front and a back. Both the front and back text content must not exceed more than 300 characters in length.
165
-
166
- The content schema should be represented in this manner:
167
- json
168
- {
169
- "front": "<content for the front of the flashcard>",
170
- "back": "<content for the back of the flashcard>"
171
- }
172
-
173
-
174
- The schema for an mcq card is shown below.
175
-
176
- json
177
- {
178
- "prompt": "<question text>",
179
- "choices":
180
- [
181
- {
182
- choice: "choice 1",
183
- is_correct: true or false
184
- },
185
- {
186
- choice: "choice 2",
187
- is_correct: true or false
188
- }
189
- "... up to 8 choices"
190
- ]
191
- }
192
-
193
- Minimum choices required: 2
194
- Maximum choices allowed: 8
195
- Minimum correct choices required: 1
196
- Maximum character length for the prompt: 320
197
- Maximum character length for each choice: 42
198
-
199
-
200
- For questions of the "type": "cloze", which refers to a fill-in-the-blank style question, the format is outlined below. I have used the sample text here because it is easier to illustrate the schema with an example:
201
-
202
- json
203
- {
204
- "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature."
205
- "options":
104
+ "card_content":
206
105
  [
207
106
  {
208
- "option: "notes",
209
- "cloze": "c0"
210
- },
211
- {
212
- "option: "scale",
213
- "cloze": "c1"
214
- },
215
- {
216
- "option: "mode",
217
- "cloze": "c2"
218
- },
219
- {
220
- "option: "chords",
221
- "cloze": "null"
222
- },
223
- {
224
- "option: "tilda",
225
- "cloze": "null"
107
+ "left_item" : "left_item text",
108
+ "right_item" : "right_item text"
226
109
  },
227
110
  {
228
- "option: "score",
229
- "cloze": "null"
111
+ "left_item" : "left_item text",
112
+ "right_item" : "right_item text"
230
113
  },
231
- "... up to a maximum of 8 choices total"
232
- ]
114
+ {"... up to 8 total pairs"}
115
+ ],
116
+ "concepts": ["concept1", "concept2", "..."],
117
+ "facts": ["fact1", "fact2", ...]
233
118
  }
234
119
 
235
- Minimum choices required: 2
236
- Maximum choices allowed: 8
237
- Minimum correct choices required: 1
238
- Maximum character length for the prompt: 320
239
- Maximum character length for an individual cloze: 90
240
120
 
241
- The schema for match type cards are as follows.
121
+ * Maximum character length for each left/right item text : 30, strictly enforced.
122
+ * Duplicate items are allowed. Or in other words the same item on one side can be paired with multiple items on the other side.
123
+
124
+ **Multiple Choice Questions (MCQ)**
125
+ Provide multiple choices to pick from. One or more should be correct.
126
+ Use the schema below to create new MCQ cards.
242
127
  json
243
128
  {
244
- "right_choice 1": "left_choice 1",
245
- "right_choice 2": "left_choice 2"
246
- "right_choice 3": "left_choice 3"
247
- "... up to 8 total pairs"
129
+ "type": "mcq",
130
+ "card_content": {
131
+ "prompt": "<question text>",
132
+ "choices": [
133
+ {"choice": "choice content", "is_correct": true or false},
134
+ {"choice": "choice content", "is_correct": true or false},
135
+ "... up to 8 choices"
136
+ ],
137
+ "explanation": "optional 320 character explanation"
138
+ },
139
+ "concepts": ["concept1", "concept2", "..."],
140
+ "facts": ["fact1", "fact2", ...]
248
141
  }
249
142
 
250
- Maximum character length for each item in a pair: 42
251
- Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows: source_title#main_heading, where #main_heading is optional.
252
- PART 6
253
143
 
254
- Once you are done generating the test cards. Go back and evaulate the full list of concepts and fact that include any of the missing concepts or facts along with the list that was provided as the input.
144
+ * When appropriate, include a brief explanation (320 characters max) to help the learner understand the concept or fact and how to answer the question.
145
+ * Minimum choices required: 2
146
+ * Maximum choices allowed: 8
147
+ * Minimum correct choices required: 1
148
+ * Maximum character length for the prompt: 320
149
+ * Maximum character length for each choice: 42
150
+ * DO NOT add numbering to the choice content since these will be randomly sorted when displaying to the user
151
+ Once you are done generating the test cards. Go back and evaulate the full list of concepts and facts provided as the input.
255
152
 
256
153
  Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
257
154
 
@@ -259,13 +156,13 @@ Once you are done creating come back to this step again to check if you have ful
259
156
 
260
157
  Once you are done generating the test cards, review the full list of concepts and facts, including any missing ones you identified.
261
158
 
262
- 1. Ensure every concept and fact has at least one test card (if not more).
263
- 2. If any concept or fact is missing a test card, create one for it.
264
- 3. Repeat this step until all concepts and facts are covered.
159
+ 1. Ensure every concept and fact has at least one test card (if not more).
160
+ 2. If any concept or fact is missing a test card, create one for it.
161
+ 3. Repeat this step until all concepts and facts are covered.
265
162
 
266
163
  Only stop generating test questions once you believe there is sufficient testing material for learners to fully understand the concepts and remember the facts. The same concept or fact can have multiple test cards, so continue creating test cards until you are confident that there are enough for learners to fully grasp the source material.
267
164
  `;
268
165
  function returnCardGenPrompt() {
269
166
  return promptString;
270
167
  }
271
- exports.returnCardGenPrompt = returnCardGenPrompt;
168
+ //# sourceMappingURL=card_gen_prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card_gen_prompt.js","sourceRoot":"","sources":["../../../src/constants/prompts/card_gen_prompt.ts"],"names":[],"mappings":";;AAiKA,kDAEC;AAnKD,MAAM,YAAY,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgK5B,CAAC;AACF,SAAgB,mBAAmB;IAC/B,OAAO,YAAY,CAAC;AACxB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function returnTypologyPrompt(): string;
2
+ //# sourceMappingURL=typology_prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typology_prompt.d.ts","sourceRoot":"","sources":["../../../src/constants/prompts/typology_prompt.ts"],"names":[],"mappings":"AAyIA,wBAAgB,oBAAoB,WAEnC"}
@@ -1,23 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.returnTypologyPrompt = void 0;
3
+ exports.returnTypologyPrompt = returnTypologyPrompt;
4
4
  const typologyPromptString = `
5
- As a dedicated assistant at a learning company, your role involves analyzing educational content to categorize and summarize it. You will process content (in JSON format) that represents text and images from diverse sources such as PDFs, book chapters, videos, and websites. Follow these steps:
5
+ You are a dedicated assistant that categorizes and summarizes educational content. You will process educational content (in JSON format) that represents text from diverse sources such as wikipedia, markdown notes, PDFs, book chapters, and websites.
6
+ You will be provided with the following:
7
+ 1. Title of the source
8
+ 2. A list of main headings in the source
9
+ 3. The source content
10
+
11
+ Perform the following tasks:
6
12
 
7
13
  1. Classify the content into one to three predefined fields of knowledge.
8
- 2. Identify key concepts within the content.
9
- 3. Detect concrete facts that are empirically verified and relevant to the subject.
10
- 4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
14
+ 2. Extract key concepts within the content. Be exhaustive and thorough.
15
+ 3. Extract concrete and relevant facts that are referenced in the content. Be exhaustive and thorough.
16
+ 4. Decide whether the content has any educational value and should be used to generate test material and quizzes based on the identified concepts and facts.
11
17
  5. If the generate_cards is true then summarize the content using a series of summary cards.
12
18
 
13
- Please format your findings in this JSON schema:
19
+ Output your answer as valid JSON, in the form:
14
20
  json
15
21
  {
16
22
  "field": ["primary_field", "secondary_field", "tertiary_field"],
17
- "concepts": ["concept1", "concept2", "concept3", "..."],
18
- "facts": ["fact1", "fact2", "fact3", "..."],
19
- "generate_cards": true or false
20
- "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
23
+ "concepts":
24
+ [
25
+ {
26
+ "concept_text": "concept_content",
27
+ "reference": "main_heading"
28
+ },
29
+ {...}
30
+ ],
31
+ "facts":
32
+ [
33
+ {
34
+ "fact_text": "fact_content",
35
+ "reference": "main_heading"
36
+ },
37
+ {...}
38
+ ],
39
+ "generate_cards": [
40
+ state: true or false,
41
+ reason: "reason for marking the source as false. Leave empty for true."
42
+ ],
43
+ "summary_cards": ["summary_card1_content", "summary_card2_content", "summary_card3_content", "..."]
21
44
  }
22
45
 
23
46
  Further instruction on how to perform these tasks are below.
@@ -41,55 +64,76 @@ Every source must be placed under a field. This is the broadest category of know
41
64
  16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
42
65
  17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
43
66
  18. Other: Use for content that doesn’t fit into the above categories.
67
+ Extract key concepts within the content after classifying the field. This is a crucial part of the exercise. Be exhaustive and thorough.
44
68
 
45
- Identify key concepts within the content after classifying the field. Concepts are the fundamental ideas or categories that form the basis of knowledge within any discipline. They help organize and explain information, making it accessible and relatable.
46
-
47
- 1. **Definition of a Concept**: Concepts should be significant ideas that recur within the content and are essential for understanding the main themes.
48
- 2. **Inclusion Criteria**: Include a concept only if it is discussed in detail, meaning it is explained thoroughly, tied to specific examples, or highlighted as a critical part of the subject matter.
69
+ 1. **Definition of a Concept**: Concepts are fundamental ideas that form the basis of knowledge in any discipline. They help organize and explain information, making it accessible and relatable.
70
+ 2. **Inclusion Criteria**: Include a concept only if it is discussed in detail and is an important part of the subject matter of the source.
71
+ 3. **How to describe a concept**: The concept should be described so that a reader can comprehend the gist of it.
72
+ 4. **Character Limit**: Maintain a limit of 90 characters to ensure each concept is concise yet informative.
73
+ 5. **Reference**: Every concept must include a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The heading must exactly match one of the headings provided to you. Sometimes concepts may need to reference the entire text or multiple headings, leave the reference empty for such cases.
49
74
 
50
75
  List the concepts in the following JSON format:
51
- json
52
- {
53
- "concepts": ["concept1", "concept2", "concept3", "..."]
54
- }
55
76
 
56
- After classifying the content and identifying key concepts, proceed to extract and list verifiable facts. Facts are objective statements that must be supported by empirical evidence or observation, such as specific data on events, people, numbers, dates, or well-established ideas.
77
+ json
78
+ "concepts":
79
+ [
80
+ {
81
+ "concept_text": "concept_content",
82
+ "reference": "main_heading"
83
+ },
84
+ {...}
85
+ ]
86
+ After classifying the content and identifying key concepts, proceed to extract and list verifiable facts.
57
87
 
58
88
  1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
59
- 2. **Selection Criteria**: Choose facts based on their significance to the content's main themes or concepts, their educational value, or their foundational role in the subject.
89
+ 2. **Selection Criteria**: Inlcude facts based on their significance to the content's main themes or concepts, their educational value and their foundational role in the subject.
90
+ 3. **Character Limit**: Maintain a limit of 90 characters for the to ensure each message is concise yet informative.
91
+ 4. **Reference**: Every fact must include a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The heading must exactly match one of the headings provided to you. Sometimes facts may need to reference the entire text or multiple headings, leave the reference empty for such cases.
92
+
93
+ List the facts in the following JSON format:
60
94
 
61
- Record the facts in the following JSON format:
62
95
  json
63
- {
64
- "facts": ["fact1", "fact2", "fact3", "..."]
65
- }
96
+ "facts":
97
+ [
98
+ {
99
+ "fact_text": "fact_content",
100
+ "reference": "main_heading"
101
+ },
102
+ {...}
103
+ ]
104
+ After you have examined the content —its field, its concepts, and its facts— determine whether it justifies the creation of quiz materials.
66
105
 
67
- After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing materials. Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals.
106
+ Consider whether these elements offer the average learner meaningful insights, practical uses, or serve important educational aims. If, in your judgment, the material falls short of providing such value, explain why in fewer than 90 characters.
68
107
 
69
- 1. **Value Assessment**: Determine if the concepts and facts are essential for understanding the broader topic, are likely to be used in practical scenarios, or help in achieving educational benchmarks.
70
- 2. **Criteria for Material Generation**: Generate testing materials if the concepts and facts are central to the content, have broad applicability, and are likely to reinforce or expand the learner’s knowledge significantly.
108
+ Reflect your in the JSON format as follows:
71
109
 
72
- Make your decision using this criterion and reflect it in the JSON format as follows:
73
110
  json
74
- {
75
- "generate_cards": true or false
76
- }
111
+ "generate_cards":
112
+ { state: true or false,
113
+ reason: "reason for marking the source as false. Leave empty for true."
114
+ }
115
+ After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards.
77
116
 
78
- After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards. These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
117
+ These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
79
118
 
80
119
 
81
120
  1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
82
121
  2. **Summarization Objective**: Each card is a step in a journey through the content. The series should collectively summarize the source while emphasizing important learning points.
83
122
  3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
123
+ 4. **Card limit**: Limit the total number of cards to less than or equal to 8.
84
124
  4. **Engagement and Flow**: Write in an engaging style that maintains the user’s interest. Arrange the cards in a logical order that reflects the flow of the original content.
85
125
 
86
126
  Format your output in JSON as follows:
127
+
87
128
  json
88
129
  {
89
- "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
130
+ "summary_cards": ["summary_card1_content", "summary_card2_content", "summary_card3_content", "... up to 8 summary cards"]
90
131
  }
132
+
133
+
134
+
91
135
  `;
92
136
  function returnTypologyPrompt() {
93
137
  return typologyPromptString;
94
138
  }
95
- exports.returnTypologyPrompt = returnTypologyPrompt;
139
+ //# sourceMappingURL=typology_prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typology_prompt.js","sourceRoot":"","sources":["../../../src/constants/prompts/typology_prompt.ts"],"names":[],"mappings":";;AAyIA,oDAEC;AA3ID,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmI5B,CAAC;AAMF,SAAgB,oBAAoB;IAChC,OAAO,oBAAoB,CAAC;AAChC,CAAC"}