only_ever_generator 8.3.0 → 8.3.1
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/card_gen/generate_cards.d.ts.map +1 -1
- package/dist/card_gen/generate_cards.js.map +1 -1
- package/dist/helper/schema_helper/build_card_schema.d.ts +0 -165
- package/dist/helper/schema_helper/build_card_schema.d.ts.map +1 -1
- package/dist/helper/schema_helper/build_card_schema.js +1 -146
- package/dist/helper/schema_helper/build_card_schema.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/card_gen/generate_cards.ts +1 -4
- package/src/helper/schema_helper/build_card_schema.ts +0 -147
- package/src/index.ts +62 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate_cards.d.ts","sourceRoot":"","sources":["../../src/card_gen/generate_cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"generate_cards.d.ts","sourceRoot":"","sources":["../../src/card_gen/generate_cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B,CAAC;AAGF,MAAM,MAAM,yBAAyB,GAAG,CAAC,qBAAqB,GAAG,SAAS,CAAC,EAAE,CAAC;AAE9E,qBAAa,aAAa;IACxB,aAAa,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IACpB,0BAA0B,EAAE,MAAM,CAAC;IACnC,oBAAoB,EAAE,OAAO,CAAC;gBAEnC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,EAExB,0BAA0B,EAAE,MAAM,EAClC,oBAAoB,EAAE,OAAO,EAC7B,WAAW,EAAE,MAAM;IAYf,cAAc,CAAC,qBAAqB,EAAE,MAAM,EAAE;IA+F9C,aAAa,CACjB,CAAC,EAAE,MAAM,EACT,qBAAqB,EAAE,MAAM,EAAE,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAwC/B,oBAAoB,CACxB,CAAC,EAAE,MAAM,EACT,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAyE7C,SAAS,CAAC,QAAQ,EAAE,GAAG;CAWxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate_cards.js","sourceRoot":"","sources":["../../src/card_gen/generate_cards.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"generate_cards.js","sourceRoot":"","sources":["../../src/card_gen/generate_cards.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAuD;AACvD,iFAA4E;AAC5E,sCAAiE;AACjE,sEAAiE;AAKjE,yDAAqD;AAarD,MAAa,aAAa;IASxB,YACE,aAA4B,EAC5B,QAAgB,EAChB,OAAe,EACf,QAAwB,EAExB,0BAAkC,EAClC,oBAA6B,EAC7B,WAAmB;QAEnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,4B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;gBAChB,MAAM,IAAA,kBAAS,EAAC;oBACd,IAAI,EAAE,IAAI,CAAC,oBAAoB;wBAC7B,CAAC,CAAC,8BAA8B;wBAChC,CAAC,CAAC,mBAAmB;oBACvB,IAAI,EAAE,CAAC;oBACP,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,0BAA0B;oBACjC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,IAAI,EAAE;wBACJ,YAAY,EAAE,OAAO;wBACrB,CAAC,EAAE,CAAC;wBACJ,UAAU,EAAE,oBAAoB;wBAChC,WAAW,EAAE,CAAC;qBACf;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KAAA;IAED,SAAS,CAAC,QAAa;QACrB,IAAI,CAAC;YACH,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC;YACnE,OAAO,cAAc,CAAC;QACxB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,qBAAY,CACpB,0CAA0C,EAC1C,QAAQ,CACT,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA9PD,sCA8PC"}
|
|
@@ -1,167 +1,2 @@
|
|
|
1
1
|
export declare const buildCardSchema: (concepts: string[], facts: string[], card_generation_types: string[]) => Promise<any>;
|
|
2
|
-
export declare const cardSchema: (concepts: string[], facts: string[]) => {
|
|
3
|
-
type: string;
|
|
4
|
-
properties: {
|
|
5
|
-
test_cards: {
|
|
6
|
-
type: string;
|
|
7
|
-
items: {
|
|
8
|
-
type: string;
|
|
9
|
-
properties: {
|
|
10
|
-
type: {
|
|
11
|
-
type: string;
|
|
12
|
-
enum: string[];
|
|
13
|
-
};
|
|
14
|
-
card_content: {
|
|
15
|
-
anyOf: ({
|
|
16
|
-
type: string;
|
|
17
|
-
properties: {
|
|
18
|
-
front: {
|
|
19
|
-
type: string;
|
|
20
|
-
maxLength: number;
|
|
21
|
-
};
|
|
22
|
-
back: {
|
|
23
|
-
type: string;
|
|
24
|
-
maxLength: number;
|
|
25
|
-
};
|
|
26
|
-
prompt?: undefined;
|
|
27
|
-
correct_options?: undefined;
|
|
28
|
-
incorrect_options?: undefined;
|
|
29
|
-
choices?: undefined;
|
|
30
|
-
};
|
|
31
|
-
required: string[];
|
|
32
|
-
additionalProperties: boolean;
|
|
33
|
-
minItems?: undefined;
|
|
34
|
-
maxItems?: undefined;
|
|
35
|
-
items?: undefined;
|
|
36
|
-
} | {
|
|
37
|
-
type: string;
|
|
38
|
-
minItems: number;
|
|
39
|
-
maxItems: number;
|
|
40
|
-
items: {
|
|
41
|
-
anyOf: {
|
|
42
|
-
type: string;
|
|
43
|
-
properties: {
|
|
44
|
-
left_item: {
|
|
45
|
-
type: string;
|
|
46
|
-
maxLength: number;
|
|
47
|
-
};
|
|
48
|
-
right_item: {
|
|
49
|
-
type: string;
|
|
50
|
-
maxLength: number;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
required: string[];
|
|
54
|
-
additionalProperties: boolean;
|
|
55
|
-
}[];
|
|
56
|
-
};
|
|
57
|
-
properties?: undefined;
|
|
58
|
-
required?: undefined;
|
|
59
|
-
additionalProperties?: undefined;
|
|
60
|
-
} | {
|
|
61
|
-
type: string;
|
|
62
|
-
properties: {
|
|
63
|
-
prompt: {
|
|
64
|
-
type: string;
|
|
65
|
-
maxLength: number;
|
|
66
|
-
pattern: string;
|
|
67
|
-
};
|
|
68
|
-
correct_options: {
|
|
69
|
-
type: string;
|
|
70
|
-
minItems: number;
|
|
71
|
-
maxItems: number;
|
|
72
|
-
items: {
|
|
73
|
-
type: string;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
incorrect_options: {
|
|
77
|
-
type: string;
|
|
78
|
-
minItems: number;
|
|
79
|
-
maxItems: number;
|
|
80
|
-
items: {
|
|
81
|
-
type: string;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
front?: undefined;
|
|
85
|
-
back?: undefined;
|
|
86
|
-
choices?: undefined;
|
|
87
|
-
};
|
|
88
|
-
required: string[];
|
|
89
|
-
additionalProperties: boolean;
|
|
90
|
-
minItems?: undefined;
|
|
91
|
-
maxItems?: undefined;
|
|
92
|
-
items?: undefined;
|
|
93
|
-
} | {
|
|
94
|
-
type: string;
|
|
95
|
-
properties: {
|
|
96
|
-
prompt: {
|
|
97
|
-
type: string;
|
|
98
|
-
maxLength: number;
|
|
99
|
-
pattern?: undefined;
|
|
100
|
-
};
|
|
101
|
-
choices: {
|
|
102
|
-
type: string;
|
|
103
|
-
minItems: number;
|
|
104
|
-
maxItems: number;
|
|
105
|
-
items: {
|
|
106
|
-
type: string;
|
|
107
|
-
properties: {
|
|
108
|
-
choice: {
|
|
109
|
-
type: string;
|
|
110
|
-
maxLength: number;
|
|
111
|
-
};
|
|
112
|
-
is_correct: {
|
|
113
|
-
type: string;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
required: string[];
|
|
117
|
-
additionalProperties: boolean;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
front?: undefined;
|
|
121
|
-
back?: undefined;
|
|
122
|
-
correct_options?: undefined;
|
|
123
|
-
incorrect_options?: undefined;
|
|
124
|
-
};
|
|
125
|
-
required: string[];
|
|
126
|
-
additionalProperties: boolean;
|
|
127
|
-
minItems?: undefined;
|
|
128
|
-
maxItems?: undefined;
|
|
129
|
-
items?: undefined;
|
|
130
|
-
})[];
|
|
131
|
-
};
|
|
132
|
-
explanation: {
|
|
133
|
-
type: string;
|
|
134
|
-
maxLength: number;
|
|
135
|
-
description: string;
|
|
136
|
-
};
|
|
137
|
-
concepts: {
|
|
138
|
-
type: string;
|
|
139
|
-
minItems: number;
|
|
140
|
-
items: {
|
|
141
|
-
type: string;
|
|
142
|
-
enum: string[];
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
facts: {
|
|
146
|
-
type: string;
|
|
147
|
-
minItems: number;
|
|
148
|
-
items: {
|
|
149
|
-
type: string;
|
|
150
|
-
enum: string[];
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
bloom_alignment: {
|
|
154
|
-
type: string;
|
|
155
|
-
maxLength: number;
|
|
156
|
-
description: string;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
required: string[];
|
|
160
|
-
additionalProperties: boolean;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
required: string[];
|
|
165
|
-
additionalProperties: boolean;
|
|
166
|
-
};
|
|
167
2
|
//# sourceMappingURL=build_card_schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_card_schema.d.ts","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,EAAE,EAClB,OAAO,MAAM,EAAE,EACf,uBAAuB,MAAM,EAAE,iBA+DhC,CAAC
|
|
1
|
+
{"version":3,"file":"build_card_schema.d.ts","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,EAAE,EAClB,OAAO,MAAM,EAAE,EACf,uBAAuB,MAAM,EAAE,iBA+DhC,CAAC"}
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.buildCardSchema = void 0;
|
|
13
13
|
const sanitize_strings_1 = require("../../utils/sanitize_strings");
|
|
14
14
|
const mongo_helper_1 = require("../mongo_helper");
|
|
15
15
|
// flash:68ef4e1b5a123c94a835c6ab
|
|
@@ -70,149 +70,4 @@ const buildCardSchema = (concepts, facts, card_generation_types) => __awaiter(vo
|
|
|
70
70
|
return populatedSchema;
|
|
71
71
|
});
|
|
72
72
|
exports.buildCardSchema = buildCardSchema;
|
|
73
|
-
const cardSchema = (concepts, facts) => {
|
|
74
|
-
return {
|
|
75
|
-
type: "object",
|
|
76
|
-
properties: {
|
|
77
|
-
test_cards: {
|
|
78
|
-
type: "array",
|
|
79
|
-
items: {
|
|
80
|
-
type: "object",
|
|
81
|
-
properties: {
|
|
82
|
-
type: {
|
|
83
|
-
type: "string",
|
|
84
|
-
enum: ["mcq", "cloze", "match", "flash"],
|
|
85
|
-
},
|
|
86
|
-
card_content: {
|
|
87
|
-
anyOf: [
|
|
88
|
-
// Flash Card
|
|
89
|
-
{
|
|
90
|
-
type: "object",
|
|
91
|
-
properties: {
|
|
92
|
-
front: { type: "string", maxLength: 320 },
|
|
93
|
-
back: { type: "string", maxLength: 320 },
|
|
94
|
-
},
|
|
95
|
-
required: ["front", "back"],
|
|
96
|
-
additionalProperties: false,
|
|
97
|
-
},
|
|
98
|
-
// Match Card
|
|
99
|
-
{
|
|
100
|
-
type: "array",
|
|
101
|
-
minItems: 1,
|
|
102
|
-
maxItems: 9,
|
|
103
|
-
items: {
|
|
104
|
-
anyOf: [
|
|
105
|
-
{
|
|
106
|
-
type: "object",
|
|
107
|
-
properties: {
|
|
108
|
-
left_item: { type: "string", maxLength: 30 },
|
|
109
|
-
right_item: { type: "string", maxLength: 30 },
|
|
110
|
-
},
|
|
111
|
-
required: ["left_item", "right_item"],
|
|
112
|
-
additionalProperties: false,
|
|
113
|
-
},
|
|
114
|
-
// {
|
|
115
|
-
// type: "object",
|
|
116
|
-
// properties: {
|
|
117
|
-
// explanation: { type: "string", maxLength: 320 },
|
|
118
|
-
// },
|
|
119
|
-
// required: ["explanation"],
|
|
120
|
-
// additionalProperties: false,
|
|
121
|
-
// },
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
// Cloze Card
|
|
126
|
-
{
|
|
127
|
-
type: "object",
|
|
128
|
-
properties: {
|
|
129
|
-
prompt: {
|
|
130
|
-
type: "string",
|
|
131
|
-
maxLength: 320,
|
|
132
|
-
pattern: ".*{{.+?}}.*",
|
|
133
|
-
},
|
|
134
|
-
correct_options: {
|
|
135
|
-
type: "array",
|
|
136
|
-
minItems: 1,
|
|
137
|
-
maxItems: 4,
|
|
138
|
-
items: { type: "string" },
|
|
139
|
-
},
|
|
140
|
-
incorrect_options: {
|
|
141
|
-
type: "array",
|
|
142
|
-
minItems: 1,
|
|
143
|
-
maxItems: 7,
|
|
144
|
-
items: { type: "string" },
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
required: ["prompt", "correct_options", "incorrect_options"],
|
|
148
|
-
additionalProperties: false,
|
|
149
|
-
},
|
|
150
|
-
// MCQ Card
|
|
151
|
-
{
|
|
152
|
-
type: "object",
|
|
153
|
-
properties: {
|
|
154
|
-
prompt: { type: "string", maxLength: 320 },
|
|
155
|
-
choices: {
|
|
156
|
-
type: "array",
|
|
157
|
-
minItems: 2,
|
|
158
|
-
maxItems: 8,
|
|
159
|
-
items: {
|
|
160
|
-
type: "object",
|
|
161
|
-
properties: {
|
|
162
|
-
choice: { type: "string", maxLength: 42 },
|
|
163
|
-
is_correct: { type: "boolean" },
|
|
164
|
-
},
|
|
165
|
-
required: ["choice", "is_correct"],
|
|
166
|
-
additionalProperties: false,
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
// explanation: { type: "string", maxLength: 320 },
|
|
170
|
-
},
|
|
171
|
-
required: ["prompt", "choices"],
|
|
172
|
-
additionalProperties: false,
|
|
173
|
-
},
|
|
174
|
-
],
|
|
175
|
-
},
|
|
176
|
-
explanation: {
|
|
177
|
-
type: "string",
|
|
178
|
-
maxLength: 320,
|
|
179
|
-
description: "Explanation for the card (≤320 characters). " +
|
|
180
|
-
"If no useful explanation exists, return an empty string. " +
|
|
181
|
-
"Include only if it helps the learner understand the concept(s) or fact(s) being tested. " +
|
|
182
|
-
"Do not explain anything unrelated, repeat answers verbatim, or add meta-comments. " +
|
|
183
|
-
"Keep it clear and concise; you may draw on personal knowledge where appropriate.",
|
|
184
|
-
},
|
|
185
|
-
concepts: {
|
|
186
|
-
type: "array",
|
|
187
|
-
minItems: 1,
|
|
188
|
-
items: { type: "string", enum: concepts },
|
|
189
|
-
},
|
|
190
|
-
facts: {
|
|
191
|
-
type: "array",
|
|
192
|
-
minItems: 1,
|
|
193
|
-
items: { type: "string", enum: facts },
|
|
194
|
-
},
|
|
195
|
-
bloom_alignment: {
|
|
196
|
-
type: "string",
|
|
197
|
-
maxLength: 240,
|
|
198
|
-
description: "Explain why this card fits the bloom level you were asked to create (max. 240 chars)",
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
required: [
|
|
202
|
-
"type",
|
|
203
|
-
"card_content",
|
|
204
|
-
"concepts",
|
|
205
|
-
"facts",
|
|
206
|
-
"bloom_alignment",
|
|
207
|
-
"explanation",
|
|
208
|
-
],
|
|
209
|
-
additionalProperties: false,
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
required: ["test_cards"],
|
|
214
|
-
additionalProperties: false,
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
exports.cardSchema = cardSchema;
|
|
218
73
|
//# sourceMappingURL=build_card_schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_card_schema.js","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAAwE;AACxE,kDAA4D;AAE5D,iCAAiC;AACjC,iCAAiC;AACjC,+BAA+B;AAC/B,iCAAiC;AAC1B,MAAM,eAAe,GAAG,CAC7B,QAAkB,EAClB,KAAe,EACf,qBAA+B,EAC/B,EAAE;IACF,IAAA,oBAAK,GAAE,CAAC;IACR,MAAM,QAAQ,GAAG,IAAI,uBAAQ,CAAC,0BAA0B,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,MAAM,uBAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QAC9D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MAAM,CAAC,CAAC;IAC3C,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;QAC/E,iBAAiB,CAAC;IACpB,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;QAC5E,cAAc,CAAC;IAEjB,iEAAiE;IACjE,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI;QACrE,qBAAqB,CAAC;IAExB,iEAAiE;IACjE,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY;YACxE;gBACE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;aACtC,CAAC;IACN,CAAC;IAED,OAAO,CAAC,GAAG,CACT,kBAAkB,EAClB,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAC5E,CAAC;IACF,OAAO,eAAe,CAAC;AACzB,CAAC,CAAA,CAAC;AAlEW,QAAA,eAAe,mBAkE1B
|
|
1
|
+
{"version":3,"file":"build_card_schema.js","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAAwE;AACxE,kDAA4D;AAE5D,iCAAiC;AACjC,iCAAiC;AACjC,+BAA+B;AAC/B,iCAAiC;AAC1B,MAAM,eAAe,GAAG,CAC7B,QAAkB,EAClB,KAAe,EACf,qBAA+B,EAC/B,EAAE;IACF,IAAA,oBAAK,GAAE,CAAC;IACR,MAAM,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I,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;IACH,CAAC;IAED,4CAA4C;IAC5C,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;QAC/E,iBAAiB,CAAC;IACpB,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;QAC5E,cAAc,CAAC;IAEjB,iEAAiE;IACjE,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI;QACrE,qBAAqB,CAAC;IAExB,iEAAiE;IACjE,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY;YACxE;gBACE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;aACtC,CAAC;IACN,CAAC;IAED,OAAO,CAAC,GAAG,CACT,kBAAkB,EAClB,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAC5E,CAAC;IACF,OAAO,eAAe,CAAC;AACzB,CAAC,CAAA,CAAC;AAlEW,QAAA,eAAe,mBAkE1B"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,4 +3,60 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OnlyEverGenerator = void 0;
|
|
4
4
|
const app_1 = require("./bootstrap/app");
|
|
5
5
|
Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: function () { return app_1.OnlyEverGenerator; } });
|
|
6
|
+
// const app = express();
|
|
7
|
+
// app.get("/generate", async (req, res) => {
|
|
8
|
+
// const source = new ObjectId("69194001ff259051f939457b");
|
|
9
|
+
// setUp();
|
|
10
|
+
// const openAiKey = process.env.OPEN_AI_KEY;
|
|
11
|
+
// const document = await database
|
|
12
|
+
// .collection("_source")
|
|
13
|
+
// .findOne({ _id: source });
|
|
14
|
+
// if (!document) {
|
|
15
|
+
// return res.status(404).json({ error: "Source not found" });
|
|
16
|
+
// }
|
|
17
|
+
// const promptIdForClassify =
|
|
18
|
+
// "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594";
|
|
19
|
+
// const promptIdForConceptFacts =
|
|
20
|
+
// "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8";
|
|
21
|
+
// const promptIdForCardGeneration =
|
|
22
|
+
// "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6";
|
|
23
|
+
// const promptIdForMissingConceptsFacts =
|
|
24
|
+
// "pmpt_687ab50298dc8194b214804999d23df10e03b855371691f9";
|
|
25
|
+
// const promptIdForSummarize =
|
|
26
|
+
// "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
|
|
27
|
+
// // const generationCurriculum = process.env.GENERATION_CURRICULUM;
|
|
28
|
+
// const n = process.env.N;
|
|
29
|
+
// const generationContent = {
|
|
30
|
+
// content: {
|
|
31
|
+
// source_id: document.source_id,
|
|
32
|
+
// title: document.title,
|
|
33
|
+
// headings: document.headings,
|
|
34
|
+
// content: document.content,
|
|
35
|
+
// fields: [],
|
|
36
|
+
// taxonomy: document.taxonomy,
|
|
37
|
+
// type: document.type,
|
|
38
|
+
// },
|
|
39
|
+
// };
|
|
40
|
+
// const generator = new OnlyEverGenerator(
|
|
41
|
+
// openAiKey ?? "",
|
|
42
|
+
// "gpt-4o-mini",
|
|
43
|
+
// generationContent,
|
|
44
|
+
// promptIdForClassify ?? "",
|
|
45
|
+
// promptIdForConceptFacts ?? "",
|
|
46
|
+
// promptIdForCardGeneration ?? "",
|
|
47
|
+
// promptIdForSummarize ?? "",
|
|
48
|
+
// false,
|
|
49
|
+
// 1
|
|
50
|
+
// );
|
|
51
|
+
// const response = await generator.generate(true, true, [
|
|
52
|
+
// "mcq",
|
|
53
|
+
// "cloze",
|
|
54
|
+
// "match",
|
|
55
|
+
// "flash",
|
|
56
|
+
// ]);
|
|
57
|
+
// res.json(response);
|
|
58
|
+
// });
|
|
59
|
+
// app.listen(3000, () => {
|
|
60
|
+
// console.log("Server is running on port 3000");
|
|
61
|
+
// });
|
|
6
62
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoD;AAI3C,kGAJA,uBAAiB,OAIA;AAE1B,yBAAyB;AAEzB,6CAA6C;AAC7C,6DAA6D;AAC7D,aAAa;AACb,+CAA+C;AAC/C,oCAAoC;AACpC,6BAA6B;AAC7B,iCAAiC;AACjC,qBAAqB;AACrB,kEAAkE;AAClE,MAAM;AACN,gCAAgC;AAChC,+DAA+D;AAC/D,oCAAoC;AACpC,+DAA+D;AAC/D,sCAAsC;AACtC,+DAA+D;AAC/D,4CAA4C;AAC5C,+DAA+D;AAC/D,iCAAiC;AACjC,+DAA+D;AAC/D,yEAAyE;AACzE,6BAA6B;AAC7B,gCAAgC;AAChC,iBAAiB;AACjB,uCAAuC;AACvC,+BAA+B;AAC/B,qCAAqC;AACrC,mCAAmC;AACnC,oBAAoB;AACpB,qCAAqC;AACrC,6BAA6B;AAC7B,SAAS;AACT,OAAO;AACP,6CAA6C;AAC7C,uBAAuB;AACvB,qBAAqB;AACrB,yBAAyB;AACzB,iCAAiC;AACjC,qCAAqC;AACrC,uCAAuC;AACvC,kCAAkC;AAClC,aAAa;AACb,QAAQ;AACR,OAAO;AACP,4DAA4D;AAC5D,aAAa;AACb,eAAe;AACf,eAAe;AACf,eAAe;AACf,QAAQ;AACR,wBAAwB;AACxB,MAAM;AAEN,2BAA2B;AAC3B,mDAAmD;AACnD,MAAM"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { OpenAIHelper } from "../helper/openai_helper";
|
|
2
|
-
import {
|
|
3
|
-
buildCardSchema,
|
|
4
|
-
cardSchema,
|
|
5
|
-
} from "../helper/schema_helper/build_card_schema";
|
|
2
|
+
import { buildCardSchema } from "../helper/schema_helper/build_card_schema";
|
|
6
3
|
import { ErrorLogger, log_error, ParsingError } from "../logger";
|
|
7
4
|
import { ParseCardResponse } from "../parse/parse_card_response";
|
|
8
5
|
import { OpenAiService } from "../services/open_ai_service";
|
|
@@ -72,150 +72,3 @@ export const buildCardSchema = async (
|
|
|
72
72
|
);
|
|
73
73
|
return populatedSchema;
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
export const cardSchema = (concepts: string[], facts: string[]) => {
|
|
77
|
-
return {
|
|
78
|
-
type: "object",
|
|
79
|
-
properties: {
|
|
80
|
-
test_cards: {
|
|
81
|
-
type: "array",
|
|
82
|
-
items: {
|
|
83
|
-
type: "object",
|
|
84
|
-
properties: {
|
|
85
|
-
type: {
|
|
86
|
-
type: "string",
|
|
87
|
-
enum: ["mcq", "cloze", "match", "flash"],
|
|
88
|
-
},
|
|
89
|
-
card_content: {
|
|
90
|
-
anyOf: [
|
|
91
|
-
// Flash Card
|
|
92
|
-
{
|
|
93
|
-
type: "object",
|
|
94
|
-
properties: {
|
|
95
|
-
front: { type: "string", maxLength: 320 },
|
|
96
|
-
back: { type: "string", maxLength: 320 },
|
|
97
|
-
},
|
|
98
|
-
required: ["front", "back"],
|
|
99
|
-
additionalProperties: false,
|
|
100
|
-
},
|
|
101
|
-
// Match Card
|
|
102
|
-
{
|
|
103
|
-
type: "array",
|
|
104
|
-
minItems: 1,
|
|
105
|
-
maxItems: 9,
|
|
106
|
-
items: {
|
|
107
|
-
anyOf: [
|
|
108
|
-
{
|
|
109
|
-
type: "object",
|
|
110
|
-
properties: {
|
|
111
|
-
left_item: { type: "string", maxLength: 30 },
|
|
112
|
-
right_item: { type: "string", maxLength: 30 },
|
|
113
|
-
},
|
|
114
|
-
required: ["left_item", "right_item"],
|
|
115
|
-
additionalProperties: false,
|
|
116
|
-
},
|
|
117
|
-
// {
|
|
118
|
-
// type: "object",
|
|
119
|
-
// properties: {
|
|
120
|
-
// explanation: { type: "string", maxLength: 320 },
|
|
121
|
-
// },
|
|
122
|
-
// required: ["explanation"],
|
|
123
|
-
// additionalProperties: false,
|
|
124
|
-
// },
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
// Cloze Card
|
|
129
|
-
{
|
|
130
|
-
type: "object",
|
|
131
|
-
properties: {
|
|
132
|
-
prompt: {
|
|
133
|
-
type: "string",
|
|
134
|
-
maxLength: 320,
|
|
135
|
-
pattern: ".*{{.+?}}.*",
|
|
136
|
-
},
|
|
137
|
-
correct_options: {
|
|
138
|
-
type: "array",
|
|
139
|
-
minItems: 1,
|
|
140
|
-
maxItems: 4,
|
|
141
|
-
items: { type: "string" },
|
|
142
|
-
},
|
|
143
|
-
incorrect_options: {
|
|
144
|
-
type: "array",
|
|
145
|
-
minItems: 1,
|
|
146
|
-
maxItems: 7,
|
|
147
|
-
items: { type: "string" },
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
required: ["prompt", "correct_options", "incorrect_options"],
|
|
151
|
-
additionalProperties: false,
|
|
152
|
-
},
|
|
153
|
-
// MCQ Card
|
|
154
|
-
{
|
|
155
|
-
type: "object",
|
|
156
|
-
properties: {
|
|
157
|
-
prompt: { type: "string", maxLength: 320 },
|
|
158
|
-
choices: {
|
|
159
|
-
type: "array",
|
|
160
|
-
minItems: 2,
|
|
161
|
-
maxItems: 8,
|
|
162
|
-
items: {
|
|
163
|
-
type: "object",
|
|
164
|
-
properties: {
|
|
165
|
-
choice: { type: "string", maxLength: 42 },
|
|
166
|
-
is_correct: { type: "boolean" },
|
|
167
|
-
},
|
|
168
|
-
required: ["choice", "is_correct"],
|
|
169
|
-
additionalProperties: false,
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
// explanation: { type: "string", maxLength: 320 },
|
|
173
|
-
},
|
|
174
|
-
required: ["prompt", "choices"],
|
|
175
|
-
additionalProperties: false,
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
},
|
|
179
|
-
explanation: {
|
|
180
|
-
type: "string",
|
|
181
|
-
maxLength: 320,
|
|
182
|
-
description:
|
|
183
|
-
"Explanation for the card (≤320 characters). " +
|
|
184
|
-
"If no useful explanation exists, return an empty string. " +
|
|
185
|
-
"Include only if it helps the learner understand the concept(s) or fact(s) being tested. " +
|
|
186
|
-
"Do not explain anything unrelated, repeat answers verbatim, or add meta-comments. " +
|
|
187
|
-
"Keep it clear and concise; you may draw on personal knowledge where appropriate.",
|
|
188
|
-
},
|
|
189
|
-
concepts: {
|
|
190
|
-
type: "array",
|
|
191
|
-
minItems: 1,
|
|
192
|
-
items: { type: "string", enum: concepts },
|
|
193
|
-
},
|
|
194
|
-
facts: {
|
|
195
|
-
type: "array",
|
|
196
|
-
minItems: 1,
|
|
197
|
-
items: { type: "string", enum: facts },
|
|
198
|
-
},
|
|
199
|
-
bloom_alignment: {
|
|
200
|
-
type: "string",
|
|
201
|
-
maxLength: 240,
|
|
202
|
-
description:
|
|
203
|
-
"Explain why this card fits the bloom level you were asked to create (max. 240 chars)",
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
required: [
|
|
207
|
-
"type",
|
|
208
|
-
"card_content",
|
|
209
|
-
"concepts",
|
|
210
|
-
"facts",
|
|
211
|
-
"bloom_alignment",
|
|
212
|
-
"explanation",
|
|
213
|
-
],
|
|
214
|
-
additionalProperties: false,
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
required: ["test_cards"],
|
|
219
|
-
additionalProperties: false,
|
|
220
|
-
};
|
|
221
|
-
};
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,65 @@
|
|
|
1
|
+
import express from "express";
|
|
1
2
|
import { OnlyEverGenerator } from "./bootstrap/app";
|
|
3
|
+
import { ObjectId } from "mongodb";
|
|
4
|
+
import { database, setUp } from "./helper/mongo_helper";
|
|
2
5
|
|
|
3
6
|
export { OnlyEverGenerator };
|
|
7
|
+
|
|
8
|
+
// const app = express();
|
|
9
|
+
|
|
10
|
+
// app.get("/generate", async (req, res) => {
|
|
11
|
+
// const source = new ObjectId("69194001ff259051f939457b");
|
|
12
|
+
// setUp();
|
|
13
|
+
// const openAiKey = process.env.OPEN_AI_KEY;
|
|
14
|
+
// const document = await database
|
|
15
|
+
// .collection("_source")
|
|
16
|
+
// .findOne({ _id: source });
|
|
17
|
+
// if (!document) {
|
|
18
|
+
// return res.status(404).json({ error: "Source not found" });
|
|
19
|
+
// }
|
|
20
|
+
// const promptIdForClassify =
|
|
21
|
+
// "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594";
|
|
22
|
+
// const promptIdForConceptFacts =
|
|
23
|
+
// "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8";
|
|
24
|
+
// const promptIdForCardGeneration =
|
|
25
|
+
// "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6";
|
|
26
|
+
// const promptIdForMissingConceptsFacts =
|
|
27
|
+
// "pmpt_687ab50298dc8194b214804999d23df10e03b855371691f9";
|
|
28
|
+
// const promptIdForSummarize =
|
|
29
|
+
// "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
|
|
30
|
+
// // const generationCurriculum = process.env.GENERATION_CURRICULUM;
|
|
31
|
+
// const n = process.env.N;
|
|
32
|
+
// const generationContent = {
|
|
33
|
+
// content: {
|
|
34
|
+
// source_id: document.source_id,
|
|
35
|
+
// title: document.title,
|
|
36
|
+
// headings: document.headings,
|
|
37
|
+
// content: document.content,
|
|
38
|
+
// fields: [],
|
|
39
|
+
// taxonomy: document.taxonomy,
|
|
40
|
+
// type: document.type,
|
|
41
|
+
// },
|
|
42
|
+
// };
|
|
43
|
+
// const generator = new OnlyEverGenerator(
|
|
44
|
+
// openAiKey ?? "",
|
|
45
|
+
// "gpt-4o-mini",
|
|
46
|
+
// generationContent,
|
|
47
|
+
// promptIdForClassify ?? "",
|
|
48
|
+
// promptIdForConceptFacts ?? "",
|
|
49
|
+
// promptIdForCardGeneration ?? "",
|
|
50
|
+
// promptIdForSummarize ?? "",
|
|
51
|
+
// false,
|
|
52
|
+
// 1
|
|
53
|
+
// );
|
|
54
|
+
// const response = await generator.generate(true, true, [
|
|
55
|
+
// "mcq",
|
|
56
|
+
// "cloze",
|
|
57
|
+
// "match",
|
|
58
|
+
// "flash",
|
|
59
|
+
// ]);
|
|
60
|
+
// res.json(response);
|
|
61
|
+
// });
|
|
62
|
+
|
|
63
|
+
// app.listen(3000, () => {
|
|
64
|
+
// console.log("Server is running on port 3000");
|
|
65
|
+
// });
|