only_ever_generator 0.3.9 → 0.4.0

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.
@@ -199,20 +199,14 @@ class GenerateCards {
199
199
  }
200
200
  parseMatchCard(cardData) {
201
201
  let content = cardData.card_content;
202
- const transformedData = {};
203
- for (let key in content) {
204
- if (content.hasOwnProperty(key)) {
205
- transformedData[key] = [content[key]];
206
- }
207
- }
208
- let displayTitle = this.generateMatchCardDisplayTitle(transformedData);
202
+ let displayTitle = this.generateMatchCardDisplayTitle(content);
209
203
  let matchCard = {
210
204
  type: {
211
205
  category: 'learning',
212
206
  sub_type: cardData.type,
213
207
  },
214
208
  heading: cardData.card_reference,
215
- content: transformedData,
209
+ content: content,
216
210
  // content: cardData.card_content,
217
211
  displayTitle: displayTitle,
218
212
  concepts: cardData.concepts,
@@ -224,16 +218,12 @@ class GenerateCards {
224
218
  generateMatchCardDisplayTitle(answers) {
225
219
  let titles = [];
226
220
  let counter = 65;
227
- for (let key in answers) {
228
- if (answers.hasOwnProperty(key)) {
229
- let value = answers[key];
230
- // let items = value.split(',').map((item: string) => item.trim());
231
- // items.forEach((item: any) => {
232
- let letter = String.fromCharCode(counter);
233
- titles.push(`${letter}. ${key} -- ${value}`);
234
- counter++;
235
- // });
236
- }
221
+ for (let data of answers) {
222
+ let value = data.right_item.join(',');
223
+ let left = data.left_item;
224
+ let letter = String.fromCharCode(counter);
225
+ titles.push(`${letter}. ${data} -- ${value}`);
226
+ counter++;
237
227
  }
238
228
  let displayTitle = titles.join(",");
239
229
  return displayTitle;
@@ -67,12 +67,13 @@ json
67
67
  {
68
68
  "missing_facts": ["fact1", "fact2", "fact3", "..."]
69
69
  }
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
70
 
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.
71
+ After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
72
+
73
+ 1. Clarity: Ensure the test content is clear and unambiguous.
74
+ 2. Specificity: Be specific about what you are asking. Avoid vague or overly broad questions or prompts.
75
+ 3. Simplicity: Use simple and direct language. Avoid complex sentences or jargon unless testing understanding of that jargon.
76
+ 4. Relevance: Ensure the test content is directly related to the key concepts or facts you want to test.
76
77
 
77
78
  Include the following property for each card:
78
79
 
@@ -84,37 +85,39 @@ Test cards must be one of the following types:
84
85
 
85
86
  1. Flashcards: Have a front and back.
86
87
 
87
- json
88
+ json:
88
89
  {
89
- "type": "flash",
90
- "card_content": {
91
- "front": "<content for the front>",
92
- "back": "<content for the back>"
93
- },
94
- "card_reference": "heading",
95
- "concepts": ["Concept1", "Concept2", "..."],
96
- "facts": ["Fact1", "Fact2", "..."],
97
- "bloom_level": <1-5>
90
+ "type": "flash",
91
+ "card_content": {
92
+ "front": "<content for the front>",
93
+ "back": "<content for the back>"
94
+ },
95
+ "card_reference": "heading",
96
+ "concepts": ["Concept1", "Concept2", "..."],
97
+ "facts": ["Fact1", "Fact2", "..."],
98
+ "bloom_level": <1-5>
98
99
  }
100
+
99
101
  - Each side must not exceed 300 characters.
100
102
  2. Multiple Choice Questions (MCQ): Provide multiple choices to pick from. One or more should be correct.
101
103
 
102
- json
104
+ json:
103
105
  {
104
- "type": "mcq",
105
- "card_content": {
106
- "prompt": "<question text>",
107
- "choices": [
108
- {"choice": "choice 1", "is_correct": true or false},
109
- {"choice": "choice 2", "is_correct": true or false},
110
- "... up to 8 choices"
111
- ]
112
- },
113
- "card_reference": "heading",
114
- "concepts": ["Concept1", "Concept2", "..."],
115
- "facts": ["Fact1", "Fact2", "..."],
116
- "bloom_level": <1-5>
106
+ "type": "mcq",
107
+ "card_content": {
108
+ "prompt": "<question text>",
109
+ "choices": [
110
+ {"choice": "choice 1", "is_correct": true or false},
111
+ {"choice": "choice 2", "is_correct": true or false},
112
+ "... up to 8 choices"
113
+ ]
114
+ },
115
+ "card_reference": "heading",
116
+ "concepts": ["Concept1", "Concept2", "..."],
117
+ "facts": ["Fact1", "Fact2", "..."],
118
+ "bloom_level": <1-5>
117
119
  }
120
+
118
121
  • Minimum choices required: 2
119
122
  • Maximum choices allowed: 8
120
123
  • Minimum correct choices required: 1
@@ -125,22 +128,23 @@ json
125
128
 
126
129
  json
127
130
  {
128
- "type": "cloze",
129
- "card_content": {
130
- "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
131
- "options": [
132
- {"option": "notes", "cloze": "c0"},
133
- {"option": "scale", "cloze": "c1"},
134
- {"option": "mode", "cloze": "c2"},
135
- {"option": "chords", "cloze": "null"},
136
- "... up to 8 choices"
137
- ]
138
- },
139
- "card_reference": "heading",
140
- "concepts": ["Concept1", "Concept2", "..."],
141
- "facts": ["Fact1", "Fact2", "..."],
142
- "bloom_level": <1-5>
131
+ "type": "cloze",
132
+ "card_content": {
133
+ "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
134
+ "options": [
135
+ {"option": "notes", "cloze": "c0"},
136
+ {"option": "scale", "cloze": "c1"},
137
+ {"option": "mode", "cloze": "c2"},
138
+ {"option": "chords", "cloze": "null"},
139
+ "... up to 8 choices"
140
+ ]
141
+ },
142
+ "card_reference": "heading",
143
+ "concepts": ["Concept1", "Concept2", "..."],
144
+ "facts": ["Fact1", "Fact2", "..."],
145
+ "bloom_level": <1-5>
143
146
  }
147
+
144
148
  • Minimum choices required: 2
145
149
  • Maximum choices allowed: 8
146
150
  • Minimum correct choices required: 1
@@ -148,20 +152,33 @@ json
148
152
  • Maximum character length for an individual cloze: 90
149
153
 
150
154
  4. Match: Pairing items.
155
+
151
156
  json
152
157
  {
153
- "type": "match",
154
- "card_content": {
155
- "right_choice 1": "left_choice 1",
156
- "right_choice 2": "left_choice 2",
157
- "... up to 8 total pairs"
158
- },
159
- "card_reference": "heading",
160
- "concepts": ["Concept1", "Concept2", "..."],
161
- "facts": ["Fact1", "Fact2", "..."],
162
- "bloom_level": <1-5>
158
+ "type": "match",
159
+ "card_content": [
160
+ {
161
+ "left_item": "left choice",
162
+ "right_item": [right item]
163
+ },
164
+ {
165
+ "left_item":" left choice",
166
+ "right_item": [right item]
167
+ },
168
+ {
169
+ "left_item": "left choice",
170
+ "right_item": [right item]
171
+ },
172
+ "... up to 8 total pairs"
173
+ ],
174
+ "card_reference": "heading",
175
+ "concepts": ["Concept1", "Concept2", "..."],
176
+ "facts": ["Fact1", "Fact2", "..."],
177
+ "bloom_level": <1-5>
163
178
  }
179
+
164
180
  • Maximum character length for each item in a pair: 42
181
+
165
182
 
166
183
  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: ""main_heading, where #main_heading is optional.
167
184
  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.
@@ -2,25 +2,39 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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 PDFs, book chapters, videos, and websites. Follow these steps:
6
6
 
7
7
  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.
8
+ 2. Extract key concepts within the content. Be exhaustive and thorough.
9
+ 3. Extract concrete facts that are relevant to the subject and referenced in the content.
10
+ 4. Decide whether the provided text has educational value and should be used to generate test material and quizzes based on the identified concepts and facts.
11
11
  5. If the generate_cards is true then summarize the content using a series of summary cards.
12
12
 
13
13
  Please format your findings in this JSON schema:
14
14
  json
15
15
  {
16
16
  "field": ["primary_field", "secondary_field", "tertiary_field"],
17
- "concepts": ["concept1", "concept2", "concept3", "..."],
18
- "facts": ["fact1", "fact2", "fact3", "..."],
17
+ "concepts":
18
+ [
19
+ {
20
+ "concept_text": "concept_content",
21
+ "reference": "source_title#main_heading"
22
+ },
23
+ {...}
24
+ ],
25
+ "facts":
26
+ [
27
+ {
28
+ "fact_text": "fact_content",
29
+ "reference": "source_title#main_heading"
30
+ },
31
+ {...}
32
+ ],
19
33
  "generate_cards": [
20
34
  state: true or false,
21
- false_reason: "reason for marking the source as false. Leave empty for true."
35
+ reason: "reason for marking the source as false. Leave empty for true."
22
36
  ],
23
- "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
37
+ "summary_cards": ["summary_card1_content", "summary_card2_content", "summary_card3_content", "..."]
24
38
  }
25
39
 
26
40
  Further instruction on how to perform these tasks are below.
@@ -44,52 +58,77 @@ Every source must be placed under a field. This is the broadest category of know
44
58
  16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
45
59
  17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
46
60
  18. Other: Use for content that doesn’t fit into the above categories.
61
+ Extract key concepts within the content after classifying the field. This is a crucial part of the exercise. Be exhaustive and thorough.
47
62
 
48
- 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.
49
-
50
- 1. **Definition of a Concept**: Concepts should be significant ideas that recur within the content and are essential for understanding the main themes.
63
+ 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.
51
64
  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.
65
+ 3. **How to describe a concept**: The concept should be described so that a reader can comprehend the gist of it.
66
+ 4. **Character Limit**: Maintain a limit of 60 characters for the to ensure each concept is concise yet informative.
67
+ 5. **Reference**: Every concept must include a reference. A reference can either be the entire source or a specific heading in the source. The reference indicates the part of the text that is most relevant for that particular concept. 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. If a concept needs to reference multiple sections or the entire source then simply leave the reference as empty.
52
68
 
53
69
  List the concepts in the following JSON format:
70
+
54
71
  json
55
- {
56
- "concepts": ["concept1", "concept2", "concept3", "..."]
57
- }
58
- 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.
72
+ "concepts":
73
+ [
74
+ {
75
+ "concept_text": "concept_content",
76
+ "reference": "source_title#main_heading"
77
+ },
78
+ {...}
79
+ ]
80
+
81
+ After classifying the content and identifying key concepts, proceed to extract and list verifiable facts.
59
82
 
60
83
  1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
61
84
  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.
85
+ 3. **Character Limit**: Maintain a limit of 60 characters for the to ensure each message is concise yet informative.
86
+ 4. **Reference**: Every fact must include a reference. The reference indicates the part of the text that is most relevant for that particular concept. 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. If a fact needs to reference multiple sections or the entire source then simply leave the reference as empty.
62
87
 
63
- Record the facts in the following JSON format:
88
+ List the facts in the following JSON format:
64
89
  json
65
- {
66
- "facts": ["fact1", "fact2", "fact3", "..."]
67
- }
68
- 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. If you decide that testing cards don't need to be generated then please provide a reason in less than 90 characters.
90
+ "facts":
91
+ [
92
+ {
93
+ "fact_text": "fact_content",
94
+ "reference": "source_title#main_heading"
95
+ },
96
+ {...}
97
+ ]
98
+ After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing (quiz) materials.
99
+
100
+ Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals. If you decide that the source does not hold educational value that is worthy of generating testing material or quizzes for then please provide a reason in less than 90 characters.
69
101
 
70
102
  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.
71
103
  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.
72
104
 
73
105
  Make your decision using this criterion and reflect it in the JSON format as follows:
106
+
74
107
  json
75
108
  "generate_cards":
76
109
  { state: true or false,
77
- false_reason: "reason for marking the source as false. Leave empty for true."
110
+ reason: "reason for marking the source as false. Leave empty for true."
78
111
  }
79
112
 
80
- 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.
113
+ After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards.
114
+
115
+ These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
81
116
 
82
117
 
83
118
  1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
84
119
  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.
85
120
  3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
121
+ 4. **Card limit**: Limit the total number of cards to less than or equal to 8.
86
122
  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.
87
123
 
88
124
  Format your output in JSON as follows:
125
+
89
126
  json
90
127
  {
91
- "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
128
+ "summary_cards": ["summary_card1_content", "summary_card2_content", "summary_card3_content", "..."]
92
129
  }
130
+
131
+
93
132
  `;
94
133
  function returnTypologyPrompt() {
95
134
  return typologyPromptString;
package/dist/index.js CHANGED
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.OnlyEverGenerator = void 0;
11
11
  const app_1 = require("./bootstrap/app");
12
12
  Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: function () { return app_1.OnlyEverGenerator; } });
13
- //. All the Codes Below uses express and are strictly for development purpose, while publishing the package, comment everything
14
- //below this line
15
- // let oeGen = new OnlyEverGenerator(config.openAIKey, "gpt-3.5-turbo-1106", {
13
+ // //. All the Codes Below uses express and are strictly for development purpose, while publishing the package, comment everything
14
+ // //below this line
15
+ // let oeGen = new OnlyEverGenerator(config.openAIKey, "gpt-4o", {
16
16
  // prompt: returnPromptData(),
17
17
  // content: returnSourceData(),
18
18
  // });
@@ -28,27 +28,27 @@ Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: fun
28
28
  // // let content = returnSourceData().toString()
29
29
  // // let headings = returnHeadings();
30
30
  // // // let aiRequest = await openAIRequest(prompt,content);
31
- // // let aiRequest = await oeGen.generateCard(prompt,content, false);
32
- // // res.send(aiRequest);
33
- // });
34
- // app.get("/typology", async (req, res) => {
35
- // {
36
- // // let typologyPrompt = returnTypologyPrompt();
37
- // // let cardPrompt = returnCardGenPrompt();
38
- // // let args = new GenerateArgs(
39
- // // true,
40
- // // true,
41
- // // false,
42
- // // {
43
- // // typology_prompt: typologyPrompt,
44
- // // card_gen_prompt: cardPrompt,
45
- // // summary_prompt: "",
46
- // // }
47
- // // )
48
- // let typologyRequest = await oeGen.generate(false, true);
49
- // res.send(typologyRequest);
50
- // }
31
+ // let aiRequest = await oeGen.generate(false,true);
32
+ // res.send(aiRequest);
51
33
  // });
34
+ // // app.get("/typology", async (req, res) => {
35
+ // // {
36
+ // // let typologyPrompt = returnTypologyPrompt();
37
+ // // let cardPrompt = returnCardGenPrompt();
38
+ // // let args = new GenerateArgs(
39
+ // // true,
40
+ // // true,
41
+ // // false,
42
+ // // {
43
+ // // typology_prompt: typologyPrompt,
44
+ // // card_gen_prompt: cardPrompt,
45
+ // // summary_prompt: "",
46
+ // // }
47
+ // // )
48
+ // // let typologyRequest = await oeGen.generate(false, true);
49
+ // // res.send(typologyRequest);
50
+ // // }
51
+ // // });
52
52
  // app.listen(port, () => {
53
53
  // console.log(`Example app listening at http://localhost:${port}`);
54
54
  // });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "only_ever_generator",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "start": "npm run build && nodemon dist/index.js",
@@ -207,21 +207,15 @@ return question;
207
207
 
208
208
  parseMatchCard(cardData: any) {
209
209
  let content = cardData.card_content;
210
- const transformedData: { [key: string]: string[] } = {};
211
210
 
212
- for (let key in content) {
213
- if (content.hasOwnProperty(key)) {
214
- transformedData[key] = [content[key]];
215
- }
216
- }
217
- let displayTitle = this.generateMatchCardDisplayTitle(transformedData);
211
+ let displayTitle = this.generateMatchCardDisplayTitle(content);
218
212
  let matchCard = {
219
213
  type: {
220
214
  category: 'learning',
221
215
  sub_type: cardData.type,
222
216
  },
223
217
  heading: cardData.card_reference,
224
- content: transformedData,
218
+ content: content,
225
219
  // content: cardData.card_content,
226
220
  displayTitle: displayTitle,
227
221
  concepts: cardData.concepts,
@@ -237,16 +231,13 @@ return question;
237
231
  generateMatchCardDisplayTitle(answers: any) {
238
232
  let titles: string[] = [];
239
233
  let counter = 65;
240
- for (let key in answers) {
241
- if (answers.hasOwnProperty(key)) {
242
- let value = answers[key];
243
- // let items = value.split(',').map((item: string) => item.trim());
244
- // items.forEach((item: any) => {
234
+ for (let data of answers) {
235
+
236
+ let value = data.right_item.join(',');
237
+ let left = data.left_item;
245
238
  let letter = String.fromCharCode(counter);
246
- titles.push(`${letter}. ${key} -- ${value}`);
239
+ titles.push(`${letter}. ${data} -- ${value}`);
247
240
  counter++;
248
- // });
249
- }
250
241
  }
251
242
  let displayTitle = titles.join(",");
252
243
  return displayTitle;
@@ -64,12 +64,13 @@ json
64
64
  {
65
65
  "missing_facts": ["fact1", "fact2", "fact3", "..."]
66
66
  }
67
- After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
68
67
 
69
- 1. Clarity: Ensure the test content is clear and unambiguous.
70
- 2. Specificity: Be specific about what you are asking. Avoid vague or overly broad questions or prompts.
71
- 3. Simplicity: Use simple and direct language. Avoid complex sentences or jargon unless testing understanding of that jargon.
72
- 4. Relevance: Ensure the test content is directly related to the key concepts or facts you want to test.
68
+ After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
69
+
70
+ 1. Clarity: Ensure the test content is clear and unambiguous.
71
+ 2. Specificity: Be specific about what you are asking. Avoid vague or overly broad questions or prompts.
72
+ 3. Simplicity: Use simple and direct language. Avoid complex sentences or jargon unless testing understanding of that jargon.
73
+ 4. Relevance: Ensure the test content is directly related to the key concepts or facts you want to test.
73
74
 
74
75
  Include the following property for each card:
75
76
 
@@ -81,37 +82,39 @@ Test cards must be one of the following types:
81
82
 
82
83
  1. Flashcards: Have a front and back.
83
84
 
84
- json
85
+ json:
85
86
  {
86
- "type": "flash",
87
- "card_content": {
88
- "front": "<content for the front>",
89
- "back": "<content for the back>"
90
- },
91
- "card_reference": "heading",
92
- "concepts": ["Concept1", "Concept2", "..."],
93
- "facts": ["Fact1", "Fact2", "..."],
94
- "bloom_level": <1-5>
87
+ "type": "flash",
88
+ "card_content": {
89
+ "front": "<content for the front>",
90
+ "back": "<content for the back>"
91
+ },
92
+ "card_reference": "heading",
93
+ "concepts": ["Concept1", "Concept2", "..."],
94
+ "facts": ["Fact1", "Fact2", "..."],
95
+ "bloom_level": <1-5>
95
96
  }
97
+
96
98
  - Each side must not exceed 300 characters.
97
99
  2. Multiple Choice Questions (MCQ): Provide multiple choices to pick from. One or more should be correct.
98
100
 
99
- json
101
+ json:
100
102
  {
101
- "type": "mcq",
102
- "card_content": {
103
- "prompt": "<question text>",
104
- "choices": [
105
- {"choice": "choice 1", "is_correct": true or false},
106
- {"choice": "choice 2", "is_correct": true or false},
107
- "... up to 8 choices"
108
- ]
109
- },
110
- "card_reference": "heading",
111
- "concepts": ["Concept1", "Concept2", "..."],
112
- "facts": ["Fact1", "Fact2", "..."],
113
- "bloom_level": <1-5>
103
+ "type": "mcq",
104
+ "card_content": {
105
+ "prompt": "<question text>",
106
+ "choices": [
107
+ {"choice": "choice 1", "is_correct": true or false},
108
+ {"choice": "choice 2", "is_correct": true or false},
109
+ "... up to 8 choices"
110
+ ]
111
+ },
112
+ "card_reference": "heading",
113
+ "concepts": ["Concept1", "Concept2", "..."],
114
+ "facts": ["Fact1", "Fact2", "..."],
115
+ "bloom_level": <1-5>
114
116
  }
117
+
115
118
  • Minimum choices required: 2
116
119
  • Maximum choices allowed: 8
117
120
  • Minimum correct choices required: 1
@@ -122,22 +125,23 @@ json
122
125
 
123
126
  json
124
127
  {
125
- "type": "cloze",
126
- "card_content": {
127
- "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
128
- "options": [
129
- {"option": "notes", "cloze": "c0"},
130
- {"option": "scale", "cloze": "c1"},
131
- {"option": "mode", "cloze": "c2"},
132
- {"option": "chords", "cloze": "null"},
133
- "... up to 8 choices"
134
- ]
135
- },
136
- "card_reference": "heading",
137
- "concepts": ["Concept1", "Concept2", "..."],
138
- "facts": ["Fact1", "Fact2", "..."],
139
- "bloom_level": <1-5>
128
+ "type": "cloze",
129
+ "card_content": {
130
+ "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
131
+ "options": [
132
+ {"option": "notes", "cloze": "c0"},
133
+ {"option": "scale", "cloze": "c1"},
134
+ {"option": "mode", "cloze": "c2"},
135
+ {"option": "chords", "cloze": "null"},
136
+ "... up to 8 choices"
137
+ ]
138
+ },
139
+ "card_reference": "heading",
140
+ "concepts": ["Concept1", "Concept2", "..."],
141
+ "facts": ["Fact1", "Fact2", "..."],
142
+ "bloom_level": <1-5>
140
143
  }
144
+
141
145
  • Minimum choices required: 2
142
146
  • Maximum choices allowed: 8
143
147
  • Minimum correct choices required: 1
@@ -145,20 +149,33 @@ json
145
149
  • Maximum character length for an individual cloze: 90
146
150
 
147
151
  4. Match: Pairing items.
152
+
148
153
  json
149
154
  {
150
- "type": "match",
151
- "card_content": {
152
- "right_choice 1": "left_choice 1",
153
- "right_choice 2": "left_choice 2",
154
- "... up to 8 total pairs"
155
- },
156
- "card_reference": "heading",
157
- "concepts": ["Concept1", "Concept2", "..."],
158
- "facts": ["Fact1", "Fact2", "..."],
159
- "bloom_level": <1-5>
155
+ "type": "match",
156
+ "card_content": [
157
+ {
158
+ "left_item": "left choice",
159
+ "right_item": [right item]
160
+ },
161
+ {
162
+ "left_item":" left choice",
163
+ "right_item": [right item]
164
+ },
165
+ {
166
+ "left_item": "left choice",
167
+ "right_item": [right item]
168
+ },
169
+ "... up to 8 total pairs"
170
+ ],
171
+ "card_reference": "heading",
172
+ "concepts": ["Concept1", "Concept2", "..."],
173
+ "facts": ["Fact1", "Fact2", "..."],
174
+ "bloom_level": <1-5>
160
175
  }
176
+
161
177
  • Maximum character length for each item in a pair: 42
178
+
162
179
 
163
180
  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: ""main_heading, where #main_heading is optional.
164
181
  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.
@@ -1,23 +1,37 @@
1
1
  const typologyPromptString = `
2
- 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:
2
+ 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 PDFs, book chapters, videos, and websites. Follow these steps:
3
3
 
4
4
  1. Classify the content into one to three predefined fields of knowledge.
5
- 2. Identify key concepts within the content.
6
- 3. Detect concrete facts that are empirically verified and relevant to the subject.
7
- 4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
5
+ 2. Extract key concepts within the content. Be exhaustive and thorough.
6
+ 3. Extract concrete facts that are relevant to the subject and referenced in the content.
7
+ 4. Decide whether the provided text has educational value and should be used to generate test material and quizzes based on the identified concepts and facts.
8
8
  5. If the generate_cards is true then summarize the content using a series of summary cards.
9
9
 
10
10
  Please format your findings in this JSON schema:
11
11
  json
12
12
  {
13
13
  "field": ["primary_field", "secondary_field", "tertiary_field"],
14
- "concepts": ["concept1", "concept2", "concept3", "..."],
15
- "facts": ["fact1", "fact2", "fact3", "..."],
14
+ "concepts":
15
+ [
16
+ {
17
+ "concept_text": "concept_content",
18
+ "reference": "source_title#main_heading"
19
+ },
20
+ {...}
21
+ ],
22
+ "facts":
23
+ [
24
+ {
25
+ "fact_text": "fact_content",
26
+ "reference": "source_title#main_heading"
27
+ },
28
+ {...}
29
+ ],
16
30
  "generate_cards": [
17
31
  state: true or false,
18
- false_reason: "reason for marking the source as false. Leave empty for true."
32
+ reason: "reason for marking the source as false. Leave empty for true."
19
33
  ],
20
- "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
34
+ "summary_cards": ["summary_card1_content", "summary_card2_content", "summary_card3_content", "..."]
21
35
  }
22
36
 
23
37
  Further instruction on how to perform these tasks are below.
@@ -41,52 +55,77 @@ Every source must be placed under a field. This is the broadest category of know
41
55
  16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
42
56
  17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
43
57
  18. Other: Use for content that doesn’t fit into the above categories.
58
+ Extract key concepts within the content after classifying the field. This is a crucial part of the exercise. Be exhaustive and thorough.
44
59
 
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.
60
+ 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.
48
61
  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.
62
+ 3. **How to describe a concept**: The concept should be described so that a reader can comprehend the gist of it.
63
+ 4. **Character Limit**: Maintain a limit of 60 characters for the to ensure each concept is concise yet informative.
64
+ 5. **Reference**: Every concept must include a reference. A reference can either be the entire source or a specific heading in the source. The reference indicates the part of the text that is most relevant for that particular concept. 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. If a concept needs to reference multiple sections or the entire source then simply leave the reference as empty.
49
65
 
50
66
  List the concepts in the following JSON format:
67
+
51
68
  json
52
- {
53
- "concepts": ["concept1", "concept2", "concept3", "..."]
54
- }
55
- 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.
69
+ "concepts":
70
+ [
71
+ {
72
+ "concept_text": "concept_content",
73
+ "reference": "source_title#main_heading"
74
+ },
75
+ {...}
76
+ ]
77
+
78
+ After classifying the content and identifying key concepts, proceed to extract and list verifiable facts.
56
79
 
57
80
  1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
58
81
  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.
82
+ 3. **Character Limit**: Maintain a limit of 60 characters for the to ensure each message is concise yet informative.
83
+ 4. **Reference**: Every fact must include a reference. The reference indicates the part of the text that is most relevant for that particular concept. 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. If a fact needs to reference multiple sections or the entire source then simply leave the reference as empty.
59
84
 
60
- Record the facts in the following JSON format:
85
+ List the facts in the following JSON format:
61
86
  json
62
- {
63
- "facts": ["fact1", "fact2", "fact3", "..."]
64
- }
65
- 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. If you decide that testing cards don't need to be generated then please provide a reason in less than 90 characters.
87
+ "facts":
88
+ [
89
+ {
90
+ "fact_text": "fact_content",
91
+ "reference": "source_title#main_heading"
92
+ },
93
+ {...}
94
+ ]
95
+ After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing (quiz) materials.
96
+
97
+ Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals. If you decide that the source does not hold educational value that is worthy of generating testing material or quizzes for then please provide a reason in less than 90 characters.
66
98
 
67
99
  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.
68
100
  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.
69
101
 
70
102
  Make your decision using this criterion and reflect it in the JSON format as follows:
103
+
71
104
  json
72
105
  "generate_cards":
73
106
  { state: true or false,
74
- false_reason: "reason for marking the source as false. Leave empty for true."
107
+ reason: "reason for marking the source as false. Leave empty for true."
75
108
  }
76
109
 
77
- 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.
110
+ After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards.
111
+
112
+ These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
78
113
 
79
114
 
80
115
  1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
81
116
  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.
82
117
  3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
118
+ 4. **Card limit**: Limit the total number of cards to less than or equal to 8.
83
119
  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.
84
120
 
85
121
  Format your output in JSON as follows:
122
+
86
123
  json
87
124
  {
88
- "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
125
+ "summary_cards": ["summary_card1_content", "summary_card2_content", "summary_card3_content", "..."]
89
126
  }
127
+
128
+
90
129
  `;
91
130
 
92
131
 
package/src/index.ts CHANGED
@@ -13,9 +13,9 @@ import { OnlyEverGenerator } from "./bootstrap/app";
13
13
  /// uncomment the below line and comment all the others, expect the import of OnlyEverGenerator
14
14
  export {OnlyEverGenerator};
15
15
 
16
- //. All the Codes Below uses express and are strictly for development purpose, while publishing the package, comment everything
17
- //below this line
18
- // let oeGen = new OnlyEverGenerator(config.openAIKey, "gpt-3.5-turbo-1106", {
16
+ // //. All the Codes Below uses express and are strictly for development purpose, while publishing the package, comment everything
17
+ // //below this line
18
+ // let oeGen = new OnlyEverGenerator(config.openAIKey, "gpt-4o", {
19
19
  // prompt: returnPromptData(),
20
20
  // content: returnSourceData(),
21
21
  // });
@@ -33,28 +33,28 @@ import { OnlyEverGenerator } from "./bootstrap/app";
33
33
  // // let content = returnSourceData().toString()
34
34
  // // let headings = returnHeadings();
35
35
  // // // let aiRequest = await openAIRequest(prompt,content);
36
- // // let aiRequest = await oeGen.generateCard(prompt,content, false);
37
- // // res.send(aiRequest);
36
+ // let aiRequest = await oeGen.generate(false,true);
37
+ // res.send(aiRequest);
38
38
  // });
39
39
 
40
- // app.get("/typology", async (req, res) => {
41
- // {
42
- // // let typologyPrompt = returnTypologyPrompt();
43
- // // let cardPrompt = returnCardGenPrompt();
44
- // // let args = new GenerateArgs(
45
- // // true,
46
- // // true,
47
- // // false,
48
- // // {
49
- // // typology_prompt: typologyPrompt,
50
- // // card_gen_prompt: cardPrompt,
51
- // // summary_prompt: "",
52
- // // }
53
- // // )
54
- // let typologyRequest = await oeGen.generate(false, true);
55
- // res.send(typologyRequest);
56
- // }
57
- // });
40
+ // // app.get("/typology", async (req, res) => {
41
+ // // {
42
+ // // let typologyPrompt = returnTypologyPrompt();
43
+ // // let cardPrompt = returnCardGenPrompt();
44
+ // // let args = new GenerateArgs(
45
+ // // true,
46
+ // // true,
47
+ // // false,
48
+ // // {
49
+ // // typology_prompt: typologyPrompt,
50
+ // // card_gen_prompt: cardPrompt,
51
+ // // summary_prompt: "",
52
+ // // }
53
+ // // )
54
+ // // let typologyRequest = await oeGen.generate(false, true);
55
+ // // res.send(typologyRequest);
56
+ // // }
57
+ // // });
58
58
 
59
59
  // app.listen(port, () => {
60
60
  // console.log(`Example app listening at http://localhost:${port}`);