only_ever_generator 1.0.7 → 1.0.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.
Files changed (103) hide show
  1. package/dist/bootstrap/app.d.ts +12 -5
  2. package/dist/bootstrap/app.d.ts.map +1 -1
  3. package/dist/bootstrap/app.js +41 -15
  4. package/dist/bootstrap/app.js.map +1 -1
  5. package/dist/card_gen/generate_cards.d.ts +2 -1
  6. package/dist/card_gen/generate_cards.d.ts.map +1 -1
  7. package/dist/card_gen/generate_cards.js +21 -4
  8. package/dist/card_gen/generate_cards.js.map +1 -1
  9. package/dist/constants/prompt_data.d.ts +0 -1
  10. package/dist/constants/prompts/card_gen_prompt.js.map +1 -1
  11. package/dist/constants/source_data.d.ts +0 -2
  12. package/dist/constants/source_data.js +1 -1
  13. package/dist/constants/source_data.js.map +1 -1
  14. package/dist/embedding_generation/consolidation/global_consolidation.d.ts +1 -1
  15. package/dist/embedding_generation/consolidation/global_consolidation.d.ts.map +1 -1
  16. package/dist/embedding_generation/consolidation/global_consolidation.js +1 -1
  17. package/dist/embedding_generation/consolidation/global_consolidation.js.map +1 -1
  18. package/dist/embedding_generation/local_consolidation.js +104 -0
  19. package/dist/enums/card_type_enum.d.ts +7 -0
  20. package/dist/enums/card_type_enum.d.ts.map +1 -0
  21. package/dist/enums/card_type_enum.js +11 -0
  22. package/dist/enums/card_type_enum.js.map +1 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +0 -91
  25. package/dist/index.js.map +1 -1
  26. package/dist/parse/parse_card/parse_cloze_card.d.ts +8 -1
  27. package/dist/parse/parse_card/parse_cloze_card.d.ts.map +1 -1
  28. package/dist/parse/parse_card/parse_cloze_card.js +2 -2
  29. package/dist/parse/parse_card/parse_cloze_card.js.map +1 -1
  30. package/dist/parse/parse_card/parse_flash_cards.d.ts +14 -7
  31. package/dist/parse/parse_card/parse_flash_cards.d.ts.map +1 -1
  32. package/dist/parse/parse_card/parse_flash_cards.js +3 -3
  33. package/dist/parse/parse_card/parse_flash_cards.js.map +1 -1
  34. package/dist/parse/parse_card/parse_match_card.d.ts +8 -1
  35. package/dist/parse/parse_card/parse_match_card.d.ts.map +1 -1
  36. package/dist/parse/parse_card/parse_match_card.js +2 -3
  37. package/dist/parse/parse_card/parse_match_card.js.map +1 -1
  38. package/dist/parse/parse_card/parse_mcq_card.d.ts +15 -8
  39. package/dist/parse/parse_card/parse_mcq_card.d.ts.map +1 -1
  40. package/dist/parse/parse_card/parse_mcq_card.js +2 -2
  41. package/dist/parse/parse_card/parse_mcq_card.js.map +1 -1
  42. package/dist/parse/parse_card_response.d.ts +12 -10
  43. package/dist/parse/parse_card_response.d.ts.map +1 -1
  44. package/dist/parse/parse_card_response.js +121 -54
  45. package/dist/parse/parse_card_response.js.map +1 -1
  46. package/dist/parse/parse_source_content.d.ts +7 -5
  47. package/dist/parse/parse_source_content.d.ts.map +1 -1
  48. package/dist/parse/parse_source_content.js +1 -0
  49. package/dist/parse/parse_source_content.js.map +1 -1
  50. package/dist/parse/response_format_card.d.ts +0 -1
  51. package/dist/parse/response_format_typology.d.ts +0 -1
  52. package/dist/types/base_param_type.d.ts +17 -0
  53. package/dist/types/base_param_type.d.ts.map +1 -0
  54. package/dist/types/base_param_type.js +3 -0
  55. package/dist/types/base_param_type.js.map +1 -0
  56. package/dist/types/mongo_concept_fact_type.d.ts +12 -0
  57. package/dist/types/mongo_concept_fact_type.d.ts.map +1 -0
  58. package/dist/types/mongo_concept_fact_type.js +3 -0
  59. package/dist/types/mongo_concept_fact_type.js.map +1 -0
  60. package/dist/types/parsed_card_type.d.ts +12 -0
  61. package/dist/types/parsed_card_type.d.ts.map +1 -0
  62. package/dist/types/parsed_card_type.js +30 -0
  63. package/dist/types/parsed_card_type.js.map +1 -0
  64. package/dist/types/raw_card_response_types/generated_card_response_type.d.ts +40 -0
  65. package/dist/types/raw_card_response_types/generated_card_response_type.d.ts.map +1 -0
  66. package/dist/types/raw_card_response_types/generated_card_response_type.js +8 -0
  67. package/dist/types/raw_card_response_types/generated_card_response_type.js.map +1 -0
  68. package/dist/types/source_taxonomy_type.d.ts +15 -0
  69. package/dist/types/source_taxonomy_type.d.ts.map +1 -0
  70. package/dist/types/source_taxonomy_type.js +3 -0
  71. package/dist/types/source_taxonomy_type.js.map +1 -0
  72. package/dist/typology_gen/generate_typology.d.ts.map +1 -1
  73. package/dist/typology_gen/generate_typology.js.map +1 -1
  74. package/package.json +10 -9
  75. package/src/bootstrap/app.ts +63 -22
  76. package/src/card_gen/generate_cards.ts +27 -5
  77. package/src/constants/prompts/card_gen_prompt.ts +1 -1
  78. package/src/embedding_generation/consolidation/global_consolidation.ts +2 -2
  79. package/src/enums/card_type_enum.ts +6 -0
  80. package/src/index.ts +4 -110
  81. package/src/parse/parse_card/parse_cloze_card.ts +11 -3
  82. package/src/parse/parse_card/parse_flash_cards.ts +12 -4
  83. package/src/parse/parse_card/parse_match_card.ts +10 -4
  84. package/src/parse/parse_card/parse_mcq_card.ts +11 -3
  85. package/src/parse/parse_card_response.ts +94 -20
  86. package/src/parse/parse_source_content.ts +11 -1
  87. package/src/types/base_param_type.ts +17 -0
  88. package/src/types/mongo_concept_fact_type.ts +12 -0
  89. package/src/types/parsed_card_type.ts +39 -0
  90. package/src/types/raw_card_response_types/generated_card_response_type.ts +61 -0
  91. package/src/types/source_taxonomy_type.ts +17 -0
  92. package/src/typology_gen/generate_typology.ts +1 -2
  93. package/.env.example +0 -1
  94. package/dist/constants/prompt_data.d.ts.map +0 -1
  95. package/dist/constants/source_data.d.ts.map +0 -1
  96. package/dist/parse/response_format_card.d.ts.map +0 -1
  97. package/dist/parse/response_format_typology.d.ts.map +0 -1
  98. package/prompts.json +0 -23
  99. package/readme.md +0 -35
  100. package/src/constants/prompt_data.ts +0 -301
  101. package/src/constants/source_data.ts +0 -1036
  102. package/src/parse/response_format_card.ts +0 -386
  103. package/src/parse/response_format_typology.ts +0 -44
@@ -1,386 +0,0 @@
1
- const responseData = {
2
- flash_cards: [
3
- {
4
- question: "What is the primary function of the 'Electrolysis'?",
5
- answer:
6
- "Electrolysis is the passing of a direct electric current through an electrolyte producing chemical reactions at the electrodes and decomposition of the materials.",
7
- heading: "Overview",
8
- },
9
- {
10
- question:
11
- "What did Michael Faraday discover while studying the process of electrolysis under Humphry Davy?",
12
- answer: "Michael Faraday discovered two laws of electrolysis.",
13
- heading: "History",
14
- },
15
- {
16
- question:
17
- "What can electrolysis be used for in the manufacturing sector?",
18
- answer:
19
- "Electrolysis can be used for electroplating and electrochemical machining.",
20
- heading: "Manufacturing processes",
21
- },
22
- {
23
- question:
24
- "In the context of electrolysis, what does the term 'Decomposition potential' refer to?",
25
- answer:
26
- "Decomposition potential or decomposition voltage refers to the minimum voltage between anode and cathode of an electrolytic cell needed for electrolysis to occur.",
27
- heading: "Decomposition potential",
28
- },
29
- ],
30
- mcqs: [
31
- {
32
- question: "What is the primary purpose of 'Electrometallurgy'?",
33
- answers: [
34
- {
35
- answer: "Production of aluminium",
36
- is_correct: true,
37
- },
38
- {
39
- answer: "Chlorine production",
40
- is_correct: false,
41
- },
42
- {
43
- answer: "Purifying copper",
44
- is_correct: false,
45
- },
46
- {
47
- answer: "Rust removal",
48
- is_correct: false,
49
- },
50
- {
51
- answer: "Hydrogen production",
52
- is_correct: false,
53
- },
54
- ],
55
- heading: "Industrial uses",
56
- },
57
- {
58
- question:
59
- "What can electrolysis be used for in the context of batteries?",
60
- answers: [
61
- {
62
- answer: "Spontaneous redox reactions",
63
- is_correct: true,
64
- },
65
- {
66
- answer: "Energy-releasing reactions",
67
- is_correct: false,
68
- },
69
- {
70
- answer: "Disinfectant production",
71
- is_correct: false,
72
- },
73
- {
74
- answer: "Fuel production",
75
- is_correct: false,
76
- },
77
- {
78
- answer: "Gas diffusion in reactors",
79
- is_correct: false,
80
- },
81
- ],
82
- heading: "Related processes",
83
- },
84
- ],
85
- cloze_cards: [
86
- {
87
- question:
88
- "Electrolysis is the passing of a {{c0:direct electric current}} through an {{c1:electrolyte}} producing {{c2:chemical reactions}} at the {{c3:electrodes}} and {{c4:decomposition}} of the materials.",
89
- options: [
90
- {
91
- option: "direct electric current",
92
- cloze: "c0",
93
- },
94
- {
95
- option: "electrolyte",
96
- cloze: "c1",
97
- },
98
- {
99
- option: "chemical reactions",
100
- cloze: "c2",
101
- },
102
- {
103
- option: "electrodes",
104
- cloze: "c3",
105
- },
106
- {
107
- option: "decomposition",
108
- cloze: "c4",
109
- },
110
- {
111
- option: "metallic objects",
112
- cloze: null,
113
- },
114
- ],
115
- },
116
- {
117
- question:
118
- "In electrolysis, the decomposition potential or decomposition voltage refers to the minimum voltage between {{c0:anode}} and {{c1:cathode}} of an electrolytic cell needed for electrolysis to occur.",
119
- options: [
120
- {
121
- option: "anode",
122
- cloze: "c0",
123
- },
124
- {
125
- option: "cathode",
126
- cloze: "c1",
127
- },
128
- {
129
- option: "electrolyte",
130
- cloze: null,
131
- },
132
- {
133
- option: "chemical reactions",
134
- cloze: null,
135
- },
136
- {
137
- option: "oxygen",
138
- cloze: null,
139
- },
140
- {
141
- option: "hydrogen",
142
- cloze: null,
143
- },
144
- ],
145
- },
146
- ],
147
- };
148
-
149
- const sourceResp = {
150
- status_code: 200,
151
- usage_data: {
152
- prompt_tokens: 9781,
153
- completion_tokens: 1915,
154
- total_tokens: 11696,
155
- },
156
- generated_content: {
157
- missing_concepts: [
158
- "Faraday's laws of electrolysis",
159
- "Humphry Davy",
160
- "Electrolytic cell",
161
- "Decomposition potential",
162
- "Oxidation",
163
- "Reduction",
164
- "Electrolysis of seawater",
165
- "Electrometallurgy",
166
- "Electroplating",
167
- "Electrochemical machining",
168
- "Electrochemistry",
169
- "Electrocatalysis",
170
- "Electrorefining",
171
- "Electrolysis of carbon dioxide",
172
- "Energy changes during electrolysis",
173
- "Electrocrystallization",
174
- "Electrolysis of Iron Ore",
175
- ],
176
- missing_facts: [
177
- "Michael Faraday introduced the term 'electrolysis' in 1834",
178
- "The first demonstration of key electrolysis concepts was by William Nicholson and Anthony Carlisle in the early nineteenth century",
179
- "Humphry Davy discovered several alkali and alkaline earth metals by electrolysis",
180
- "Electrolysis played a key role in isolating and identifying new elements like lithium, chlorine, and fluorine",
181
- "The Hall–Héroult process led to a significant drop in the price of aluminum",
182
- "Hydrogen and oxygen are produced in a 2:1 ratio by the electrolysis of water",
183
- "The electrolysis of seawater can result in the production of alkali hydroxides",
184
- "Electrometallurgy is used in the production of various metals",
185
- "Electroplating involves the deposition of a thin metal film onto a substrate material",
186
- "Electrochemical machining is used for deburring or etching metal surfaces",
187
- "Electrocatalysis involves the acceleration of electrochemical reactions",
188
- "Electrorefining is used to obtain pure metals from impure ones",
189
- "The electrolysis of carbon dioxide can produce methane, ethylene, or ethanol",
190
- "Energy changes during electrolysis involve the addition of electrical energy, equal to the change in Gibbs free energy plus system losses",
191
- "Electrocrystallization is a method for obtaining conductive crystals using electrolysis",
192
- "Electrolysis of Iron Ore can eventually result in the reduction of emissions from steel production",
193
- ],
194
- test_cards: [
195
- {
196
- type: "flash",
197
- card_content: {
198
- front: "Who introduced the term 'electrolysis' and in which year?",
199
- back: "Michael Faraday introduced the term 'electrolysis' in 1834",
200
- },
201
- card_reference: "Electrolysis#Etymology",
202
- concepts: [],
203
- facts: ["Michael Faraday introduced the term 'electrolysis' in 1834"],
204
- },
205
- {
206
- type: "flash",
207
- card_content: {
208
- front: "What was the significance of the Hall–Héroult process?",
209
- back: "The Hall–Héroult process led to a significant drop in the price of aluminum",
210
- },
211
- card_reference: "Electrolysis#Industrial uses",
212
- concepts: ["Hall–Héroult process"],
213
- facts: [
214
- "The Hall–Héroult process led to a significant drop in the price of aluminum",
215
- ],
216
- },
217
- {
218
- type: "mcq",
219
- card_content: {
220
- prompt: "What does the electrolysis of water produce?",
221
- choices: [
222
- {
223
- choice: "Oxygen and carbon dioxide",
224
- is_correct: false,
225
- },
226
- {
227
- choice: "Hydrogen and oxygen",
228
- is_correct: true,
229
- },
230
- {
231
- choice: "Nitrogen and helium",
232
- is_correct: false,
233
- },
234
- ],
235
- },
236
- card_reference: "Electrolysis#Process of electrolysis",
237
- concepts: ["Electrometallurgy"],
238
- facts: [
239
- "Hydrogen and oxygen are produced in a 2:1 ratio by the electrolysis of water",
240
- ],
241
- },
242
- {
243
- type: "cloze",
244
- card_content: {
245
- prompt:
246
- "Electrolysis is the passing of a direct electric current through an {{c0:electrolyte}} producing chemical reactions at the electrodes and decomposition of the materials.",
247
- options: [
248
- {
249
- option: "electrolyte",
250
- cloze: "c0",
251
- },
252
- {
253
- option: "anode",
254
- cloze: "null",
255
- },
256
- {
257
- option: "cathode",
258
- cloze: "null",
259
- },
260
- ],
261
- },
262
- card_reference: "Electrolysis#Overview",
263
- concepts: [],
264
- facts: [],
265
- },
266
- {
267
- type: "match",
268
- card_content: {
269
- "right_choice 1": "Electrometallurgy",
270
- "right_choice 2": "Electroplating",
271
- "right_choice 3": "Electrochemical machining",
272
- "right_choice 4": "Electrochemistry",
273
- "right_choice 5": "Electrocatalysis",
274
- "right_choice 6": "Electrorefining",
275
- "right_choice 7": "Electrolysis of carbon dioxide",
276
- "right_choice 8": "Energy changes during electrolysis",
277
- Electrometallurgy:
278
- "The process of producing metals using electricity",
279
- Electroplating:
280
- "Deposition of thin metal film onto a substrate material",
281
- "Electrochemical machining": "Deburring or etching metal surfaces",
282
- Electrochemistry:
283
- "Study of the interchange of chemical and electrical energy",
284
- Electrocatalysis: "Acceleration of electrochemical reactions",
285
- Electrorefining: "Obtaining pure metals from impure ones",
286
- },
287
- card_reference: "Electrolysis#Industrial uses",
288
- concepts: [
289
- "Electrometallurgy",
290
- "Electroplating",
291
- "Electrochemical machining",
292
- "Electrochemistry",
293
- "Electrocatalysis",
294
- "Electrorefining",
295
- "Electrolysis of carbon dioxide",
296
- "Energy changes during electrolysis",
297
- ],
298
- facts: [
299
- "Electrometallurgy is used in the production of various metals",
300
- "Electroplating involves the deposition of a thin metal film onto a substrate material",
301
- "Electrochemical machining is used for deburring or etching metal surfaces",
302
- "Electrochemistry is the study of the interchange of chemical and electrical energy",
303
- "Electrocatalysis involves the acceleration of electrochemical reactions",
304
- "Electrorefining is used to obtain pure metals from impure ones",
305
- "The electrolysis of carbon dioxide can produce methane, ethylene, or ethanol",
306
- "Energy changes during electrolysis involve the addition of electrical energy, equal to the change in Gibbs free energy plus system losses",
307
- ],
308
- },
309
- {
310
- type: "mcq",
311
- card_content: {
312
- prompt: "What is a key application of electrolysis?",
313
- choices: [
314
- {
315
- choice: "Production of metal from ore",
316
- is_correct: false,
317
- },
318
- {
319
- choice: "Pulsing current results",
320
- is_correct: false,
321
- },
322
- {
323
- choice: "Generating electrical potential",
324
- is_correct: false,
325
- },
326
- {
327
- choice: "Production of chlorine and sodium hydroxide",
328
- is_correct: true,
329
- },
330
- ],
331
- },
332
- card_reference: "Electrolysis#Industrial uses",
333
- concepts: ["Electrochemistry", "Electrocatalysis", "Electrorefining"],
334
- facts: [
335
- "Production of chlorine and sodium hydroxide, called the Chloralkali process",
336
- ],
337
- },
338
- {
339
- type: "cloze",
340
- card_content: {
341
- prompt:
342
- "Oxidation of ions or neutral molecules occurs at the {{c0:anode}}. Reduction of ions or neutral molecules occurs at the {{c1:cathode}}.",
343
- options: [
344
- {
345
- option: "anode",
346
- cloze: "c0",
347
- },
348
- {
349
- option: "cathode",
350
- cloze: "c1",
351
- },
352
- {
353
- option: "electrolyte",
354
- cloze: "null",
355
- },
356
- ],
357
- },
358
- card_reference:
359
- "Electrolysis#Oxidation and reduction at the electrodes",
360
- concepts: ["Oxidation", "Reduction"],
361
- facts: [],
362
- },
363
- {
364
- type: "match",
365
- card_content: {
366
- "right_choice 1": "Electrolysis",
367
- "right_choice 2": "Electrocrystallization",
368
- "right_choice 3": "Electrolysis of Iron Ore",
369
- "right_choice 4": "Electrolysis of seawater",
370
- "right_choice 5": "Electrometallurgy",
371
- },
372
- card_reference: "Electrolysis#Research trends",
373
- concepts: [
374
- "Electrolysis",
375
- "Electrocrystallization",
376
- "Electrolysis of Iron Ore",
377
- "Electrolysis of seawater",
378
- "Electrometallurgy",
379
- ],
380
- facts: [],
381
- },
382
- ],
383
- },
384
- generated_at: 1718625081,
385
- type: "card_gen",
386
- };
@@ -1,44 +0,0 @@
1
- const typologyResponse = {
2
- usage_data: {
3
- prompt_tokens: 11611,
4
- completion_tokens: 441,
5
- total_tokens: 12052,
6
- },
7
- generated_content: {
8
- field: [
9
- "Sciences",
10
- "Technology & Engineering",
11
- "Education, Learning & Personal Development",
12
- ],
13
- concepts: [
14
- "Electrolysis",
15
- "Faraday's Laws of Electrolysis",
16
- "Electrolytic Cell",
17
- "Decomposition Potential",
18
- "Oxidation and Reduction at the Electrodes",
19
- "Electrolysis of Water",
20
- "Electrolysis of Carbon Dioxide",
21
- "Electrocrystallization",
22
- ],
23
- facts: [
24
- "Electrolysis is the passing of a direct electric current through an electrolyte producing chemical reactions at the electrodes and decomposition of the materials.",
25
- "In electrolysis, the quantity of the products is proportional to the current, and when two or more electrolytic cells are connected in series to the same power source, the products produced in the cells are proportional to their equivalent weight.",
26
- "The main components required to achieve electrolysis are an electrolyte, electrodes, and an external power source.",
27
- "Faraday's laws of electrolysis detail the amount of the products of electrolysis is related to the number of electrons in the reaction at the electrodes.",
28
- "Decomposition potential or decomposition voltage refers to the minimum voltage between anode and cathode of an electrolytic cell that is needed for electrolysis to occur.",
29
- "The electrochemical reduction of carbon dioxide can produce value-added chemicals such as methane, ethylene, and ethanol.",
30
- ],
31
- generate_cards: true,
32
- summary_cards: [
33
- "Electrolysis is the process of passing direct electric current through an electrolyte, resulting in chemical reactions and the decomposition of materials.",
34
- "Faraday's laws of electrolysis determine the relationship between the amounts of products generated and the electrons involved in the reaction at the electrodes.",
35
- "Decomposition potential is the minimum voltage required between anode and cathode for electrolysis to occur.",
36
- "The electrochemical reduction of carbon dioxide is a potential method for producing valuable chemicals such as methane, ethylene, and ethanol.",
37
- ],
38
- },
39
- generated_at: "Tue, 20 Jan 1970 21:17:46 GMT",
40
- };
41
-
42
- export function returnTypologyData() {
43
- return typologyResponse as any;
44
- }