only_ever_generator 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/bootstrap/app.d.ts +29 -6
  2. package/dist/bootstrap/app.d.ts.map +1 -1
  3. package/dist/bootstrap/app.js +82 -19
  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/consolidation/local_consolidation.d.ts.map +1 -1
  19. package/dist/embedding_generation/local_consolidation.js +104 -0
  20. package/dist/enums/card_type_enum.d.ts +7 -0
  21. package/dist/enums/card_type_enum.d.ts.map +1 -0
  22. package/dist/enums/card_type_enum.js +11 -0
  23. package/dist/enums/card_type_enum.js.map +1 -0
  24. package/dist/helper/openai_helper.d.ts +12 -0
  25. package/dist/helper/openai_helper.d.ts.map +1 -0
  26. package/dist/helper/openai_helper.js +26 -0
  27. package/dist/helper/openai_helper.js.map +1 -0
  28. package/dist/helper/qdrant_db_methods.d.ts.map +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +923 -87
  31. package/dist/index.js.map +1 -1
  32. package/dist/parse/parse_card/parse_cloze_card.d.ts +8 -1
  33. package/dist/parse/parse_card/parse_cloze_card.d.ts.map +1 -1
  34. package/dist/parse/parse_card/parse_cloze_card.js +2 -2
  35. package/dist/parse/parse_card/parse_cloze_card.js.map +1 -1
  36. package/dist/parse/parse_card/parse_flash_cards.d.ts +14 -7
  37. package/dist/parse/parse_card/parse_flash_cards.d.ts.map +1 -1
  38. package/dist/parse/parse_card/parse_flash_cards.js +3 -3
  39. package/dist/parse/parse_card/parse_flash_cards.js.map +1 -1
  40. package/dist/parse/parse_card/parse_match_card.d.ts +8 -1
  41. package/dist/parse/parse_card/parse_match_card.d.ts.map +1 -1
  42. package/dist/parse/parse_card/parse_match_card.js +2 -3
  43. package/dist/parse/parse_card/parse_match_card.js.map +1 -1
  44. package/dist/parse/parse_card/parse_mcq_card.d.ts +15 -8
  45. package/dist/parse/parse_card/parse_mcq_card.d.ts.map +1 -1
  46. package/dist/parse/parse_card/parse_mcq_card.js +2 -2
  47. package/dist/parse/parse_card/parse_mcq_card.js.map +1 -1
  48. package/dist/parse/parse_card_response.d.ts +12 -10
  49. package/dist/parse/parse_card_response.d.ts.map +1 -1
  50. package/dist/parse/parse_card_response.js +121 -54
  51. package/dist/parse/parse_card_response.js.map +1 -1
  52. package/dist/parse/parse_source_content.d.ts +7 -5
  53. package/dist/parse/parse_source_content.d.ts.map +1 -1
  54. package/dist/parse/parse_source_content.js +1 -0
  55. package/dist/parse/parse_source_content.js.map +1 -1
  56. package/dist/parse/response_format_card.d.ts +0 -1
  57. package/dist/parse/response_format_typology.d.ts +0 -1
  58. package/dist/types/base_param_type.d.ts +17 -0
  59. package/dist/types/base_param_type.d.ts.map +1 -0
  60. package/dist/types/base_param_type.js +3 -0
  61. package/dist/types/base_param_type.js.map +1 -0
  62. package/dist/types/mongo_concept_fact_type.d.ts +12 -0
  63. package/dist/types/mongo_concept_fact_type.d.ts.map +1 -0
  64. package/dist/types/mongo_concept_fact_type.js +3 -0
  65. package/dist/types/mongo_concept_fact_type.js.map +1 -0
  66. package/dist/types/parsed_card_type.d.ts +12 -0
  67. package/dist/types/parsed_card_type.d.ts.map +1 -0
  68. package/dist/types/parsed_card_type.js +30 -0
  69. package/dist/types/parsed_card_type.js.map +1 -0
  70. package/dist/types/raw_card_response_types/generated_card_response_type.d.ts +40 -0
  71. package/dist/types/raw_card_response_types/generated_card_response_type.d.ts.map +1 -0
  72. package/dist/types/raw_card_response_types/generated_card_response_type.js +8 -0
  73. package/dist/types/raw_card_response_types/generated_card_response_type.js.map +1 -0
  74. package/dist/types/source_taxonomy_type.d.ts +15 -0
  75. package/dist/types/source_taxonomy_type.d.ts.map +1 -0
  76. package/dist/types/source_taxonomy_type.js +3 -0
  77. package/dist/types/source_taxonomy_type.js.map +1 -0
  78. package/dist/typology_gen/generate_concept_facts.d.ts +18 -0
  79. package/dist/typology_gen/generate_concept_facts.d.ts.map +1 -0
  80. package/dist/typology_gen/generate_concept_facts.js +48 -0
  81. package/dist/typology_gen/generate_concept_facts.js.map +1 -0
  82. package/dist/typology_gen/generate_typology.d.ts +9 -3
  83. package/dist/typology_gen/generate_typology.d.ts.map +1 -1
  84. package/dist/typology_gen/generate_typology.js +43 -31
  85. package/dist/typology_gen/generate_typology.js.map +1 -1
  86. package/package.json +9 -9
  87. package/src/bootstrap/app.ts +129 -29
  88. package/src/card_gen/generate_cards.ts +27 -5
  89. package/src/constants/prompts/card_gen_prompt.ts +1 -1
  90. package/src/embedding_generation/consolidation/global_consolidation.ts +2 -2
  91. package/src/enums/card_type_enum.ts +6 -0
  92. package/src/helper/openai_helper.ts +31 -0
  93. package/src/index.ts +947 -101
  94. package/src/parse/parse_card/parse_cloze_card.ts +11 -3
  95. package/src/parse/parse_card/parse_flash_cards.ts +12 -4
  96. package/src/parse/parse_card/parse_match_card.ts +10 -4
  97. package/src/parse/parse_card/parse_mcq_card.ts +11 -3
  98. package/src/parse/parse_card_response.ts +94 -20
  99. package/src/parse/parse_source_content.ts +11 -1
  100. package/src/types/base_param_type.ts +17 -0
  101. package/src/types/mongo_concept_fact_type.ts +12 -0
  102. package/src/types/parsed_card_type.ts +39 -0
  103. package/src/types/raw_card_response_types/generated_card_response_type.ts +61 -0
  104. package/src/types/source_taxonomy_type.ts +17 -0
  105. package/src/typology_gen/generate_concept_facts.ts +54 -0
  106. package/src/typology_gen/generate_typology.ts +59 -36
  107. package/.env.example +0 -1
  108. package/dist/constants/prompt_data.d.ts.map +0 -1
  109. package/dist/constants/source_data.d.ts.map +0 -1
  110. package/dist/parse/response_format_card.d.ts.map +0 -1
  111. package/dist/parse/response_format_typology.d.ts.map +0 -1
  112. package/prompts.json +0 -23
  113. package/readme.md +0 -35
  114. package/src/constants/prompt_data.ts +0 -301
  115. package/src/constants/source_data.ts +0 -1036
  116. package/src/parse/response_format_card.ts +0 -386
  117. package/src/parse/response_format_typology.ts +0 -44
package/dist/index.js CHANGED
@@ -1,97 +1,933 @@
1
1
  "use strict";
2
- // import express from "express";
3
- // import {
4
- // returnCardResponse,
5
- // returnHeadings,
6
- // returnSourceData,
7
- // } from "./constants/source_data";
8
- // import config from "./config";
9
- // const app = express();
10
- // const port = 3000;
11
- // import { returnPromptData } from "./constants/prompt_data";
12
- // import { GenerateCards } from "./card_gen/generate_cards";
13
- // import { OpenAiService } from "./services/open_ai_service";
14
- // import { ParseCardResponse } from "./parse/parse_card_response";
15
- // import { returnTypologyPrompt } from "./constants/prompts/typology_prompt";
16
- // import { returnCardGenPrompt } from "./constants/prompts/card_gen_prompt";
17
- // import { GenerateArgs } from "./utils/generate_args";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
18
11
  Object.defineProperty(exports, "__esModule", { value: true });
19
12
  exports.OnlyEverGenerator = void 0;
20
13
  const app_1 = require("./bootstrap/app");
21
14
  Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: function () { return app_1.OnlyEverGenerator; } });
22
- // . All the Codes Below uses express and are strictly for development purpose, while publishing the package, comment everything
23
- // below this line
24
- // let oeGen = new OnlyEverGenerator(config.openAIKey, "gpt-4o-mini", {
25
- // prompt: returnPromptData(),
26
- // content: returnSourceData(),
27
- // });
28
- // app.get("/", async (req, res) => {
29
- // // let data = oeGen.returnParsedContent();
30
- // // let parsedData = parseResponse()
31
- // let cardPrompt = "";
32
- // res.send(cardPrompt);
33
- // });
34
- // app.get("/openAI", async (req, res) => {
35
- // // let prompt = returnPromt();
36
- // // let prompt = returnCardGenPrompt();
37
- // // let content = returnSourceData().toString()
38
- // // let headings = returnHeadings();
39
- // // // let aiRequest = await openAIRequest(prompt,content);
40
- // let aiRequest = await oeGen.generate(true, true);
41
- // res.send(aiRequest);
42
- // });
43
- // app.get("/parseCardData", async (req, res) => {
44
- // let cardResp = returnCardResponse();
45
- // let headings = returnHeadings();
46
- // cardResp.metadata = {
47
- // req_time: cardResp.generated_at ?? new Date(),
48
- // req_type: "card",
49
- // req_tokens: cardResp.usage_data?.prompt_tokens,
50
- // res_tokens: cardResp.usage_data?.completion_tokens,
51
- // model: "40-mini",
52
- // };
53
- // let parsedData = new ParseCardResponse().parse(cardResp, false, {});
54
- // res.send(parsedData);
55
- // });
56
- // app.get("/generate-cards", async (req, res) => {
57
- // let cardResp = embeddingsResp;
58
- // oeGen.parsedContent.taxonomy = cardResp;
59
- // let parsedData = await oeGen.generateCard(
60
- // returnCardGenPrompt(),
61
- // JSON.stringify(cardResp),
62
- // false
15
+ // (async () => {
16
+ // const openAIKey =
17
+ // "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";
18
+ // const openAIHelper = new OpenAIHelper(
19
+ // openAIKey,
20
+ // "o4-mini",
21
+ // "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
22
+ // "13"
63
23
  // );
64
- // res.send(parsedData);
65
- // });
66
- // app.get("/typology", async (req, res) => {
24
+ // const content = `{
25
+ // "title":"C19orf47",
26
+ // "headings": [
27
+ // "Gene",
28
+ // "mRNA",
29
+ // "Protein",
30
+ // "Homology",
31
+ // "Clinical Significance",
32
+ // "References"
33
+ // ],
34
+ // "content": "content": [
67
35
  // {
68
- // let typologyRequest = await oeGen.generate(true, false);
69
- // res.send(typologyRequest);
36
+ // "block_type": "paragraph",
37
+ // "content": "**[[Chromosome|Chromosome|0|wiki]] 19 open reading frame 47** is a [[Protein|protein|1|wiki]] that in humans is encoded by the C19orf47 [[Gene|gene|2|wiki]]. Aliases include Chromosome 19 Open Reading Frame 47, FLJ36888, DKZp686P05129, and LOCI26526."
38
+ // },
39
+ // {
40
+ // "block_type": "heading",
41
+ // "content": "Gene",
42
+ // "heading_level": 1,
43
+ // "children": [
44
+ // {
45
+ // "block_type": "paragraph",
46
+ // "content": "*Homo sapiens* C19orf47 is located in cytogenetic band 19q13.2. It covers 28.98 kilobases from 40,854,420 to 40,825,543 on the minus strand. The gene has 8 exons in the isoform 1 precursor, the last of which is the longest and comprises over half of the mRNA transcript."
47
+ // }
48
+ // ]
49
+ // },
50
+ // {
51
+ // "block_type": "heading",
52
+ // "content": "mRNA",
53
+ // "heading_level": 1,
54
+ // "children": [
55
+ // {
56
+ // "block_type": "image",
57
+ // "img_src": "https://wikipedia.org/wiki/Special:Redirect/file/Conceptual_translation_of_C19orf47.png",
58
+ // "img_caption": "Conceptual translation of C19orf47 using SIXFRAME. Exon-exon boundaries are in blue, start codon is in green, and stop codon is red. PolyA signal sequence is shown in dark orange, polyA sites are shown in orange. Base pair and amino acid numbering is shown. Conserved amino acids in close orthologs are shown bolded."
59
+ // },
60
+ // {
61
+ // "block_type": "paragraph",
62
+ // "content": "Transcription of *Homo sapiens* C19orf47 produces 13 different mRNAs, with 12 alternatively spliced variants and 1 unspliced form. Isoforms and the proteins encoded by them are shown in the table below. *Homo sapiens* C19orf47 has broad expression in heart, testes, and other tissues."
63
+ // },
64
+ // {
65
+ // "block_type": "paragraph",
66
+ // "content": "*Isoforms of C19orf47.*"
67
+ // },
68
+ // {
69
+ // "block_type": "table",
70
+ // "rows": [
71
+ // {
72
+ // "block_type": "row",
73
+ // "values": [
74
+ // "Isoform number",
75
+ // "Nucleotide Accession",
76
+ // "mRNA length (bp)",
77
+ // "Protein Accession",
78
+ // "Protein Length (aa)"
79
+ // ],
80
+ // "is_heading": true
81
+ // },
82
+ // {
83
+ // "block_type": "row",
84
+ // "values": [
85
+ // "NM1",
86
+ // "NM_001256440.1",
87
+ // "2104",
88
+ // "NP_001243369.1",
89
+ // "422"
90
+ // ],
91
+ // "is_heading": false
92
+ // },
93
+ // {
94
+ // "block_type": "row",
95
+ // "values": [
96
+ // "NM2",
97
+ // "NM_001256441.2",
98
+ // "3611",
99
+ // "NP_001243370.1",
100
+ // "385"
101
+ // ],
102
+ // "is_heading": false
103
+ // },
104
+ // {
105
+ // "block_type": "row",
106
+ // "values": [
107
+ // "X1",
108
+ // "XM_017026291.2",
109
+ // "3608",
110
+ // "XP_016881780.1",
111
+ // "384"
112
+ // ],
113
+ // "is_heading": false
114
+ // },
115
+ // {
116
+ // "block_type": "row",
117
+ // "values": [
118
+ // "X2",
119
+ // "XM_005258520.3",
120
+ // "3625",
121
+ // "XP_005258577.1",
122
+ // "421"
123
+ // ],
124
+ // "is_heading": false
125
+ // },
126
+ // {
127
+ // "block_type": "row",
128
+ // "values": [
129
+ // "X3",
130
+ // "XM_017026292.3",
131
+ // "1407",
132
+ // "XP_016881781.1",
133
+ // "366"
134
+ // ],
135
+ // "is_heading": false
136
+ // },
137
+ // {
138
+ // "block_type": "row",
139
+ // "values": [
140
+ // "X4",
141
+ // "XM_017026293.3",
142
+ // "1404",
143
+ // "XP_016881782.1",
144
+ // "365"
145
+ // ],
146
+ // "is_heading": false
147
+ // },
148
+ // {
149
+ // "block_type": "row",
150
+ // "values": [
151
+ // "X5",
152
+ // "XM_047438175.1",
153
+ // "1421",
154
+ // "XP_047294131.1",
155
+ // "402"
156
+ // ],
157
+ // "is_heading": false
158
+ // },
159
+ // {
160
+ // "block_type": "row",
161
+ // "values": [
162
+ // "X6",
163
+ // "XM_024451364.2",
164
+ // "3507",
165
+ // "XP_024307132.1",
166
+ // "344"
167
+ // ],
168
+ // "is_heading": false
169
+ // },
170
+ // {
171
+ // "block_type": "row",
172
+ // "values": [
173
+ // "X7",
174
+ // "XM_047438176.1",
175
+ // "3504",
176
+ // "XP_047294132.1",
177
+ // "343"
178
+ // ],
179
+ // "is_heading": false
180
+ // },
181
+ // {
182
+ // "block_type": "row",
183
+ // "values": [
184
+ // "X8",
185
+ // "XM_024451365.2",
186
+ // "4638",
187
+ // "XP_024307133.1",
188
+ // "385"
189
+ // ],
190
+ // "is_heading": false
191
+ // },
192
+ // {
193
+ // "block_type": "row",
194
+ // "values": [
195
+ // "X8",
196
+ // "XM_047438177.1",
197
+ // "4671",
198
+ // "XP_047294133.1",
199
+ // "385"
200
+ // ],
201
+ // "is_heading": false
202
+ // },
203
+ // {
204
+ // "block_type": "row",
205
+ // "values": [
206
+ // "X9",
207
+ // "XM_011526460.3",
208
+ // "3524",
209
+ // "XP_011524762.1",
210
+ // "381"
211
+ // ],
212
+ // "is_heading": false
213
+ // },
214
+ // {
215
+ // "block_type": "row",
216
+ // "values": [
217
+ // "X10",
218
+ // "XM_047438178.1",
219
+ // "3668",
220
+ // "XP_047294134.1",
221
+ // "355"
222
+ // ],
223
+ // "is_heading": false
224
+ // },
225
+ // {
226
+ // "block_type": "row",
227
+ // "values": [
228
+ // "X11",
229
+ // "XM_047438179.1",
230
+ // "3241",
231
+ // "XP_047294135.1",
232
+ // "281"
233
+ // ],
234
+ // "is_heading": false
235
+ // }
236
+ // ]
237
+ // }
238
+ // ]
239
+ // },
240
+ // {
241
+ // "block_type": "heading",
242
+ // "content": "Protein",
243
+ // "heading_level": 1,
244
+ // "children": [
245
+ // {
246
+ // "block_type": "image",
247
+ // "img_src": "https://wikipedia.org/wiki/Special:Redirect/file/Protein_cartoon_of_human_C19orf47.png",
248
+ // "img_caption": "SAM domain is shown in red and nuclear localization site shown in yellow. Amidation site shown with yellow circle, N-glycosylation site shown with blue circle, cAMP- and cGMP-dependent protein kinase phosphorylation sites shown with purple rhombus, Casein kinase II phosphorylation is shown with light blue triangles, N-myristoylation sites shown with green squares, and protein kinase C phosphorylation sites shown with light purple diamonds."
249
+ // },
250
+ // {
251
+ // "block_type": "image",
252
+ // "img_src": "https://wikipedia.org/wiki/Special:Redirect/file/C19orf47_tertiary_structure_from_iCn3D.png",
253
+ // "img_caption": "C19orf47 tertiary structure from iCn3D"
254
+ // },
255
+ // {
256
+ // "block_type": "paragraph",
257
+ // "content": "The C19orf47 gene isoform 1 precursor encodes for a 422 amino acid protein. The protein is located in the nucleoplasm and nucleus of the cell."
258
+ // },
259
+ // {
260
+ // "block_type": "heading",
261
+ // "content": "Interacting Proteins",
262
+ // "heading_level": 2,
263
+ // "children": [
264
+ // {
265
+ // "block_type": "paragraph",
266
+ // "content": "The following proteins have predicted interactions with C19orf47. ''Interacting proteins with C19orf47 in humans. Notes with important information are shown.''"
267
+ // },
268
+ // {
269
+ // "block_type": "table",
270
+ // "rows": [
271
+ // {
272
+ // "block_type": "row",
273
+ // "values": [
274
+ // "Abbreviated Name",
275
+ // "Full Name",
276
+ // "Additional Notes"
277
+ // ],
278
+ // "is_heading": true
279
+ // },
280
+ // {
281
+ // "block_type": "row",
282
+ // "values": [
283
+ // "PARK2",
284
+ // "Parkin RBR E3 Ubiquitin Protein Ligase",
285
+ // "Component of multiprotein E3 ubiquitin ligase complex. Mutations are known to cause Parkinson’s disease."
286
+ // ],
287
+ // "is_heading": false
288
+ // },
289
+ // {
290
+ // "block_type": "row",
291
+ // "values": [
292
+ // "NSP3",
293
+ // "Non-structural protein 3",
294
+ // "SARS-CoV-2 protein"
295
+ // ],
296
+ // "is_heading": false
297
+ // },
298
+ // {
299
+ // "block_type": "row",
300
+ // "values": [
301
+ // "ORF14",
302
+ // "Open reading frame 14",
303
+ // "SARS-CoV-2 protein"
304
+ // ],
305
+ // "is_heading": false
306
+ // },
307
+ // {
308
+ // "block_type": "row",
309
+ // "values": [
310
+ // "MYC",
311
+ // "V-Myc Avian Myelocytomatosis Viral Oncogene Homolog 2 3",
312
+ // "Proto-oncogene, forms a heterodimer with related transcription factor for MAX."
313
+ // ],
314
+ // "is_heading": false
315
+ // },
316
+ // {
317
+ // "block_type": "row",
318
+ // "values": [
319
+ // "DDX39B",
320
+ // "DExD-Box Helicase 39B",
321
+ // "RNA-dependent ATPase that mediates ATP hydrolysis during mRNA splicing."
322
+ // ],
323
+ // "is_heading": false
324
+ // },
325
+ // {
326
+ // "block_type": "row",
327
+ // "values": [
328
+ // "C17orf85",
329
+ // "Nuclear Cap-Binding Protein Subunit 3",
330
+ // "Associates with NCBP1/CBP80 to form an alternative cap-binding complex (CBC) which plays a key role in mRNA export."
331
+ // ],
332
+ // "is_heading": false
333
+ // },
334
+ // {
335
+ // "block_type": "row",
336
+ // "values": [
337
+ // "NXF1",
338
+ // "Nuclear RNA Export Factor 1",
339
+ // "Member of a family of nuclear RNA export factor genes."
340
+ // ],
341
+ // "is_heading": false
342
+ // },
343
+ // {
344
+ // "block_type": "row",
345
+ // "values": [
346
+ // "THOC2",
347
+ // "THO Complex 2",
348
+ // "Multiprotein complex binds specifically to spliced mRNAs to facilitate mRNA export."
349
+ // ],
350
+ // "is_heading": false
351
+ // },
352
+ // {
353
+ // "block_type": "row",
354
+ // "values": [
355
+ // "YWHAQ",
356
+ // "Tyrosine 3-Monooxygenase/Tryptophan 5-Monooxygenase Activation Protein, Theta Polypeptide",
357
+ // "Mediates signal transduction by binding to phosphoserine-containing proteins."
358
+ // ],
359
+ // "is_heading": false
360
+ // }
361
+ // ]
362
+ // }
363
+ // ]
364
+ // }
365
+ // ]
366
+ // },
367
+ // {
368
+ // "block_type": "heading",
369
+ // "content": "Homology",
370
+ // "heading_level": 1,
371
+ // "children": [
372
+ // {
373
+ // "block_type": "paragraph",
374
+ // "content": "C19orf47 is found in organisms including mammals, reptiles, amphibian, fish, insects, and plant."
375
+ // },
376
+ // {
377
+ // "block_type": "paragraph",
378
+ // "content": "''Current orthologs of human C19orf47. Sequence identity and similarity are shown.''"
379
+ // },
380
+ // {
381
+ // "block_type": "table",
382
+ // "rows": [
383
+ // {
384
+ // "block_type": "row",
385
+ // "values": [
386
+ // "col1",
387
+ // "col2",
388
+ // "col3",
389
+ // "col4",
390
+ // "col5",
391
+ // "col6",
392
+ // "col7",
393
+ // "col8",
394
+ // "col9"
395
+ // ],
396
+ // "is_heading": true
397
+ // },
398
+ // {
399
+ // "block_type": "row",
400
+ // "values": [
401
+ // "C19orf47",
402
+ // "Genus, Species",
403
+ // "Common Name",
404
+ // "Taxonomic Group",
405
+ // "Date of Divergence (MYA)",
406
+ // "Accession Number",
407
+ // "Sequence Length (aa)",
408
+ // "Identity",
409
+ // "Similarity"
410
+ // ],
411
+ // "is_heading": false
412
+ // },
413
+ // {
414
+ // "block_type": "row",
415
+ // "values": [
416
+ // "Mammalia",
417
+ // "Homo sapiens",
418
+ // "Human",
419
+ // "Primates",
420
+ // "0",
421
+ // "NP_001243369.1",
422
+ // "422",
423
+ // "100.0%",
424
+ // "100.0%"
425
+ // ],
426
+ // "is_heading": false
427
+ // },
428
+ // {
429
+ // "block_type": "row",
430
+ // "values": [
431
+ // "Mammalia",
432
+ // "Mus musculus",
433
+ // "Mouse",
434
+ // "Rodentia",
435
+ // "87",
436
+ // "XP_036009244.1",
437
+ // "397",
438
+ // "75.5%",
439
+ // "80.2%"
440
+ // ],
441
+ // "is_heading": false
442
+ // },
443
+ // {
444
+ // "block_type": "row",
445
+ // "values": [
446
+ // "Mammalia",
447
+ // "Castor canadensis",
448
+ // "American Beaver",
449
+ // "Rodentia",
450
+ // "87",
451
+ // "XP_020022531.1",
452
+ // "382",
453
+ // "71.3%",
454
+ // "74.7%"
455
+ // ],
456
+ // "is_heading": false
457
+ // },
458
+ // {
459
+ // "block_type": "row",
460
+ // "values": [
461
+ // "Reptilia",
462
+ // "Gopherus flavomarginatus",
463
+ // "Bolson Tortoise",
464
+ // "Testudines",
465
+ // "319",
466
+ // "XP_050784538.1",
467
+ // "386",
468
+ // "63.3%",
469
+ // "72.9%"
470
+ // ],
471
+ // "is_heading": false
472
+ // },
473
+ // {
474
+ // "block_type": "row",
475
+ // "values": [
476
+ // "Reptilia",
477
+ // "Dermochelys coriacea",
478
+ // "Leatherback Sea Turtle",
479
+ // "Testudines",
480
+ // "319",
481
+ // "XP_038238045.2",
482
+ // "449",
483
+ // "62.3%",
484
+ // "72.0%"
485
+ // ],
486
+ // "is_heading": false
487
+ // },
488
+ // {
489
+ // "block_type": "row",
490
+ // "values": [
491
+ // "Reptilia",
492
+ // "Varanus komodoensis",
493
+ // "Komodo Dragon",
494
+ // "Squamata",
495
+ // "319",
496
+ // "XP_044281356.1",
497
+ // "395",
498
+ // "60.2%",
499
+ // "69.2%"
500
+ // ],
501
+ // "is_heading": false
502
+ // },
503
+ // {
504
+ // "block_type": "row",
505
+ // "values": [
506
+ // "Reptilia",
507
+ // "Alligator sinensis",
508
+ // "Chinese Alligator",
509
+ // "Crocodylia",
510
+ // "319",
511
+ // "XP_025068843.1",
512
+ // "388",
513
+ // "54.7%",
514
+ // "63.3%"
515
+ // ],
516
+ // "is_heading": false
517
+ // },
518
+ // {
519
+ // "block_type": "row",
520
+ // "values": [
521
+ // "Aves",
522
+ // "Haliaeetus leucocephalus",
523
+ // "Bald Eagle",
524
+ // "Falconiformes",
525
+ // "319",
526
+ // "XP_010564700.1",
527
+ // "380",
528
+ // "60.2%",
529
+ // "69.1%"
530
+ // ],
531
+ // "is_heading": false
532
+ // },
533
+ // {
534
+ // "block_type": "row",
535
+ // "values": [
536
+ // "Aves",
537
+ // "Phalacrocorax carbo",
538
+ // "Great Cormorant",
539
+ // "Suliformes",
540
+ // "319",
541
+ // "XP_009501755.1",
542
+ // "381",
543
+ // "58.5%",
544
+ // "67.3%"
545
+ // ],
546
+ // "is_heading": false
547
+ // },
548
+ // {
549
+ // "block_type": "row",
550
+ // "values": [
551
+ // "Aves",
552
+ // "Gallus gallus",
553
+ // "Chicken",
554
+ // "Galliformes",
555
+ // "319",
556
+ // "XP_015129410.4",
557
+ // "374",
558
+ // "36.6%",
559
+ // "45.5%"
560
+ // ],
561
+ // "is_heading": false
562
+ // },
563
+ // {
564
+ // "block_type": "row",
565
+ // "values": [
566
+ // "Amphibia",
567
+ // "Xenopus tropicalis",
568
+ // "Frog",
569
+ // "Anura",
570
+ // "352",
571
+ // "NP_001005016.1",
572
+ // "398",
573
+ // "54.2%",
574
+ // "64.5%"
575
+ // ],
576
+ // "is_heading": false
577
+ // },
578
+ // {
579
+ // "block_type": "row",
580
+ // "values": [
581
+ // "Fish",
582
+ // "Protopterus annectens",
583
+ // "West African Lungfish",
584
+ // "Lepidosireniformes",
585
+ // "408",
586
+ // "XP_043937251.1",
587
+ // "393",
588
+ // "46.4%",
589
+ // "57.0%"
590
+ // ],
591
+ // "is_heading": false
592
+ // },
593
+ // {
594
+ // "block_type": "row",
595
+ // "values": [
596
+ // "Fish",
597
+ // "Latimeria chalumnae",
598
+ // "West Indian Ocean Coelacanth",
599
+ // "Coelacanthiformes",
600
+ // "415",
601
+ // "XP_014348608.1",
602
+ // "381",
603
+ // "58.2%",
604
+ // "69.7%"
605
+ // ],
606
+ // "is_heading": false
607
+ // },
608
+ // {
609
+ // "block_type": "row",
610
+ // "values": [
611
+ // "Fish",
612
+ // "Danio rerio",
613
+ // "Zebrafish",
614
+ // "Cypriniformes",
615
+ // "429",
616
+ // "NP_001038706.1",
617
+ // "392",
618
+ // "48.6%",
619
+ // "59.5%"
620
+ // ],
621
+ // "is_heading": false
622
+ // },
623
+ // {
624
+ // "block_type": "row",
625
+ // "values": [
626
+ // "Fish",
627
+ // "Leucoraja erinacea",
628
+ // "Little Skate",
629
+ // "Rajiformes",
630
+ // "462",
631
+ // "XP_055519598.1",
632
+ // "395",
633
+ // "53.0%",
634
+ // "64.2%"
635
+ // ],
636
+ // "is_heading": false
637
+ // },
638
+ // {
639
+ // "block_type": "row",
640
+ // "values": [
641
+ // "Fish",
642
+ // "Petromyzon marinus",
643
+ // "Sea Lamprey",
644
+ // "Petromyzontiformes",
645
+ // "563",
646
+ // "XP_032803651.1",
647
+ // "452",
648
+ // "41.6%",
649
+ // "52.4%"
650
+ // ],
651
+ // "is_heading": false
652
+ // },
653
+ // {
654
+ // "block_type": "row",
655
+ // "values": [
656
+ // "Arthropods",
657
+ // "Rhipicephalus sanguineus",
658
+ // "Brown Dog Tick",
659
+ // "Ixodida",
660
+ // "686",
661
+ // "XP_037499932.1",
662
+ // "428",
663
+ // "29.3%",
664
+ // "39.9%"
665
+ // ],
666
+ // "is_heading": false
667
+ // },
668
+ // {
669
+ // "block_type": "row",
670
+ // "values": [
671
+ // "Arthropods",
672
+ // "Biomphalaria glabrata",
673
+ // "Bloodfluke Planorb",
674
+ // "Planorbidae",
675
+ // "686",
676
+ // "XP_055879100.1",
677
+ // "370",
678
+ // "26.6%",
679
+ // "36.0%"
680
+ // ],
681
+ // "is_heading": false
682
+ // },
683
+ // {
684
+ // "block_type": "row",
685
+ // "values": [
686
+ // "Arthropods",
687
+ // "Polistes fuscatus",
688
+ // "Northern Paper Wasp",
689
+ // "Hymenoptera",
690
+ // "686",
691
+ // "XP_043494673.1",
692
+ // "409",
693
+ // "24.1%",
694
+ // "39.3%"
695
+ // ],
696
+ // "is_heading": false
697
+ // },
698
+ // {
699
+ // "block_type": "row",
700
+ // "values": [
701
+ // "Plants",
702
+ // "Gossypium anomalum",
703
+ // "Wild Cotton",
704
+ // "Malvales",
705
+ // "1530",
706
+ // "KAG8495680.1",
707
+ // "266",
708
+ // "11.5%",
709
+ // "20.6%"
710
+ // ],
711
+ // "is_heading": false
712
+ // }
713
+ // ]
714
+ // }
715
+ // ]
716
+ // },
717
+ // {
718
+ // "block_type": "heading",
719
+ // "content": "Clinical Significance",
720
+ // "heading_level": 1,
721
+ // "children": [
722
+ // {
723
+ // "block_type": "paragraph",
724
+ // "content": "One study discusses the identification of four novel mutations in the TUBB4A gene associated with [[Laryngeal_dystonia|laryngeal|3|wiki]] and [[Cervical_dystonia|cervical dystonia|4|wiki]], a rare neurological disorder. These mutations were found in several affected families, and the study highlights the complexity of this genetic condition, with evidence of [[Incomplete_penetrance|incomplete penetrance|5|wiki]] in some cases. [[Laryngeal_dystonia|Laryngeal dystonia|6|wiki]], often the initial symptom, is a prominent feature of the disease. Of note, there was presence of a variant in the C19orf47 gene in one family. It was shown that the variant in the gene TUBB4A was more likely to be the source of the phenotype, as C19orf47 has low expression in the brain."
725
+ // }
726
+ // ]
727
+ // },
728
+ // {
729
+ // "block_type": "heading",
730
+ // "content": "References",
731
+ // "heading_level": 1,
732
+ // "children": []
70
733
  // }
71
- // });
72
- // app.get("/local-consolidation", async (req, res) => {
73
- // const concepts_facts = embeddingsResp.concepts_facts;
74
- // let locallyConsolidated = new LocalConsolidation().consolidate(
75
- // concepts_facts,
76
- // "sourceID"
734
+ // ],
735
+ // }`;
736
+ // const fields = [
737
+ // "Sciences",
738
+ // "Technology & Engineering",
739
+ // "Humanities & Cultural Studies",
740
+ // "Social Sciences & Global Studies",
741
+ // "Business & Management",
742
+ // "Health & Medicine",
743
+ // "Environmental Studies & Earth Sciences",
744
+ // "Education, Learning & Personal Development",
745
+ // "Creative & Performing Arts",
746
+ // "Law, Governance & Ethics",
747
+ // "Recreation, Lifestyle & Practical Skills",
748
+ // "Technology & Media Literacy",
749
+ // "Philosophy & Critical Thinking",
750
+ // "Space & Astronomical Sciences",
751
+ // "Agriculture & Food Sciences",
752
+ // "Trades & Craftsmanship",
753
+ // "Reference & Indexing",
754
+ // "Other",
755
+ // ];
756
+ // const generateTypology = new GenerateConceptFacts(
757
+ // new OpenAiService(openAIKey, "o4-mini"),
758
+ // content
77
759
  // );
78
- // res.send(locallyConsolidated);
79
- // });
80
- // app.get("/global-consolidation", async (req, res) => {
81
- // const concepts_facts = embeddingsResp.concepts_facts;
82
- // // let globallyConsolidated = await new GlobalConsolidation().consolidate(
83
- // // concepts_facts,
84
- // // "sourceID",
85
- // // 0.2
86
- // // );
87
- // // let globallyConsolidated = await oeGen.globalConsolidation(
88
- // // concepts_facts,
89
- // // "sourceID",
90
- // // 0.2
91
- // // );
92
- // // res.send(globallyConsolidated);
93
- // });
94
- // app.listen(port, () => {
95
- // console.log(`Example app listening at http://localhost:${port}`);
96
- // });
760
+ // console.log(await generateTypology.generate());
761
+ // })();
762
+ (() => __awaiter(void 0, void 0, void 0, function* () {
763
+ const content = {
764
+ source_id: "123",
765
+ title: "C19orf47",
766
+ type: "wiki",
767
+ headings: [
768
+ "Gene",
769
+ "mRNA",
770
+ "Protein",
771
+ "Homology",
772
+ "Clinical Significance",
773
+ "References",
774
+ ],
775
+ content: [
776
+ {
777
+ block_type: "paragraph",
778
+ content: "**Siv Gun Elisabeth Andersson** (born 1959) is a Swedish [[Evolutionary_biologist|evolutionary biologist|0|wiki]], professor of [[Molecular_evolution|molecular evolution|1|wiki]] at [[Uppsala_University|Uppsala University|2|wiki]]. She is member of both the [[Royal_Swedish_Academy_of_Sciences|Royal Swedish Academy of Sciences|3|wiki]] and of [[Royal_Swedish_Academy_of_Engineering_Sciences|Engineering|4|wiki]]. She is also Head of basic research at the [[Knut_and_Alice_Wallenberg_Foundation|Knut and Alice Wallenberg Foundation|5|wiki]] and has been co-director of the Swedish national center for large-scale research [[Science_for_Life_Laboratory|Science for Life Laboratory|6|wiki]] between 2017 and 2021. Her research focuses on the evolution of [[Bacteria|bacteria|7|wiki]], mainly on intracellular parasites.",
779
+ },
780
+ {
781
+ block_type: "heading",
782
+ content: "Education and career",
783
+ heading_level: 1,
784
+ children: [
785
+ {
786
+ block_type: "paragraph",
787
+ content: "Andersson grew up in [[Horndal|Horndal|8|wiki]], [[Dalarna|Dalarna|9|wiki]]. Her mother was home care assistant and her father was employed in the wood industry. She studied Biology at [[Uppsala_University|Uppsala University|10|wiki]], since the programme was the only one that had a course about [[DNA|DNA|11|wiki]]. She defended her PhD in molecular biology in 1990, under the supervision of [[Charles_Kurland|Charles Kurland|12|wiki]]. She applied for a postdoctoral stipend from [[European_Molecular_Biology_Organization|EMBO|13|wiki]] to continue her research in the United States, but ended up obtaining a research position at the MRC Laboratory of Molecular Biology in [[Cambridge|Cambridge|14|wiki]]. She became professor of molecular evolution in 2000, at the Uppsala University's Evolutionary Biology Center. She was elected at the [[Royal_Swedish_Academy_of_Sciences|Royal Swedish Academy of Sciences|15|wiki]] in 2005.",
788
+ },
789
+ {
790
+ block_type: "paragraph",
791
+ content: "Andersson has been very active in developing the Swedish national center for large-scale research [[Science_for_Life_Laboratory|Science for Life Laboratory|16|wiki]], especially its [[DNA_sequencing|DNA sequencing|17|wiki]] and [[Bioinformatics|bioinformatics|18|wiki]] platforms. She served as Co-director for the center between 2017 and 2021.",
792
+ },
793
+ {
794
+ block_type: "paragraph",
795
+ content: "During the 2020 [[COVID-19_pandemic|COVID-19 pandemic|19|wiki]], she contributed, together with Lars Engstrand and with the financial support of the [[Knut_and_Alice_Wallenberg_Foundation|Knut and Alice Wallenberg Foundation|20|wiki]], to establish the first large-scale testing facility in Sweden",
796
+ },
797
+ ],
798
+ },
799
+ {
800
+ block_type: "heading",
801
+ content: "Research",
802
+ heading_level: 1,
803
+ children: [
804
+ {
805
+ block_type: "paragraph",
806
+ content: "Andersson's research first focused around the role of codon usage in shaping bacterial genomes. After her postdoctoral fellowship, she contributed to sequence one of the first genome of an obligate intracellular parasite, *[[Rickettsia_prowazekii|Rickettsia prowazekii|21|wiki]]*, the causative agent of epidemic typhus.",
807
+ },
808
+ {
809
+ block_type: "paragraph",
810
+ content: "In her later career, her research continued to explore bacteria and their relationships with their different hosts. In particular, she is interested in the genomic consequences of long-term associations of intracellular bacteria. She explored the evolution of *[[Bartonella|Bartonella|22|wiki]]*, *[[Wolbachia|Wolbachia|23|wiki]]*, and [[Planctomycetota|Planctomycetota|24|wiki]], among others.",
811
+ },
812
+ {
813
+ block_type: "paragraph",
814
+ content: "Andersson has published over 200 peer-reviewed articles, and has an [[H-index|h-index|25|wiki]] of 61, as of 2022.",
815
+ },
816
+ ],
817
+ },
818
+ {
819
+ block_type: "heading",
820
+ content: "Notable awards and honors",
821
+ heading_level: 1,
822
+ children: [
823
+ {
824
+ block_type: "paragraph",
825
+ content: "",
826
+ },
827
+ {
828
+ block_type: "list",
829
+ content: [
830
+ {
831
+ block_type: "list_item",
832
+ list_type: "ordered",
833
+ marker: "1.",
834
+ content: "2000 - Member of the [[Royal_Swedish_Academy_of_Engineering_Sciences|Royal Swedish Academy of Engineering Sciences|26|wiki]].",
835
+ },
836
+ {
837
+ block_type: "list_item",
838
+ list_type: "ordered",
839
+ marker: "2.",
840
+ content: '2002 - Letterstedtska prize for very significant investigation, among others for "an article in Nature (1998), which reports the whole genome sequence of the intracellular parasite Rickettsia prowazekii".',
841
+ },
842
+ {
843
+ block_type: "list_item",
844
+ list_type: "ordered",
845
+ marker: "3.",
846
+ content: "2004 - Member of [[European_Molecular_Biology_Organization|EMBO|27|wiki]].",
847
+ },
848
+ {
849
+ block_type: "list_item",
850
+ list_type: "ordered",
851
+ marker: "4.",
852
+ content: "2005 - Member of the [[Royal_Swedish_Academy_of_Sciences|Royal Swedish Academy of Sciences|28|wiki]], number 1514, in the class Biological Sciences.",
853
+ },
854
+ {
855
+ block_type: "list_item",
856
+ list_type: "ordered",
857
+ marker: "5.",
858
+ content: "2005 - [[Göran_Gustafsson_Prize|Göran Gustafsson Prize|29|wiki]] in molecular biology.",
859
+ },
860
+ {
861
+ block_type: "list_item",
862
+ list_type: "ordered",
863
+ marker: "6.",
864
+ content: '2005 - Grant for "excellent research" from the [[Swedish_Research_Council|Swedish Research Council|30|wiki]] of SEK 44 millions (together with Hans Ellegren).',
865
+ },
866
+ {
867
+ block_type: "list_item",
868
+ list_type: "ordered",
869
+ marker: "7.",
870
+ content: "2009 - President of the [[European_Society_for_Evolutionary_Biology|European Society for Evolutionary Biology|31|wiki]] (2009-2011).",
871
+ },
872
+ {
873
+ block_type: "list_item",
874
+ list_type: "ordered",
875
+ marker: "8.",
876
+ content: "2011 - [[Knut_and_Alice_Wallenberg_Foundation|Wallenberg Scholar|32|wiki]].",
877
+ },
878
+ {
879
+ block_type: "list_item",
880
+ list_type: "ordered",
881
+ marker: "9.",
882
+ content: "2017 - Extension of [[Knut_and_Alice_Wallenberg_Foundation|Knut and Alice Wallenberg Foundation|33|wiki]] of SEK 75 millions (together with [[Gunnar_von_Heijne|Gunnar von Heijne|34|wiki]]).",
883
+ },
884
+ ],
885
+ },
886
+ ],
887
+ },
888
+ {
889
+ block_type: "heading",
890
+ content: "References",
891
+ heading_level: 1,
892
+ children: [],
893
+ },
894
+ ],
895
+ };
896
+ const openAIKey = "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";
897
+ const promptForSummary = {
898
+ promptId: "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
899
+ version: "13",
900
+ };
901
+ const promptForConceptFacts = {
902
+ promptId: "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
903
+ version: "6",
904
+ };
905
+ const generationContent = {
906
+ prompt: {
907
+ typology: "", // This will be set in the constructor
908
+ card_generation: "", // This will be set in the constructor
909
+ },
910
+ content: {
911
+ source_id: "6753b14f7bb31d8ccf48ba0a",
912
+ title: "Siv G. E. Andersson",
913
+ type: "text",
914
+ headings: [
915
+ "Education and career",
916
+ "Research",
917
+ "Notable awards and honors",
918
+ "References",
919
+ ],
920
+ content: content.content,
921
+ fields: [
922
+ "Sciences",
923
+ "Technology & Engineering",
924
+ "Humanities & Cultural Studies",
925
+ "Social Sciences & Global Studies",
926
+ "Business & Management",
927
+ ],
928
+ },
929
+ };
930
+ const onlyEverGenerator = new app_1.OnlyEverGenerator(process.env.OPEN_AI_KEY, "o4-mini", generationContent, promptForSummary, promptForConceptFacts);
931
+ const response = yield onlyEverGenerator.generate(true, false);
932
+ }))();
97
933
  //# sourceMappingURL=index.js.map