only_ever_generator 8.4.6 → 8.4.7

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 (119) hide show
  1. package/dist/bootstrap/app.d.ts +6 -3
  2. package/dist/bootstrap/app.d.ts.map +1 -1
  3. package/dist/bootstrap/app.js +11 -17
  4. package/dist/bootstrap/app.js.map +1 -1
  5. package/dist/card_gen/generate_cards.d.ts +2 -3
  6. package/dist/card_gen/generate_cards.d.ts.map +1 -1
  7. package/dist/card_gen/generate_cards.js +22 -15
  8. package/dist/card_gen/generate_cards.js.map +1 -1
  9. package/dist/constants/prompt_data.d.ts +4 -4
  10. package/dist/constants/prompt_data.js +302 -302
  11. package/dist/constants/prompts/card_gen_prompt.js +160 -160
  12. package/dist/constants/prompts/typology_prompt.js +131 -131
  13. package/dist/constants/source_data.d.ts +171 -171
  14. package/dist/constants/source_data.js +973 -973
  15. package/dist/embedding_generation/local_consolidation.js +104 -104
  16. package/dist/helper/build_concept_facts_schema.d.ts +42 -42
  17. package/dist/helper/build_concept_facts_schema.js +44 -44
  18. package/dist/helper/qdrant_db_methods.d.ts.map +1 -1
  19. package/dist/helper/schema_helper/build_card_schema.d.ts +1 -9
  20. package/dist/helper/schema_helper/build_card_schema.d.ts.map +1 -1
  21. package/dist/helper/schema_helper/build_card_schema.js +47 -50
  22. package/dist/helper/schema_helper/build_card_schema.js.map +1 -1
  23. package/dist/helper/schema_helper/build_concept_facts_schema.d.ts +1 -1
  24. package/dist/helper/schema_helper/build_concept_facts_schema.d.ts.map +1 -1
  25. package/dist/helper/schema_helper/build_concept_facts_schema.js +20 -5
  26. package/dist/helper/schema_helper/build_concept_facts_schema.js.map +1 -1
  27. package/dist/helper/schema_helper/build_summary_schema.d.ts +1 -1
  28. package/dist/helper/schema_helper/build_summary_schema.d.ts.map +1 -1
  29. package/dist/helper/schema_helper/build_summary_schema.js +18 -7
  30. package/dist/helper/schema_helper/build_summary_schema.js.map +1 -1
  31. package/dist/index.d.ts +0 -2
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +10 -9
  34. package/dist/index.js.map +1 -1
  35. package/dist/parse/response_format_card.d.ts +176 -176
  36. package/dist/parse/response_format_card.js +371 -371
  37. package/dist/parse/response_format_typology.d.ts +1 -1
  38. package/dist/parse/response_format_typology.js +46 -46
  39. package/dist/services/get_prompts.d.ts +8 -7
  40. package/dist/services/get_prompts.d.ts.map +1 -1
  41. package/dist/services/get_prompts.js +69 -21
  42. package/dist/services/get_prompts.js.map +1 -1
  43. package/dist/typology_gen/generate_concept_facts.d.ts +2 -3
  44. package/dist/typology_gen/generate_concept_facts.d.ts.map +1 -1
  45. package/dist/typology_gen/generate_concept_facts.js +25 -15
  46. package/dist/typology_gen/generate_concept_facts.js.map +1 -1
  47. package/dist/typology_gen/generate_typology.d.ts +2 -1
  48. package/dist/typology_gen/generate_typology.d.ts.map +1 -1
  49. package/dist/typology_gen/generate_typology.js +24 -13
  50. package/dist/typology_gen/generate_typology.js.map +1 -1
  51. package/dist/typology_gen/summarize.d.ts +2 -3
  52. package/dist/typology_gen/summarize.d.ts.map +1 -1
  53. package/dist/typology_gen/summarize.js +24 -13
  54. package/dist/typology_gen/summarize.js.map +1 -1
  55. package/package.json +39 -38
  56. package/src/bootstrap/app.ts +418 -416
  57. package/src/card_gen/generate_cards.ts +347 -345
  58. package/src/config.ts +11 -11
  59. package/src/constants/api_constants.ts +7 -7
  60. package/src/constants/prompts/card_gen_prompt.ts +164 -164
  61. package/src/constants/prompts/typology_prompt.ts +139 -139
  62. package/src/embedding_generation/consolidation/global_consolidation.ts +96 -96
  63. package/src/embedding_generation/consolidation/local_consolidation.ts +141 -141
  64. package/src/embedding_generation/consolidation/write_consolidated_data.ts +98 -98
  65. package/src/embedding_generation/generate_embeddings.ts +42 -42
  66. package/src/embedding_generation/parse_embedding_response.ts +31 -31
  67. package/src/enums/card_type_enum.ts +6 -6
  68. package/src/gap_fill/calculate_gap_fill.ts +50 -50
  69. package/src/helper/get_id_from_title.ts +33 -33
  70. package/src/helper/mongo_helper.ts +29 -29
  71. package/src/helper/openai_helper.ts +20 -20
  72. package/src/helper/qdrant_db_methods.ts +77 -77
  73. package/src/helper/schema_helper/build_card_schema.ts +74 -98
  74. package/src/helper/schema_helper/build_classify_summarize_schema.ts +43 -43
  75. package/src/helper/schema_helper/build_concept_facts_schema.ts +45 -31
  76. package/src/helper/schema_helper/build_summary_schema.ts +43 -32
  77. package/src/index.ts +71 -73
  78. package/src/logger.ts +65 -65
  79. package/src/parse/parse_card/parse_cloze_card.ts +146 -146
  80. package/src/parse/parse_card/parse_flash_cards.ts +42 -42
  81. package/src/parse/parse_card/parse_match_card.ts +104 -104
  82. package/src/parse/parse_card/parse_mcq_card.ts +114 -114
  83. package/src/parse/parse_card_response.ts +197 -197
  84. package/src/parse/parse_source_content.ts +212 -212
  85. package/src/services/get_prompts.ts +164 -112
  86. package/src/services/open_ai_service.ts +89 -89
  87. package/src/services/qdrant_service.ts +10 -10
  88. package/src/types/base_param_type.ts +13 -13
  89. package/src/types/mongo_concept_fact_type.ts +12 -12
  90. package/src/types/parsed_card_type.ts +39 -39
  91. package/src/types/raw_card_response_types/generated_card_response_type.ts +59 -59
  92. package/src/types/source_taxonomy_type.ts +24 -24
  93. package/src/typology-parsed-response.ts +1932 -1932
  94. package/src/typology_gen/generate_concept_facts.ts +180 -169
  95. package/src/typology_gen/generate_typology.ts +203 -189
  96. package/src/typology_gen/summarize.ts +176 -164
  97. package/src/utils/distributed_quote_restoration.ts +80 -80
  98. package/src/utils/generate_args.ts +29 -29
  99. package/src/utils/parse_openai_response.ts +19 -19
  100. package/src/utils/sanitize_strings.ts +65 -65
  101. package/tsconfig.json +16 -16
  102. package/dist/constants/default_generation_variables.d.ts +0 -3
  103. package/dist/constants/default_generation_variables.d.ts.map +0 -1
  104. package/dist/constants/default_generation_variables.js +0 -580
  105. package/dist/constants/default_generation_variables.js.map +0 -1
  106. package/dist/services/prompts_test.d.ts +0 -10
  107. package/dist/services/prompts_test.d.ts.map +0 -1
  108. package/dist/services/prompts_test.js +0 -227
  109. package/dist/services/prompts_test.js.map +0 -1
  110. package/dist/types/generation_variables_schema.d.ts +0 -14
  111. package/dist/types/generation_variables_schema.d.ts.map +0 -1
  112. package/dist/types/generation_variables_schema.js +0 -3
  113. package/dist/types/generation_variables_schema.js.map +0 -1
  114. package/dist/utils/test.d.ts +0 -2
  115. package/dist/utils/test.d.ts.map +0 -1
  116. package/dist/utils/test.js +0 -5
  117. package/dist/utils/test.js.map +0 -1
  118. package/src/constants/default_generation_variables.ts +0 -624
  119. package/src/types/generation_variables_schema.ts +0 -16
@@ -1,112 +1,164 @@
1
- import { setUpMongoClient, ObjectId } from "../helper/mongo_helper";
2
-
3
- export const promptIds = {
4
- classify: "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
5
- conceptFacts: "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
6
- cardGeneration: "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6",
7
- missingConceptsFacts: "pmpt_687ab50298dc8194b214804999d23df10e03b855371691f9",
8
- summarize: "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd",
9
- };
10
-
11
- const cardGenInstructionsDocs = {
12
- cloze: "6780d21318f81be17e39f5c1",
13
- flash: "6780d21318f81be17e39f5d2",
14
- match: "6780d21318f81be17e39f5d3",
15
- mcq: "6780d21318f81be17e39f5d4",
16
- };
17
-
18
- const cardGenExamplesDocs = {
19
- cloze: "688af4e5299b7c2c08a52fbe",
20
- flash: "688af4e5299b7c2c08a52fcd",
21
- match: "688af4e5299b7c2c08a52fce",
22
- mcq: "688af4e5299b7c2c08a52fde",
23
- };
24
-
25
- const bloomInstructionsDocs = {
26
- bloom_1: "6780d21318f81be17e39f5b5",
27
- };
28
-
29
- export const getPrompts = async (
30
- sourceType: string,
31
- cardGenerationType: string[]
32
- ) => {
33
- // const typologyDocs = JSON.parse(baseConfig.typologyPrompts);
34
- // const cardGenerationDocs = JSON.parse(baseConfig.cardGenerationPrompts);
35
- // const videoTypologyDocs = JSON.parse(baseConfig.videoTypologyPrompts);
36
- // const typologyObjectIds = Object.values(typologyDocs).map((e: any) =>
37
- // ObjectId.createFromHexString(e.toString())
38
- // );
39
- // const cardGenObjectIds = Object.values(cardGenDocs).map((e: any) =>
40
- // ObjectId.createFromHexString(e)
41
- // );
42
- // const typologyVideoObjectIds = Object.values(videoTypologyDocs).map(
43
- // (e: any) => ObjectId.createFromHexString(e)
44
- // );
45
-
46
- // Filter card generation instructions and examples based on cardGenerationType array
47
- const filteredCardGenInstructions: Record<string, string> = {};
48
- const filteredCardGenExamples: Record<string, string> = {};
49
-
50
- cardGenerationType.forEach((type) => {
51
- if (cardGenInstructionsDocs[type as keyof typeof cardGenInstructionsDocs]) {
52
- filteredCardGenInstructions[type] =
53
- cardGenInstructionsDocs[type as keyof typeof cardGenInstructionsDocs];
54
- }
55
- if (cardGenExamplesDocs[type as keyof typeof cardGenExamplesDocs]) {
56
- filteredCardGenExamples[type] =
57
- cardGenExamplesDocs[type as keyof typeof cardGenExamplesDocs];
58
- }
59
- });
60
-
61
- const cardGenInstructionsObjectIds = Object.values(
62
- filteredCardGenInstructions
63
- ).map((e: any) => ObjectId.createFromHexString(e));
64
- const cardGenExamplesObjectIds = Object.values(filteredCardGenExamples).map(
65
- (e: any) => ObjectId.createFromHexString(e)
66
- );
67
- const bloomInstructionsObjectIds = Object.values(bloomInstructionsDocs).map(
68
- (e: any) => ObjectId.createFromHexString(e)
69
- );
70
-
71
- const cardInstructions = await getPromptString(cardGenInstructionsObjectIds);
72
- const cardExamples = await getPromptString(cardGenExamplesObjectIds);
73
- const bloomInstructions = await getPromptString(bloomInstructionsObjectIds);
74
- return {
75
- card_instructions: cardInstructions,
76
- card_examples: cardExamples,
77
- bloom_instructions: bloomInstructions,
78
- };
79
-
80
- async function getPromptString(promptIds: ObjectId[]) {
81
- const database = await setUpMongoClient();
82
- let result = await database
83
- .collection("_prompts")
84
- .aggregate([
85
- {
86
- $match: {
87
- _id: { $in: promptIds },
88
- },
89
- },
90
- {
91
- $group: {
92
- _id: null,
93
- allContent: { $push: "$prompt" },
94
- },
95
- },
96
- {
97
- /// concat each element in above created `allContent temp field`, and update that to "concatenatedContent"(temp field)
98
- $project: {
99
- concatenatedContent: {
100
- $reduce: {
101
- input: "$allContent",
102
- initialValue: "",
103
- in: { $concat: ["$$value", "$$this"] },
104
- },
105
- },
106
- },
107
- },
108
- ])
109
- .toArray();
110
- return result.length > 0 ? result[0].concatenatedContent : "";
111
- }
112
- };
1
+ import { setUpMongoClient, ObjectId } from "../helper/mongo_helper";
2
+ const typologyDocs = {
3
+ role: "676528fc59c0563f42607add",
4
+ input: "6765298059c0563f42607ade",
5
+ steps: "6765298b59c0563f42607adf",
6
+ schema: "6765299559c0563f42607ae0",
7
+ fields: "676529a259c0563f42607ae1",
8
+ concepts: "676529b759c0563f42607ae2",
9
+ facts: "67652b1659c0563f42607aea",
10
+ generate: "676529c259c0563f42607ae3",
11
+ summarize: "676529d259c0563f42607ae4",
12
+ };
13
+
14
+ const cardGenDocs = {
15
+ role: "676526c959c0563f42607ad4",
16
+ inputs: "676526c959c0563f42607ad5",
17
+ steps: "676526c959c0563f42607ad6",
18
+ schema: "676526c959c0563f42607ad7",
19
+ cloze: "6765270859c0563f42607ad8",
20
+ flash: "6765274159c0563f42607ad9",
21
+ match: "6765276959c0563f42607adb",
22
+ mcq: "6765275f59c0563f42607ada",
23
+ coverage: "6765277a59c0563f42607adc",
24
+ };
25
+
26
+ const videoTypologyDocs = {
27
+ role: "676529e259c0563f42607ae5",
28
+ inputs: "676529f059c0563f42607ae6",
29
+ steps: "6765298b59c0563f42607adf",
30
+ schema: "67652a2559c0563f42607ae7",
31
+ fields: "676529a259c0563f42607ae1",
32
+ concepts: "67652a3459c0563f42607ae8",
33
+ facts: "67652a4459c0563f42607ae9",
34
+ generate: "676529c259c0563f42607ae3",
35
+ summarize: "676529d259c0563f42607ae4",
36
+ };
37
+
38
+ const cardGenInstructionsDocs = {
39
+ cloze: "6780d21318f81be17e39f5c1",
40
+ flash: "6780d21318f81be17e39f5d2",
41
+ match: "6780d21318f81be17e39f5d3",
42
+ mcq: "6780d21318f81be17e39f5d4",
43
+ };
44
+
45
+ const cardGenExamplesDocs = {
46
+ cloze: "688af4e5299b7c2c08a52fbe",
47
+ flash: "688af4e5299b7c2c08a52fcd",
48
+ match: "688af4e5299b7c2c08a52fce",
49
+ mcq: "688af4e5299b7c2c08a52fde",
50
+ };
51
+
52
+ const bloomInstructionsDocs = {
53
+ bloom_1: "6780d21318f81be17e39f5b5",
54
+ };
55
+
56
+ export const getPrompts = async (
57
+ sourceType: string,
58
+ cardGenerationType: string[]
59
+ ) => {
60
+ // const typologyDocs = JSON.parse(baseConfig.typologyPrompts);
61
+ // const cardGenerationDocs = JSON.parse(baseConfig.cardGenerationPrompts);
62
+ // const videoTypologyDocs = JSON.parse(baseConfig.videoTypologyPrompts);
63
+ const typologyObjectIds = Object.values(typologyDocs).map((e: any) =>
64
+ ObjectId.createFromHexString(e.toString())
65
+ );
66
+ const cardGenObjectIds = Object.values(cardGenDocs).map((e: any) =>
67
+ ObjectId.createFromHexString(e)
68
+ );
69
+ const typologyVideoObjectIds = Object.values(videoTypologyDocs).map(
70
+ (e: any) => ObjectId.createFromHexString(e)
71
+ );
72
+
73
+ // Filter card generation instructions and examples based on cardGenerationType array
74
+ const filteredCardGenInstructions: Record<string, string> = {};
75
+ const filteredCardGenExamples: Record<string, string> = {};
76
+
77
+ cardGenerationType.forEach((type) => {
78
+ if (cardGenInstructionsDocs[type as keyof typeof cardGenInstructionsDocs]) {
79
+ filteredCardGenInstructions[type] =
80
+ cardGenInstructionsDocs[type as keyof typeof cardGenInstructionsDocs];
81
+ }
82
+ if (cardGenExamplesDocs[type as keyof typeof cardGenExamplesDocs]) {
83
+ filteredCardGenExamples[type] =
84
+ cardGenExamplesDocs[type as keyof typeof cardGenExamplesDocs];
85
+ }
86
+ });
87
+
88
+ const cardGenInstructionsObjectIds = Object.values(
89
+ filteredCardGenInstructions
90
+ ).map((e: any) => ObjectId.createFromHexString(e));
91
+ const cardGenExamplesObjectIds = Object.values(filteredCardGenExamples).map(
92
+ (e: any) => ObjectId.createFromHexString(e)
93
+ );
94
+ const bloomInstructionsObjectIds = Object.values(bloomInstructionsDocs).map(
95
+ (e: any) => ObjectId.createFromHexString(e)
96
+ );
97
+ const typology = await getPromptString(typologyObjectIds);
98
+ const card_generation = await getPromptString(cardGenObjectIds);
99
+ const video_typology = await getPromptString(typologyVideoObjectIds);
100
+ const cardInstructions = await getPromptString(cardGenInstructionsObjectIds);
101
+ const cardExamples = await getPromptString(cardGenExamplesObjectIds);
102
+ const bloomInstructions = await getPromptString(bloomInstructionsObjectIds);
103
+ if (sourceType === "video") {
104
+ return {
105
+ typology: {
106
+ prompt: video_typology,
107
+ ids: Object.values(videoTypologyDocs),
108
+ },
109
+ card_gen: {
110
+ prompt: card_generation,
111
+ ids: Object.values(cardGenDocs),
112
+ },
113
+ card_instructions: cardInstructions,
114
+ card_examples: cardExamples,
115
+ bloom_instructions: bloomInstructions,
116
+ };
117
+ } else {
118
+ return {
119
+ typology: {
120
+ prompt: typology,
121
+ ids: Object.values(typologyDocs),
122
+ },
123
+ card_gen: {
124
+ prompt: card_generation,
125
+ ids: Object.values(cardGenDocs),
126
+ },
127
+ card_instructions: cardInstructions,
128
+ card_examples: cardExamples,
129
+ bloom_instructions: bloomInstructions,
130
+ };
131
+ }
132
+ async function getPromptString(promptIds: ObjectId[]) {
133
+ const database = await setUpMongoClient();
134
+ let result = await database
135
+ .collection("_prompts")
136
+ .aggregate([
137
+ {
138
+ $match: {
139
+ _id: { $in: promptIds },
140
+ },
141
+ },
142
+ {
143
+ $group: {
144
+ _id: null,
145
+ allContent: { $push: "$prompt" },
146
+ },
147
+ },
148
+ {
149
+ /// concat each element in above created `allContent temp field`, and update that to "concatenatedContent"(temp field)
150
+ $project: {
151
+ concatenatedContent: {
152
+ $reduce: {
153
+ input: "$allContent",
154
+ initialValue: "",
155
+ in: { $concat: ["$$value", "$$this"] },
156
+ },
157
+ },
158
+ },
159
+ },
160
+ ])
161
+ .toArray();
162
+ return result.length > 0 ? result[0].concatenatedContent : "";
163
+ }
164
+ };
@@ -1,89 +1,89 @@
1
- import axios from "axios";
2
- import {
3
- parseOpenAiFailureResponse,
4
- parseOpenAiSuccessResponse,
5
- } from "../utils/parse_openai_response";
6
- import {
7
- openAiEmbeddingEndPoint,
8
- openAiEndPoint,
9
- } from "../constants/api_constants";
10
-
11
- export class OpenAiService {
12
- public api_key: string;
13
- public model: string;
14
-
15
- constructor(apiKey: string, model: string) {
16
- this.api_key = apiKey;
17
- this.model = model;
18
- }
19
-
20
- async sendRequest(prompt: string, content: string) {
21
- try {
22
- let message = [
23
- {
24
- role: "system",
25
- content: prompt,
26
- },
27
- {
28
- role: "user",
29
- content: content,
30
- },
31
- ];
32
- const url = openAiEndPoint();
33
- let response = await axios.post(
34
- url,
35
- {
36
- model: this.model,
37
- messages: message,
38
- response_format: { type: "json_object" },
39
- },
40
- {
41
- headers: {
42
- Authorization: "Bearer " + this.api_key,
43
- "Content-Type": ["application/json"],
44
- },
45
- }
46
- );
47
-
48
- if (response.status == 200) {
49
- console.log("success");
50
- return parseOpenAiSuccessResponse(response.data) as any;
51
- } else {
52
- console.log("failed");
53
- return response.statusText as any;
54
- }
55
- } catch (err: any) {
56
- return parseOpenAiFailureResponse(err.response);
57
- }
58
- }
59
-
60
- async sendEmbeddingRequest(texts: string[]) {
61
- try {
62
- const url = openAiEmbeddingEndPoint();
63
- let response = await axios.post(
64
- url,
65
- {
66
- model: "text-embedding-3-large",
67
- input: texts,
68
- dimensions: 512,
69
- },
70
- {
71
- headers: {
72
- Authorization: "Bearer " + this.api_key,
73
- "Content-Type": ["application/json"],
74
- },
75
- }
76
- );
77
- return {
78
- status_code: 200,
79
- data: response.data,
80
- };
81
- } catch (err: any) {
82
- console.log(err);
83
- return {
84
- status_code: err.response.status ?? 500,
85
- message: err.message,
86
- };
87
- }
88
- }
89
- }
1
+ import axios from "axios";
2
+ import {
3
+ parseOpenAiFailureResponse,
4
+ parseOpenAiSuccessResponse,
5
+ } from "../utils/parse_openai_response";
6
+ import {
7
+ openAiEmbeddingEndPoint,
8
+ openAiEndPoint,
9
+ } from "../constants/api_constants";
10
+
11
+ export class OpenAiService {
12
+ public api_key: string;
13
+ public model: string;
14
+
15
+ constructor(apiKey: string, model: string) {
16
+ this.api_key = apiKey;
17
+ this.model = model;
18
+ }
19
+
20
+ async sendRequest(prompt: string, content: string) {
21
+ try {
22
+ let message = [
23
+ {
24
+ role: "system",
25
+ content: prompt,
26
+ },
27
+ {
28
+ role: "user",
29
+ content: content,
30
+ },
31
+ ];
32
+ const url = openAiEndPoint();
33
+ let response = await axios.post(
34
+ url,
35
+ {
36
+ model: this.model,
37
+ messages: message,
38
+ response_format: { type: "json_object" },
39
+ },
40
+ {
41
+ headers: {
42
+ Authorization: "Bearer " + this.api_key,
43
+ "Content-Type": ["application/json"],
44
+ },
45
+ }
46
+ );
47
+
48
+ if (response.status == 200) {
49
+ console.log("success");
50
+ return parseOpenAiSuccessResponse(response.data) as any;
51
+ } else {
52
+ console.log("failed");
53
+ return response.statusText as any;
54
+ }
55
+ } catch (err: any) {
56
+ return parseOpenAiFailureResponse(err.response);
57
+ }
58
+ }
59
+
60
+ async sendEmbeddingRequest(texts: string[]) {
61
+ try {
62
+ const url = openAiEmbeddingEndPoint();
63
+ let response = await axios.post(
64
+ url,
65
+ {
66
+ model: "text-embedding-3-large",
67
+ input: texts,
68
+ dimensions: 512,
69
+ },
70
+ {
71
+ headers: {
72
+ Authorization: "Bearer " + this.api_key,
73
+ "Content-Type": ["application/json"],
74
+ },
75
+ }
76
+ );
77
+ return {
78
+ status_code: 200,
79
+ data: response.data,
80
+ };
81
+ } catch (err: any) {
82
+ console.log(err);
83
+ return {
84
+ status_code: err.response.status ?? 500,
85
+ message: err.message,
86
+ };
87
+ }
88
+ }
89
+ }
@@ -1,10 +1,10 @@
1
- import { QdrantClient } from "@qdrant/js-client-rest";
2
- import config from "../config";
3
-
4
- // or connect to Qdrant Cloud
5
- const qdrantClient = new QdrantClient({
6
- url: config.qdrantUrl,
7
- apiKey: config.qdrantApiKey,
8
- });
9
-
10
- export default qdrantClient;
1
+ import { QdrantClient } from "@qdrant/js-client-rest";
2
+ import config from "../config";
3
+
4
+ // or connect to Qdrant Cloud
5
+ const qdrantClient = new QdrantClient({
6
+ url: config.qdrantUrl,
7
+ apiKey: config.qdrantApiKey,
8
+ });
9
+
10
+ export default qdrantClient;
@@ -1,13 +1,13 @@
1
- import { SourceTaxonomy } from "./source_taxonomy_type";
2
-
3
- export type BaseParamType = {
4
- content: {
5
- source_id: string;
6
- title: string;
7
- headings: string[];
8
- content: any[];
9
- fields: string[];
10
- taxonomy?: SourceTaxonomy;
11
- type: string;
12
- };
13
- };
1
+ import { SourceTaxonomy } from "./source_taxonomy_type";
2
+
3
+ export type BaseParamType = {
4
+ content: {
5
+ source_id: string;
6
+ title: string;
7
+ headings: string[];
8
+ content: any[];
9
+ fields: string[];
10
+ taxonomy?: SourceTaxonomy;
11
+ type: string;
12
+ };
13
+ };
@@ -1,12 +1,12 @@
1
- export type MongoConceptFactSource = {
2
- text: string;
3
- type: "concept" | "fact";
4
- reference: string;
5
- id: string;
6
- };
7
-
8
- export type MongoConceptFactCards = {
9
- text: string;
10
- type: "concept" | "fact";
11
- id: string;
12
- };
1
+ export type MongoConceptFactSource = {
2
+ text: string;
3
+ type: "concept" | "fact";
4
+ reference: string;
5
+ id: string;
6
+ };
7
+
8
+ export type MongoConceptFactCards = {
9
+ text: string;
10
+ type: "concept" | "fact";
11
+ id: string;
12
+ };
@@ -1,39 +1,39 @@
1
- export type ParsedCardType = {
2
- type: {
3
- category: string;
4
- sub_type: string;
5
- };
6
- heading: string;
7
- displayTitle: string;
8
- content: any;
9
- explanation?: string;
10
- bloom_level?: number;
11
- };
12
-
13
- // {
14
- // "type": {
15
- // "category": "learning",
16
- // "sub_type": "cloze"
17
- // },
18
- // "heading": "",
19
- // "displayTitle": "Ink is a medium that consists of colorants and other {{components}}. ---- components, elements, substances",
20
- // "content": {
21
- // "question": "Ink is a medium that consists of colorants and other {{c0:components}}.",
22
- // "options": [
23
- // {
24
- // "option": "components",
25
- // "cloze": "c0"
26
- // },
27
- // {
28
- // "option": "elements",
29
- // "cloze": "null"
30
- // },
31
- // {
32
- // "option": "substances",
33
- // "cloze": "null"
34
- // }
35
- // ]
36
- // },
37
- // "explanation": "Ink contains various components that include colorants, solvents, and additives which determine its properties.",
38
- // "bloom_level": 1
39
- // },
1
+ export type ParsedCardType = {
2
+ type: {
3
+ category: string;
4
+ sub_type: string;
5
+ };
6
+ heading: string;
7
+ displayTitle: string;
8
+ content: any;
9
+ explanation?: string;
10
+ bloom_level?: number;
11
+ };
12
+
13
+ // {
14
+ // "type": {
15
+ // "category": "learning",
16
+ // "sub_type": "cloze"
17
+ // },
18
+ // "heading": "",
19
+ // "displayTitle": "Ink is a medium that consists of colorants and other {{components}}. ---- components, elements, substances",
20
+ // "content": {
21
+ // "question": "Ink is a medium that consists of colorants and other {{c0:components}}.",
22
+ // "options": [
23
+ // {
24
+ // "option": "components",
25
+ // "cloze": "c0"
26
+ // },
27
+ // {
28
+ // "option": "elements",
29
+ // "cloze": "null"
30
+ // },
31
+ // {
32
+ // "option": "substances",
33
+ // "cloze": "null"
34
+ // }
35
+ // ]
36
+ // },
37
+ // "explanation": "Ink contains various components that include colorants, solvents, and additives which determine its properties.",
38
+ // "bloom_level": 1
39
+ // },