only_ever_generator 0.1.8 → 0.1.9

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.
@@ -1,5 +1,178 @@
1
- const promptString = `
2
- 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:
1
+ // const promptString = `
2
+ // 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:
3
+
4
+ // 1. Title of the source
5
+ // 2. Main headings
6
+ // 3. The content
7
+ // 4. The field of knowledge it belongs
8
+ // 5. Key concepts in the source
9
+ // 6. Important facts in the source.
10
+ // 7. Summary of the content using cards
11
+
12
+ // Follow these steps:
13
+
14
+ // 1. Analyze the content to identify any key concepts missing from the provided list.
15
+ // 2. Analyze the content to identify any important facts missing from the provided list.
16
+ // 3. Generate test cards for each concept and fact, tethered to either the entire source or specific headings.
17
+ // 4. Ensure all concepts and facts have at least one test card.
18
+
19
+ // Please format your response in the following format.
20
+ // json
21
+ // "missing_concepts": ["concept1", "concept2", "concept3", "..."],
22
+ // "missing_facts": ["fact1", "fact2", "fact3", "..."],
23
+ // "test_cards": [
24
+ // {
25
+ // "type": "flash" | "mcq" | "cloze" | "match",
26
+ // "card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "right_choice 1": "...", "left_choice 1": "..." },
27
+ // "card_reference": "heading",
28
+ // "concepts": ["Concept1", "Concept2", "..."],
29
+ // "facts": ["Fact1", "Fact2", "..."]
30
+ // }
31
+ // ]
32
+
33
+ // **Criteria**
34
+ // • Each test card must include at least one concept or fact.
35
+ // • Flashcards must not exceed 15% of the total number of cards.
36
+ // • Each concept and fact must have at least one test card.
37
+
38
+ // Further instructions are provided below.
39
+ // Concepts are fundamental ideas that form the basis of knowledge in any discipline. They help organize and explain information, making it accessible and relatable.
40
+
41
+ // You are provided with a list of identified concepts. Review this list and the content to determine if any concepts are missing.
42
+
43
+ // 1. **Definition of a Concept**: Concepts should be significant ideas within the content that are essential for understanding the main themes.
44
+ // 2. **Inclusion Criteria**: Include a concept only if it has not been previously included in the list provided to you.
45
+
46
+ // List the concepts in the following JSON format:
47
+
48
+ // json
49
+ // {
50
+ // "missing_concepts": ["concept1", "concept2", "concept3", "..."]
51
+ // }
52
+
53
+ // Facts are objective statements supported by empirical evidence or observation, such as data on events, people, numbers, dates, or well-established ideas.
54
+
55
+ // You are provided with a list of identified facts. Review this list and the content to determine if any facts are missing.
56
+
57
+ // 1. **Definition of a Fact**: Standalone information that is concrete and independently verifiable.
58
+ // 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.
59
+
60
+ // Record the facts in the following JSON format:
61
+
62
+ // json
63
+ // {
64
+ // "missing_facts": ["fact1", "fact2", "fact3", "..."]
65
+ // }
66
+ // After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
67
+
68
+ // 1. Clarity: Ensure the test content is clear and unambiguous.
69
+ // 2. Specificity: Be specific about what you are asking. Avoid vague or overly broad questions or prompts.
70
+ // 3. Simplicity: Use simple and direct language. Avoid complex sentences or jargon unless testing understanding of that jargon.
71
+ // 4. Relevance: Ensure the test content is directly related to the key concepts or facts you want to test.
72
+
73
+ // Test cards must be one of the following types:
74
+
75
+ // 1. Flashcards: Have a front and back.
76
+ // 2. 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.
77
+
78
+ // json schema for Flash Cards:
79
+ // {
80
+ // "type": "flash",
81
+ // "card_content": {
82
+ // "front": "<content for the front of the flashcard>",
83
+ // "back": "<content for the back of the flashcard>"
84
+ // },
85
+ // "card_reference": "heading",
86
+ // "concepts": ["Concept1", "Concept2", "..."],
87
+ // "facts": ["Fact1", "Fact2", "..."]
88
+ // }
89
+
90
+
91
+ // 2. Multiple Choice Questions (MCQ): Provide multiple choices to pick from. One or more should be correct.
92
+ // • Minimum choices required: 2
93
+ // • Maximum choices allowed: 8
94
+ // • Minimum correct choices required: 1
95
+ // • Maximum character length for the prompt: 320
96
+ // • Maximum character length for each choice: 42
97
+
98
+ // json schema for mcqs
99
+ // {
100
+ // "type": "mcq",
101
+ // "card_content": {
102
+ // "prompt": "<question text>",
103
+ // "choices": [
104
+ // {"choice": "choice 1", "is_correct": true or false},
105
+ // {"choice": "choice 2", "is_correct": true or false},
106
+ // "... up to 8 choices"
107
+ // ]
108
+ // },
109
+ // "card_reference": "heading",
110
+ // "concepts": ["Concept1", "Concept2", "..."],
111
+ // "facts": ["Fact1", "Fact2", "..."]
112
+ // }
113
+
114
+ // 3. Cloze:
115
+ // Fill-in-the-blank style test card. Use double curly braces {{}} to indicate a cloze this is absolute necessagr
116
+ // • Minimum choices required: 2
117
+ // • Maximum choices allowed: 8
118
+ // • Minimum correct choices required: 1
119
+ // • Maximum character length for the prompt: 320
120
+ // • Maximum character length for an individual cloze: 90
121
+
122
+ // json schema for cloze
123
+ // {
124
+ // "type": "cloze",
125
+ // "card_content": {
126
+ // "text": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
127
+ // "options": [
128
+ // {"option": "notes", "cloze": "c0"},
129
+ // {"option": "scale", "cloze": "c1"},
130
+ // {"option": "mode", "cloze": "c2"},
131
+ // {"option": "chords", "cloze": null},
132
+ // "... up to 8 choices"
133
+ // ]
134
+ // },
135
+ // "card_reference": "heading",
136
+ // "concepts": ["Concept1", "Concept2", "..."],
137
+ // "facts": ["Fact1", "Fact2", "..."]
138
+ // }
139
+
140
+
141
+
142
+ // 4. Match: Pairing items.
143
+ // • Maximum character length for each item in a pair: 42
144
+
145
+ // json schema for match
146
+ // {
147
+ // "type": "match",
148
+ // "card_content": {
149
+ // "right_choice 1": "left_choice 1",
150
+ // "right_choice 2": "left_choice 2",
151
+ // "... up to 8 total pairs"
152
+ // },
153
+ // "card_reference": "heading",
154
+ // "concepts": ["Concept1", "Concept2", "..."],
155
+ // "facts": ["Fact1", "Fact2", "..."]
156
+ // }
157
+
158
+ // 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.
159
+
160
+ // Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
161
+
162
+ // Once you are done creating come back to this step again to check if you have full coverage of all the concepts and facts in the source. You can stop generating test questions once you achieve full coverage.
163
+
164
+ // Once you are done generating the test cards, review the full list of concepts and facts, including any missing ones you identified.
165
+
166
+ // 1. Ensure every concept and fact has at least one test card (if not more).
167
+ // 2. If any concept or fact is missing a test card, create one for it.
168
+ // 3. Repeat this step until all concepts and facts are covered.
169
+
170
+ // 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.
171
+ // `;
172
+
173
+ const promptString : any = {
174
+ role: `
175
+ 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:
3
176
 
4
177
  1. Title of the source
5
178
  2. Main headings
@@ -17,145 +190,161 @@ Follow these steps:
17
190
  4. Ensure all concepts and facts have at least one test card.
18
191
 
19
192
  Please format your response in the following format.
20
- json
21
- "missing_concepts": ["concept1", "concept2", "concept3", "..."],
22
- "missing_facts": ["fact1", "fact2", "fact3", "..."],
23
- "test_cards": [
24
- {
25
- "type": "flash" | "mcq" | "cloze" | "match",
26
- "card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "right_choice 1": "...", "left_choice 1": "..." },
27
- "card_reference": "heading",
28
- "concepts": ["Concept1", "Concept2", "..."],
29
- "facts": ["Fact1", "Fact2", "..."]
30
- }
31
- ]
32
193
 
194
+ "missing_concepts": ["concept1", "concept2", "concept3", "..."],
195
+ "missing_facts": ["fact1", "fact2", "fact3", "..."],
196
+ "test_cards": [
197
+ {
198
+ "type": "flash" | "mcq" | "cloze" | "match",
199
+ "card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "...": "...", "....": "..." },
200
+ "card_reference": "source_title#heading",
201
+ "concepts": ["Concept1", "Concept2", "..."],
202
+ "facts": ["Fact1", "Fact2", "..."],
203
+ "bloom_level": <1-5>
204
+ }
205
+ ]
33
206
  **Criteria**
207
+ • Atleast one test card must be generated.
34
208
  • Each test card must include at least one concept or fact.
209
+ • Each test card must include bloom_level.
35
210
  • Flashcards must not exceed 15% of the total number of cards.
36
211
  • Each concept and fact must have at least one test card.
37
212
 
38
213
  Further instructions are provided below.
39
- Concepts are fundamental ideas that form the basis of knowledge in any discipline. They help organize and explain information, making it accessible and relatable.
40
-
41
- You are provided with a list of identified concepts. Review this list and the content to determine if any concepts are missing.
214
+ `,
215
+ concepts : `
216
+ You are provided with a list of identified concepts. Review this list and the content to determine if any concepts are missing.
42
217
 
43
- 1. **Definition of a Concept**: Concepts should be significant ideas within the content that are essential for understanding the main themes.
218
+ 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.
44
219
  2. **Inclusion Criteria**: Include a concept only if it has not been previously included in the list provided to you.
45
220
 
46
221
  List the concepts in the following JSON format:
47
-
48
- json
49
222
  {
50
- "missing_concepts": ["concept1", "concept2", "concept3", "..."]
223
+ "missing_concepts":
224
+ [
225
+ "concept1",
226
+ "concept2",
227
+ "concept3",
228
+ "..."
229
+ ]
51
230
  }
52
-
53
- Facts are objective statements supported by empirical evidence or observation, such as data on events, people, numbers, dates, or well-established ideas.
54
-
55
- You are provided with a list of identified facts. Review this list and the content to determine if any facts are missing.
231
+ `,
232
+ facts :`
233
+ You are provided with a list of identified facts. Review this list and the content to determine if any facts are missing.
56
234
 
57
235
  1. **Definition of a Fact**: Standalone information that is concrete and independently verifiable.
58
236
  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.
59
237
 
60
238
  Record the facts in the following JSON format:
61
-
62
- json
63
239
  {
64
- "missing_facts": ["fact1", "fact2", "fact3", "..."]
240
+ "missing_facts": ["fact1", "fact2", "fact3", "..."]
65
241
  }
66
- After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
242
+ `,
243
+ card_gen: `
244
+ After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
245
+
246
+ 1. Clarity: Ensure the test content is clear and unambiguous.
247
+ 2. Specificity: Be specific about what you are asking. Avoid vague or overly broad questions or prompts.
248
+ 3. Simplicity: Use simple and direct language. Avoid complex sentences or jargon unless testing understanding of that jargon.
249
+ 4. Relevance: Ensure the test content is directly related to the key concepts or facts you want to test.
250
+
251
+ Include the following property for each card:
252
+
253
+ bloom_level: Indicate the level of Bloom’s Taxonomy the card corresponds to (from level 1 to level 5). Ensure that you produce a balanced number of cards across all levels, focusing on levels 1 through 5. Aim for a diverse range of cognitive challenges.
67
254
 
68
- 1. Clarity: Ensure the test content is clear and unambiguous.
69
- 2. Specificity: Be specific about what you are asking. Avoid vague or overly broad questions or prompts.
70
- 3. Simplicity: Use simple and direct language. Avoid complex sentences or jargon unless testing understanding of that jargon.
71
- 4. Relevance: Ensure the test content is directly related to the key concepts or facts you want to test.
255
+ Make sure to include this field in each card.
256
+ Ensure that you produce at least one card for each concept and fact. Do not skip any concepts or facts, and be thorough in your coverage. Cards should span across different levels of Bloom’s Taxonomy, from level 1 (Remembering) to level 5 (Evaluating), but exclude level 6 (Creating).
72
257
 
73
258
  Test cards must be one of the following types:
74
259
 
75
260
  1. Flashcards: Have a front and back.
76
- 2. 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.
77
261
 
78
- json schema for Flash Cards:
262
+ json:
79
263
  {
80
- "type": "flash",
81
- "card_content": {
82
- "front": "<content for the front of the flashcard>",
83
- "back": "<content for the back of the flashcard>"
84
- },
85
- "card_reference": "heading",
86
- "concepts": ["Concept1", "Concept2", "..."],
87
- "facts": ["Fact1", "Fact2", "..."]
264
+ "type": "flash",
265
+ "card_content": {
266
+ "front": "<content for the front>",
267
+ "back": "<content for the back>"
268
+ },
269
+ "card_reference": "source_title#heading",
270
+ "concepts": ["Concept1", "Concept2", "..."],
271
+ "facts": ["Fact1", "Fact2", "..."],
272
+ "bloom_level": <1-5>
88
273
  }
89
274
 
90
-
275
+ - Each side must not exceed 300 characters.
91
276
  2. Multiple Choice Questions (MCQ): Provide multiple choices to pick from. One or more should be correct.
277
+
278
+ json:
279
+ {
280
+ "type": "mcq",
281
+ "card_content": {
282
+ "prompt": "<question text>",
283
+ "choices": [
284
+ {"choice": "choice 1", "is_correct": true or false},
285
+ {"choice": "choice 2", "is_correct": true or false},
286
+ "... up to 8 choices"
287
+ ]
288
+ },
289
+ "card_reference": "source_title#heading",
290
+ "concepts": ["Concept1", "Concept2", "..."],
291
+ "facts": ["Fact1", "Fact2", "..."],
292
+ "bloom_level": <1-5>
293
+ }
294
+
92
295
  • Minimum choices required: 2
93
296
  • Maximum choices allowed: 8
94
297
  • Minimum correct choices required: 1
95
298
  • Maximum character length for the prompt: 320
96
299
  • Maximum character length for each choice: 42
97
300
 
98
- json schema for mcqs
301
+ 3. Cloze: A test card where a portion of text is masked for the learner to identify from the provided options. Use double curly braces {{c<n>: cloze_text}} to indicate a cloze, where n is the index number of the cloze (starting from 0) and cloze_text is the word or phrase being clozed.
302
+
303
+ json
99
304
  {
100
- "type": "mcq",
101
- "card_content": {
102
- "prompt": "<question text>",
103
- "choices": [
104
- {"choice": "choice 1", "is_correct": true or false},
105
- {"choice": "choice 2", "is_correct": true or false},
106
- "... up to 8 choices"
107
- ]
108
- },
109
- "card_reference": "heading",
110
- "concepts": ["Concept1", "Concept2", "..."],
111
- "facts": ["Fact1", "Fact2", "..."]
305
+ "type": "cloze",
306
+ "card_content": {
307
+ "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
308
+ "options": [
309
+ {"option": "notes", "cloze": "c0"},
310
+ {"option": "scale", "cloze": "c1"},
311
+ {"option": "mode", "cloze": "c2"},
312
+ {"option": "chords", "cloze": "null"},
313
+ "... up to 8 choices"
314
+ ]
315
+ },
316
+ "card_reference": "source_title#heading",
317
+ "concepts": ["Concept1", "Concept2", "..."],
318
+ "facts": ["Fact1", "Fact2", "..."],
319
+ "bloom_level": <1-5>
112
320
  }
113
321
 
114
- 3. Cloze:
115
- Fill-in-the-blank style test card. Use double curly braces {{}} to indicate a cloze this is absolute necessagr
116
322
  • Minimum choices required: 2
117
323
  • Maximum choices allowed: 8
118
324
  • Minimum correct choices required: 1
119
325
  • Maximum character length for the prompt: 320
120
326
  • Maximum character length for an individual cloze: 90
121
327
 
122
- json schema for cloze
123
- {
124
- "type": "cloze",
125
- "card_content": {
126
- "text": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
127
- "options": [
128
- {"option": "notes", "cloze": "c0"},
129
- {"option": "scale", "cloze": "c1"},
130
- {"option": "mode", "cloze": "c2"},
131
- {"option": "chords", "cloze": null},
132
- "... up to 8 choices"
133
- ]
134
- },
135
- "card_reference": "heading",
136
- "concepts": ["Concept1", "Concept2", "..."],
137
- "facts": ["Fact1", "Fact2", "..."]
138
- }
139
-
140
-
141
-
142
328
  4. Match: Pairing items.
143
- • Maximum character length for each item in a pair: 42
144
329
 
145
- json schema for match
330
+ json
146
331
  {
147
- "type": "match",
148
- "card_content": {
149
- "right_choice 1": "left_choice 1",
150
- "right_choice 2": "left_choice 2",
151
- "... up to 8 total pairs"
152
- },
153
- "card_reference": "heading",
154
- "concepts": ["Concept1", "Concept2", "..."],
155
- "facts": ["Fact1", "Fact2", "..."]
332
+ "type": "match",
333
+ "card_content": {
334
+ "left_choice 1": "right_choice 1",
335
+ "left_choice 2": "right_choice 2",
336
+ "... up to 8 total pairs"
337
+ },
338
+ "card_reference": "source_title#heading",
339
+ "concepts": ["Concept1", "Concept2", "..."],
340
+ "facts": ["Fact1", "Fact2", "..."],
341
+ "bloom_level": <1-5>
156
342
  }
157
343
 
158
- 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.
344
+ • Maximum character length for each item in a pair: 42
345
+ `,
346
+ reference : `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.`,
347
+ checkcoverage: `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.
159
348
 
160
349
  Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
161
350
 
@@ -163,15 +352,21 @@ Once you are done creating come back to this step again to check if you have ful
163
352
 
164
353
  Once you are done generating the test cards, review the full list of concepts and facts, including any missing ones you identified.
165
354
 
166
- 1. Ensure every concept and fact has at least one test card (if not more).
167
- 2. If any concept or fact is missing a test card, create one for it.
168
- 3. Repeat this step until all concepts and facts are covered.
169
-
170
- 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.
171
- `;
355
+ 1. Ensure every concept and fact has at least one test card (if not more).
356
+ 2. If any concept or fact is missing a test card, create one for it.
357
+ 3. Repeat this step until all concepts and facts are covered.
172
358
 
359
+ 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.`
360
+
361
+ }
173
362
 
174
363
  export function returnCardGenPrompt(){
175
- return promptString;
364
+ let concatenatedString: string = '';
365
+ for (let key in promptString) {
366
+ if (promptString.hasOwnProperty(key)) {
367
+ concatenatedString += promptString[key];
368
+ }
369
+ }
370
+ return concatenatedString;
176
371
  }
177
372