only_ever_generator 0.2.6 → 0.2.8
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.
- package/dist/bootstrap/app.js +47 -44
- package/dist/card_gen/generate_cards.js +47 -32
- package/dist/constants/prompt_data.js +273 -273
- package/dist/constants/prompts/card_gen_prompt.js +180 -180
- package/dist/constants/prompts/typology_prompt.js +93 -93
- package/dist/logger.js +41 -0
- package/dist/parse/parse_source_content.js +23 -9
- package/dist/typology_gen/generate_typology.js +21 -12
- package/dist/utils/generate_args.js +1 -11
- package/package.json +33 -33
- package/readme.md +23 -23
- package/src/bootstrap/app.ts +150 -141
- package/src/card_gen/generate_cards.ts +251 -239
- package/src/config.ts +6 -6
- package/src/constants/api_constants.ts +2 -2
- package/src/constants/prompt_data.ts +296 -296
- package/src/constants/prompts/card_gen_prompt.ts +372 -372
- package/src/constants/prompts/typology_prompt.ts +202 -202
- package/src/constants/source_data.ts +47 -47
- package/src/gap_fill/calculate_gap_fill.ts +52 -52
- package/src/index.ts +61 -61
- package/src/logger.ts +31 -0
- package/src/parse/parse_card_response.ts +289 -289
- package/src/parse/parse_source_content.ts +94 -81
- package/src/parse/response_format_card.ts +210 -210
- package/src/parse/response_format_typology.ts +43 -43
- package/src/services/open_ai_service.ts +55 -54
- package/src/typology_gen/generate_typology.ts +71 -64
- package/src/utils/generate_args.ts +28 -37
- package/src/utils/parse_openai_response.ts +20 -20
- package/tsconfig.json +12 -12
- package/dist/class/parse/parse_source_content.js +0 -62
- package/dist/class/services/open_ai_service.js +0 -25
- package/dist/parse_response/parse_card_response.js +0 -288
- package/dist/parse_response/response_format_card.js +0 -210
- package/dist/parse_response/response_format_typology.js +0 -47
- package/dist/service/open_ai_request.js +0 -57
|
@@ -1,203 +1,203 @@
|
|
|
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:
|
|
3
|
-
|
|
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.
|
|
8
|
-
// 5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
9
|
-
|
|
10
|
-
// Please format your findings in this JSON schema:
|
|
11
|
-
// json
|
|
12
|
-
// {
|
|
13
|
-
// "field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
14
|
-
// "concepts": ["concept1", "concept2", "concept3", "..."],
|
|
15
|
-
// "facts": ["fact1", "fact2", "fact3", "..."],
|
|
16
|
-
// "generate_cards": [
|
|
17
|
-
// state: true or false,
|
|
18
|
-
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
19
|
-
// ],
|
|
20
|
-
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
21
|
-
// }
|
|
22
|
-
|
|
23
|
-
// Further instruction on how to perform these tasks are below.
|
|
24
|
-
// Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
25
|
-
|
|
26
|
-
// 1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
27
|
-
// 2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
28
|
-
// 3. Humanities & Cultural Studies: Highlight History, Literature, Languages, Arts, Philosophy, and Anthropological Studies.
|
|
29
|
-
// 4. Social Sciences & Global Studies: Include Sociology, Psychology, Economics, Political Science, Anthropology, and International Relations.
|
|
30
|
-
// 5. Business & Management: Encompass Entrepreneurship, Marketing, Finance, Leadership, and Ethics.
|
|
31
|
-
// 6. Health & Medicine: Cover Medical Sciences, Public Health, Nutrition, Wellness, and Mental Health.
|
|
32
|
-
// 7. Environmental Studies & Earth Sciences: Discuss Ecology, Climate Science, Geology, and Environmental Policy.
|
|
33
|
-
// 8. Education, Learning & Personal Development: Talk about Educational Theories, Teaching Methods, and Personal Skills.
|
|
34
|
-
// 9. Creative & Performing Arts: Include Visual Arts, Music, Theater, Dance, and Design Principles.
|
|
35
|
-
// 10. Law, Governance & Ethics: Focus on Legal Studies, Public Administration, Policy Analysis, and Ethical Decision-Making.
|
|
36
|
-
// 11. Recreation, Lifestyle & Practical Skills: Highlight Hobbies, Sports, Travel, Lifestyle Choices, and Practical Skills.
|
|
37
|
-
// 12. Technology & Media Literacy: Discuss Digital Literacy, Media Studies, and the Impact of Digital Media.
|
|
38
|
-
// 13. Philosophy & Critical Thinking: Emphasize Moral Philosophy, Ethical Frameworks, and Critical Thinking.
|
|
39
|
-
// 14. Space & Astronomical Sciences: Focus on Space Exploration, Astronomy, and Astrophysics.
|
|
40
|
-
// 15. Agriculture & Food Sciences: Discuss Sustainable Farming, Food Technology, and Nutrition.
|
|
41
|
-
// 16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
42
|
-
// 17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
43
|
-
// 18. Other: Use for content that doesn’t fit into the above categories.
|
|
44
|
-
|
|
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.
|
|
49
|
-
|
|
50
|
-
// List the concepts in the following JSON format:
|
|
51
|
-
// 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.
|
|
56
|
-
|
|
57
|
-
// 1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
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.
|
|
59
|
-
|
|
60
|
-
// Record the facts in the following JSON format:
|
|
61
|
-
// 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.
|
|
66
|
-
|
|
67
|
-
// 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
|
-
// 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
|
-
|
|
70
|
-
// Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
71
|
-
// json
|
|
72
|
-
// "generate_cards":
|
|
73
|
-
// { state: true or false,
|
|
74
|
-
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
75
|
-
// }
|
|
76
|
-
|
|
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.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// 1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
81
|
-
// 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
|
-
// 3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
83
|
-
// 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
|
-
|
|
85
|
-
// Format your output in JSON as follows:
|
|
86
|
-
// json
|
|
87
|
-
// {
|
|
88
|
-
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
89
|
-
// }
|
|
90
|
-
// `;
|
|
91
|
-
|
|
92
|
-
const typologyPromptString : any = {
|
|
93
|
-
role: `
|
|
94
|
-
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:
|
|
95
|
-
|
|
96
|
-
1. Classify the content into one to three predefined fields of knowledge.
|
|
97
|
-
2. Extract key concepts within the content.
|
|
98
|
-
3. Extract concrete facts that are relevant to the subject and referenced in the content.
|
|
99
|
-
4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
|
|
100
|
-
5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
101
|
-
|
|
102
|
-
Please format your findings in this JSON schema:
|
|
103
|
-
{
|
|
104
|
-
"field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
105
|
-
"concepts": ["concept1", "concept2", "concept3", "..."],
|
|
106
|
-
"facts": ["fact1", "fact2", "fact3", "..."],
|
|
107
|
-
"generate_cards": {
|
|
108
|
-
"state": true or false,
|
|
109
|
-
"false_reason": "reason for marking the source as false. Leave empty for true."
|
|
110
|
-
},
|
|
111
|
-
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Further instruction on how to perform these tasks are below.
|
|
116
|
-
`,
|
|
117
|
-
fields: `
|
|
118
|
-
Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
119
|
-
|
|
120
|
-
1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
121
|
-
2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
122
|
-
3. Humanities & Cultural Studies: Highlight History, Literature, Languages, Arts, Philosophy, and Anthropological Studies.
|
|
123
|
-
4. Social Sciences & Global Studies: Include Sociology, Psychology, Economics, Political Science, Anthropology, and International Relations.
|
|
124
|
-
5. Business & Management: Encompass Entrepreneurship, Marketing, Finance, Leadership, and Ethics.
|
|
125
|
-
6. Health & Medicine: Cover Medical Sciences, Public Health, Nutrition, Wellness, and Mental Health.
|
|
126
|
-
7. Environmental Studies & Earth Sciences: Discuss Ecology, Climate Science, Geology, and Environmental Policy.
|
|
127
|
-
8. Education, Learning & Personal Development: Talk about Educational Theories, Teaching Methods, and Personal Skills.
|
|
128
|
-
9. Creative & Performing Arts: Include Visual Arts, Music, Theater, Dance, and Design Principles.
|
|
129
|
-
10. Law, Governance & Ethics: Focus on Legal Studies, Public Administration, Policy Analysis, and Ethical Decision-Making.
|
|
130
|
-
11. Recreation, Lifestyle & Practical Skills: Highlight Hobbies, Sports, Travel, Lifestyle Choices, and Practical Skills.
|
|
131
|
-
12. Technology & Media Literacy: Discuss Digital Literacy, Media Studies, and the Impact of Digital Media.
|
|
132
|
-
13. Philosophy & Critical Thinking: Emphasize Moral Philosophy, Ethical Frameworks, and Critical Thinking.
|
|
133
|
-
14. Space & Astronomical Sciences: Focus on Space Exploration, Astronomy, and Astrophysics.
|
|
134
|
-
15. Agriculture & Food Sciences: Discuss Sustainable Farming, Food Technology, and Nutrition.
|
|
135
|
-
16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
136
|
-
17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
137
|
-
18. Other: Use for content that doesn’t fit into the above categories.
|
|
138
|
-
`,
|
|
139
|
-
concepts: `
|
|
140
|
-
Extract key concepts within the content after classifying the field. Please be as exhaustive as possible.
|
|
141
|
-
|
|
142
|
-
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.
|
|
143
|
-
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.
|
|
144
|
-
List the concepts in the following JSON format:
|
|
145
|
-
|
|
146
|
-
{
|
|
147
|
-
"concepts":
|
|
148
|
-
[
|
|
149
|
-
"concept1",
|
|
150
|
-
"concept2",
|
|
151
|
-
"concept3",
|
|
152
|
-
"..."
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
`,
|
|
156
|
-
facts: `
|
|
157
|
-
After classifying the content and identifying key concepts, proceed to extract and list verifiable facts.
|
|
158
|
-
|
|
159
|
-
Definition of a Fact: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
160
|
-
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.
|
|
161
|
-
Record the facts in the following JSON format:
|
|
162
|
-
|
|
163
|
-
{
|
|
164
|
-
"facts": ["fact1", "fact2", "fact3", "..."]
|
|
165
|
-
}
|
|
166
|
-
`,
|
|
167
|
-
generate: `
|
|
168
|
-
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.
|
|
169
|
-
|
|
170
|
-
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.
|
|
171
|
-
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.
|
|
172
|
-
Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
173
|
-
|
|
174
|
-
"generate_cards":
|
|
175
|
-
{ state: true or false,
|
|
176
|
-
false_reason: "reason for marking the source as false. Leave empty for true."
|
|
177
|
-
}
|
|
178
|
-
`,
|
|
179
|
-
summarize:`
|
|
180
|
-
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.
|
|
181
|
-
|
|
182
|
-
Inclusion Criteria: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
183
|
-
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.
|
|
184
|
-
Character Limit: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
185
|
-
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.
|
|
186
|
-
Format your output in JSON as follows:
|
|
187
|
-
|
|
188
|
-
{
|
|
189
|
-
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
190
|
-
}
|
|
191
|
-
`,
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export function returnTypologyPrompt(typologyPrompt: any){
|
|
196
|
-
let concatenatedString: string = '';
|
|
197
|
-
for (let key in typologyPrompt) {
|
|
198
|
-
if (typologyPrompt.hasOwnProperty(key)) {
|
|
199
|
-
concatenatedString += typologyPrompt[key];
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return concatenatedString;
|
|
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:
|
|
3
|
+
|
|
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.
|
|
8
|
+
// 5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
9
|
+
|
|
10
|
+
// Please format your findings in this JSON schema:
|
|
11
|
+
// json
|
|
12
|
+
// {
|
|
13
|
+
// "field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
14
|
+
// "concepts": ["concept1", "concept2", "concept3", "..."],
|
|
15
|
+
// "facts": ["fact1", "fact2", "fact3", "..."],
|
|
16
|
+
// "generate_cards": [
|
|
17
|
+
// state: true or false,
|
|
18
|
+
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
19
|
+
// ],
|
|
20
|
+
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
21
|
+
// }
|
|
22
|
+
|
|
23
|
+
// Further instruction on how to perform these tasks are below.
|
|
24
|
+
// Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
25
|
+
|
|
26
|
+
// 1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
27
|
+
// 2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
28
|
+
// 3. Humanities & Cultural Studies: Highlight History, Literature, Languages, Arts, Philosophy, and Anthropological Studies.
|
|
29
|
+
// 4. Social Sciences & Global Studies: Include Sociology, Psychology, Economics, Political Science, Anthropology, and International Relations.
|
|
30
|
+
// 5. Business & Management: Encompass Entrepreneurship, Marketing, Finance, Leadership, and Ethics.
|
|
31
|
+
// 6. Health & Medicine: Cover Medical Sciences, Public Health, Nutrition, Wellness, and Mental Health.
|
|
32
|
+
// 7. Environmental Studies & Earth Sciences: Discuss Ecology, Climate Science, Geology, and Environmental Policy.
|
|
33
|
+
// 8. Education, Learning & Personal Development: Talk about Educational Theories, Teaching Methods, and Personal Skills.
|
|
34
|
+
// 9. Creative & Performing Arts: Include Visual Arts, Music, Theater, Dance, and Design Principles.
|
|
35
|
+
// 10. Law, Governance & Ethics: Focus on Legal Studies, Public Administration, Policy Analysis, and Ethical Decision-Making.
|
|
36
|
+
// 11. Recreation, Lifestyle & Practical Skills: Highlight Hobbies, Sports, Travel, Lifestyle Choices, and Practical Skills.
|
|
37
|
+
// 12. Technology & Media Literacy: Discuss Digital Literacy, Media Studies, and the Impact of Digital Media.
|
|
38
|
+
// 13. Philosophy & Critical Thinking: Emphasize Moral Philosophy, Ethical Frameworks, and Critical Thinking.
|
|
39
|
+
// 14. Space & Astronomical Sciences: Focus on Space Exploration, Astronomy, and Astrophysics.
|
|
40
|
+
// 15. Agriculture & Food Sciences: Discuss Sustainable Farming, Food Technology, and Nutrition.
|
|
41
|
+
// 16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
42
|
+
// 17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
43
|
+
// 18. Other: Use for content that doesn’t fit into the above categories.
|
|
44
|
+
|
|
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.
|
|
49
|
+
|
|
50
|
+
// List the concepts in the following JSON format:
|
|
51
|
+
// 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.
|
|
56
|
+
|
|
57
|
+
// 1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
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.
|
|
59
|
+
|
|
60
|
+
// Record the facts in the following JSON format:
|
|
61
|
+
// 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.
|
|
66
|
+
|
|
67
|
+
// 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
|
+
// 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
|
+
|
|
70
|
+
// Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
71
|
+
// json
|
|
72
|
+
// "generate_cards":
|
|
73
|
+
// { state: true or false,
|
|
74
|
+
// false_reason: "reason for marking the source as false. Leave empty for true."
|
|
75
|
+
// }
|
|
76
|
+
|
|
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.
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// 1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
81
|
+
// 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
|
+
// 3. **Character Limit**: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
83
|
+
// 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
|
+
|
|
85
|
+
// Format your output in JSON as follows:
|
|
86
|
+
// json
|
|
87
|
+
// {
|
|
88
|
+
// "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
89
|
+
// }
|
|
90
|
+
// `;
|
|
91
|
+
|
|
92
|
+
const typologyPromptString : any = {
|
|
93
|
+
role: `
|
|
94
|
+
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:
|
|
95
|
+
|
|
96
|
+
1. Classify the content into one to three predefined fields of knowledge.
|
|
97
|
+
2. Extract key concepts within the content.
|
|
98
|
+
3. Extract concrete facts that are relevant to the subject and referenced in the content.
|
|
99
|
+
4. Decide whether the identified concepts and facts should be used to generate learning materials like flashcards based on their educational value.
|
|
100
|
+
5. If the generate_cards is true then summarize the content using a series of summary cards.
|
|
101
|
+
|
|
102
|
+
Please format your findings in this JSON schema:
|
|
103
|
+
{
|
|
104
|
+
"field": ["primary_field", "secondary_field", "tertiary_field"],
|
|
105
|
+
"concepts": ["concept1", "concept2", "concept3", "..."],
|
|
106
|
+
"facts": ["fact1", "fact2", "fact3", "..."],
|
|
107
|
+
"generate_cards": {
|
|
108
|
+
"state": true or false,
|
|
109
|
+
"false_reason": "reason for marking the source as false. Leave empty for true."
|
|
110
|
+
},
|
|
111
|
+
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
Further instruction on how to perform these tasks are below.
|
|
116
|
+
`,
|
|
117
|
+
fields: `
|
|
118
|
+
Every source must be placed under a field. This is the broadest category of knowledge. A source should belong to at least one and at most 3 fields. Only include fields that a source is strongly associated with. The field names in your response must exactly match the names of 18 fields listed below.
|
|
119
|
+
|
|
120
|
+
1. Sciences: Focus on Biology, Chemistry, Physics, Astronomy, Mathematics, and Computer Science.
|
|
121
|
+
2. Technology & Engineering: Emphasize Information Technology, Engineering disciplines, AI, and Robotics.
|
|
122
|
+
3. Humanities & Cultural Studies: Highlight History, Literature, Languages, Arts, Philosophy, and Anthropological Studies.
|
|
123
|
+
4. Social Sciences & Global Studies: Include Sociology, Psychology, Economics, Political Science, Anthropology, and International Relations.
|
|
124
|
+
5. Business & Management: Encompass Entrepreneurship, Marketing, Finance, Leadership, and Ethics.
|
|
125
|
+
6. Health & Medicine: Cover Medical Sciences, Public Health, Nutrition, Wellness, and Mental Health.
|
|
126
|
+
7. Environmental Studies & Earth Sciences: Discuss Ecology, Climate Science, Geology, and Environmental Policy.
|
|
127
|
+
8. Education, Learning & Personal Development: Talk about Educational Theories, Teaching Methods, and Personal Skills.
|
|
128
|
+
9. Creative & Performing Arts: Include Visual Arts, Music, Theater, Dance, and Design Principles.
|
|
129
|
+
10. Law, Governance & Ethics: Focus on Legal Studies, Public Administration, Policy Analysis, and Ethical Decision-Making.
|
|
130
|
+
11. Recreation, Lifestyle & Practical Skills: Highlight Hobbies, Sports, Travel, Lifestyle Choices, and Practical Skills.
|
|
131
|
+
12. Technology & Media Literacy: Discuss Digital Literacy, Media Studies, and the Impact of Digital Media.
|
|
132
|
+
13. Philosophy & Critical Thinking: Emphasize Moral Philosophy, Ethical Frameworks, and Critical Thinking.
|
|
133
|
+
14. Space & Astronomical Sciences: Focus on Space Exploration, Astronomy, and Astrophysics.
|
|
134
|
+
15. Agriculture & Food Sciences: Discuss Sustainable Farming, Food Technology, and Nutrition.
|
|
135
|
+
16. Trades & Craftsmanship: Cover Hands-on Skills in Trades and Crafts.
|
|
136
|
+
17. Reference & Indexing: Include Summaries, Timelines, Directories, Glossaries, Bibliographies, and other Reference Material.
|
|
137
|
+
18. Other: Use for content that doesn’t fit into the above categories.
|
|
138
|
+
`,
|
|
139
|
+
concepts: `
|
|
140
|
+
Extract key concepts within the content after classifying the field. Please be as exhaustive as possible.
|
|
141
|
+
|
|
142
|
+
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.
|
|
143
|
+
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.
|
|
144
|
+
List the concepts in the following JSON format:
|
|
145
|
+
|
|
146
|
+
{
|
|
147
|
+
"concepts":
|
|
148
|
+
[
|
|
149
|
+
"concept1",
|
|
150
|
+
"concept2",
|
|
151
|
+
"concept3",
|
|
152
|
+
"..."
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
`,
|
|
156
|
+
facts: `
|
|
157
|
+
After classifying the content and identifying key concepts, proceed to extract and list verifiable facts.
|
|
158
|
+
|
|
159
|
+
Definition of a Fact: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
|
|
160
|
+
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.
|
|
161
|
+
Record the facts in the following JSON format:
|
|
162
|
+
|
|
163
|
+
{
|
|
164
|
+
"facts": ["fact1", "fact2", "fact3", "..."]
|
|
165
|
+
}
|
|
166
|
+
`,
|
|
167
|
+
generate: `
|
|
168
|
+
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.
|
|
169
|
+
|
|
170
|
+
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.
|
|
171
|
+
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.
|
|
172
|
+
Make your decision using this criterion and reflect it in the JSON format as follows:
|
|
173
|
+
|
|
174
|
+
"generate_cards":
|
|
175
|
+
{ state: true or false,
|
|
176
|
+
false_reason: "reason for marking the source as false. Leave empty for true."
|
|
177
|
+
}
|
|
178
|
+
`,
|
|
179
|
+
summarize:`
|
|
180
|
+
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.
|
|
181
|
+
|
|
182
|
+
Inclusion Criteria: The generate_cards should be true. Return an empty array if the generate_cards is false.
|
|
183
|
+
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.
|
|
184
|
+
Character Limit: Maintain a limit of 320 characters per card to ensure each message is concise yet informative.
|
|
185
|
+
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.
|
|
186
|
+
Format your output in JSON as follows:
|
|
187
|
+
|
|
188
|
+
{
|
|
189
|
+
"summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
|
|
190
|
+
}
|
|
191
|
+
`,
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function returnTypologyPrompt(typologyPrompt: any){
|
|
196
|
+
let concatenatedString: string = '';
|
|
197
|
+
for (let key in typologyPrompt) {
|
|
198
|
+
if (typologyPrompt.hasOwnProperty(key)) {
|
|
199
|
+
concatenatedString += typologyPrompt[key];
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return concatenatedString;
|
|
203
203
|
}
|