only_ever_generator 5.0.2 → 5.0.4
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/helper/schema_helper/build_card_schema.d.ts +1 -0
- package/dist/helper/schema_helper/build_card_schema.d.ts.map +1 -1
- package/dist/helper/schema_helper/build_card_schema.js +9 -1
- package/dist/helper/schema_helper/build_card_schema.js.map +1 -1
- package/dist/index.js +60 -58
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/helper/schema_helper/build_card_schema.ts +10 -1
- package/src/index.ts +60 -55
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_card_schema.d.ts","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"build_card_schema.d.ts","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ItB,CAAC"}
|
|
@@ -103,7 +103,15 @@ exports.cardSchema = {
|
|
|
103
103
|
},
|
|
104
104
|
],
|
|
105
105
|
},
|
|
106
|
-
explanation: {
|
|
106
|
+
explanation: {
|
|
107
|
+
type: "string",
|
|
108
|
+
maxLength: 320,
|
|
109
|
+
description: "Explanation for the card (≤320 characters). " +
|
|
110
|
+
"If no useful explanation exists, return an empty string. " +
|
|
111
|
+
"Include only if it helps the learner understand the concept(s) or fact(s) being tested. " +
|
|
112
|
+
"Do not explain anything unrelated, repeat answers verbatim, or add meta-comments. " +
|
|
113
|
+
"Keep it clear and concise; you may draw on personal knowledge where appropriate.",
|
|
114
|
+
},
|
|
107
115
|
concepts: {
|
|
108
116
|
type: "array",
|
|
109
117
|
items: { type: "string" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_card_schema.js","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;qBACzC;oBACD,YAAY,EAAE;wBACZ,KAAK,EAAE;4BACL,aAAa;4BACb;gCACE,IAAI,EAAE,QAAQ;gCACd,UAAU,EAAE;oCACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;oCACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;iCACzC;gCACD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;gCAC3B,oBAAoB,EAAE,KAAK;6BAC5B;4BACD,aAAa;4BACb;gCACE,IAAI,EAAE,OAAO;gCACb,QAAQ,EAAE,CAAC;gCACX,QAAQ,EAAE,CAAC;gCACX,KAAK,EAAE;oCACL,KAAK,EAAE;wCACL;4CACE,IAAI,EAAE,QAAQ;4CACd,UAAU,EAAE;gDACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;gDAC5C,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;6CAC9C;4CACD,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;4CACrC,oBAAoB,EAAE,KAAK;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oCACD,mDAAmD;iCACpD;gCACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;gCAC/B,oBAAoB,EAAE,KAAK;6BAC5B;yBACF;qBACF;oBACD,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"build_card_schema.js","sourceRoot":"","sources":["../../../src/helper/schema_helper/build_card_schema.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;qBACzC;oBACD,YAAY,EAAE;wBACZ,KAAK,EAAE;4BACL,aAAa;4BACb;gCACE,IAAI,EAAE,QAAQ;gCACd,UAAU,EAAE;oCACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;oCACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;iCACzC;gCACD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;gCAC3B,oBAAoB,EAAE,KAAK;6BAC5B;4BACD,aAAa;4BACb;gCACE,IAAI,EAAE,OAAO;gCACb,QAAQ,EAAE,CAAC;gCACX,QAAQ,EAAE,CAAC;gCACX,KAAK,EAAE;oCACL,KAAK,EAAE;wCACL;4CACE,IAAI,EAAE,QAAQ;4CACd,UAAU,EAAE;gDACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;gDAC5C,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;6CAC9C;4CACD,QAAQ,EAAE,CAAC,WAA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CAAC;4CAClC,oBAAoB,EAAE,KAAK;yCAC5B;qCACF;oCACD,mDAAmD;iCACpD;gCACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;gCAC/B,oBAAoB,EAAE,KAAK;6BAC5B;yBACF;qBACF;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,GAAG;wBACd,WAAW,EACT,8CAA8C;4BAC9C,2DAA2D;4BAC3D,0FAA0F;4BAC1F,oFAAoF;4BACpF,kFAAkF;qBACrF;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC1B;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC1B;oBACD,eAAe,EAAE;wBACf,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,GAAG;wBACd,WAAW,EACT,sFAAsF;qBACzF;iBACF;gBACD,QAAQ,EAAE;oBACR,MAAM;oBACN,cAAc;oBACd,UAAU;oBACV,OAAO;oBACP,iBAAiB;oBACjB,aAAa;iBACd;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,oBAAoB,EAAE,KAAK;CAC5B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,66 +9,68 @@
|
|
|
9
9
|
// import { OpenAiService } from "./services/open_ai_service";
|
|
10
10
|
// import { GenerateConceptFacts } from "./typology_gen/generate_concept_facts";
|
|
11
11
|
// import { BaseParamType } from "./types/base_param_type";
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
13
|
exports.OnlyEverGenerator = void 0;
|
|
23
14
|
const app_1 = require("./bootstrap/app");
|
|
24
15
|
Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: function () { return app_1.OnlyEverGenerator; } });
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
16
|
+
// (async () => {
|
|
17
|
+
// const openAIKey =
|
|
18
|
+
// "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";
|
|
19
|
+
// const promptForSummary = {
|
|
20
|
+
// promptId: "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
|
|
21
|
+
// version: "13",
|
|
22
|
+
// };
|
|
23
|
+
// const promptForConceptFacts = {
|
|
24
|
+
// promptId: "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
|
|
25
|
+
// version: "6",
|
|
26
|
+
// };
|
|
27
|
+
// setUp();
|
|
28
|
+
// const source = await database.collection("_source").findOne({
|
|
29
|
+
// _id: new ObjectId("6753b1d77bb31d8ccf586c2c"),
|
|
30
|
+
// });
|
|
31
|
+
// const contentForGen = {
|
|
32
|
+
// prompt: {
|
|
33
|
+
// typology: "",
|
|
34
|
+
// card_generation: "",
|
|
35
|
+
// },
|
|
36
|
+
// content: {
|
|
37
|
+
// source_id: source?._id?.toString() || "",
|
|
38
|
+
// title: source?.title || "",
|
|
39
|
+
// type: source?.type || "",
|
|
40
|
+
// headings: source?.headings || [],
|
|
41
|
+
// content: source?.content || [],
|
|
42
|
+
// fields: source?.fields || [],
|
|
43
|
+
// taxonomy: source?.generate_cards
|
|
44
|
+
// ? {
|
|
45
|
+
// generate_cards: source?.generate_cards || {
|
|
46
|
+
// state: false,
|
|
47
|
+
// reason: "",
|
|
48
|
+
// },
|
|
49
|
+
// concepts_facts: source?.concepts_facts || [],
|
|
50
|
+
// fields: source?.fields || [],
|
|
51
|
+
// }
|
|
52
|
+
// : undefined,
|
|
53
|
+
// },
|
|
54
|
+
// };
|
|
55
|
+
// const prompts = await getPrompts("text");
|
|
56
|
+
// const bloomInstructions = prompts.bloom_instructions;
|
|
57
|
+
// const cardInstructions = prompts.card_instructions;
|
|
58
|
+
// const cardExamples = prompts.card_examples;
|
|
59
|
+
// console.log("Initializing OnlyEverGenerator");
|
|
60
|
+
// const onlyEverGenerator = new OnlyEverGenerator(
|
|
61
|
+
// process.env.OPEN_AI_KEY as string,
|
|
62
|
+
// "o4-mini",
|
|
63
|
+
// contentForGen,
|
|
64
|
+
// "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
|
|
65
|
+
// "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
|
|
66
|
+
// "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6",
|
|
67
|
+
// {
|
|
68
|
+
// bloom_instructions: bloomInstructions,
|
|
69
|
+
// card_instructions: cardInstructions,
|
|
70
|
+
// card_examples: cardExamples,
|
|
71
|
+
// }
|
|
72
|
+
// );
|
|
73
|
+
// const response = await onlyEverGenerator.generate(true, true);
|
|
74
|
+
// console.log(response);
|
|
75
|
+
// })();
|
|
74
76
|
//# 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":";AAAA,uDAAuD;AACvD,iGAAiG;AACjG,+DAA+D;AAC/D,mGAAmG;AACnG,4FAA4F;AAC5F,yDAAyD;AACzD,uEAAuE;AACvE,8DAA8D;AAC9D,gFAAgF;AAChF,2DAA2D
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,iGAAiG;AACjG,+DAA+D;AAC/D,mGAAmG;AACnG,4FAA4F;AAC5F,yDAAyD;AACzD,uEAAuE;AACvE,8DAA8D;AAC9D,gFAAgF;AAChF,2DAA2D;;;AAE3D,yCAAoD;AAK3C,kGALA,uBAAiB,OAKA;AAE1B,iBAAiB;AACjB,sBAAsB;AACtB,8KAA8K;AAC9K,+BAA+B;AAC/B,yEAAyE;AACzE,qBAAqB;AACrB,OAAO;AACP,oCAAoC;AACpC,yEAAyE;AACzE,oBAAoB;AACpB,OAAO;AAEP,aAAa;AAEb,kEAAkE;AAClE,qDAAqD;AACrD,QAAQ;AAER,4BAA4B;AAC5B,gBAAgB;AAChB,sBAAsB;AACtB,6BAA6B;AAC7B,SAAS;AACT,iBAAiB;AACjB,kDAAkD;AAClD,oCAAoC;AACpC,kCAAkC;AAClC,0CAA0C;AAC1C,wCAAwC;AACxC,sCAAsC;AACtC,yCAAyC;AACzC,cAAc;AACd,0DAA0D;AAC1D,8BAA8B;AAC9B,4BAA4B;AAC5B,iBAAiB;AACjB,4DAA4D;AAC5D,4CAA4C;AAC5C,cAAc;AACd,uBAAuB;AACvB,SAAS;AACT,OAAO;AACP,8CAA8C;AAC9C,0DAA0D;AAC1D,wDAAwD;AACxD,gDAAgD;AAEhD,mDAAmD;AACnD,qDAAqD;AACrD,yCAAyC;AACzC,iBAAiB;AACjB,qBAAqB;AACrB,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAC/D,QAAQ;AACR,+CAA+C;AAC/C,6CAA6C;AAC7C,qCAAqC;AACrC,QAAQ;AACR,OAAO;AACP,mEAAmE;AACnE,2BAA2B;AAC3B,QAAQ"}
|
package/package.json
CHANGED
|
@@ -100,7 +100,16 @@ export const cardSchema = {
|
|
|
100
100
|
},
|
|
101
101
|
],
|
|
102
102
|
},
|
|
103
|
-
explanation: {
|
|
103
|
+
explanation: {
|
|
104
|
+
type: "string",
|
|
105
|
+
maxLength: 320,
|
|
106
|
+
description:
|
|
107
|
+
"Explanation for the card (≤320 characters). " +
|
|
108
|
+
"If no useful explanation exists, return an empty string. " +
|
|
109
|
+
"Include only if it helps the learner understand the concept(s) or fact(s) being tested. " +
|
|
110
|
+
"Do not explain anything unrelated, repeat answers verbatim, or add meta-comments. " +
|
|
111
|
+
"Keep it clear and concise; you may draw on personal knowledge where appropriate.",
|
|
112
|
+
},
|
|
104
113
|
concepts: {
|
|
105
114
|
type: "array",
|
|
106
115
|
items: { type: "string" },
|
package/src/index.ts
CHANGED
|
@@ -16,62 +16,67 @@ import { BaseParamType } from "./types/base_param_type";
|
|
|
16
16
|
|
|
17
17
|
export { OnlyEverGenerator };
|
|
18
18
|
|
|
19
|
-
(async () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
// (async () => {
|
|
20
|
+
// const openAIKey =
|
|
21
|
+
// "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";
|
|
22
|
+
// const promptForSummary = {
|
|
23
|
+
// promptId: "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
|
|
24
|
+
// version: "13",
|
|
25
|
+
// };
|
|
26
|
+
// const promptForConceptFacts = {
|
|
27
|
+
// promptId: "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
|
|
28
|
+
// version: "6",
|
|
29
|
+
// };
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// setUp();
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
// const source = await database.collection("_source").findOne({
|
|
34
|
+
// _id: new ObjectId("6753b1d77bb31d8ccf586c2c"),
|
|
35
|
+
// });
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
// const contentForGen = {
|
|
38
|
+
// prompt: {
|
|
39
|
+
// typology: "",
|
|
40
|
+
// card_generation: "",
|
|
41
|
+
// },
|
|
42
|
+
// content: {
|
|
43
|
+
// source_id: source?._id?.toString() || "",
|
|
44
|
+
// title: source?.title || "",
|
|
45
|
+
// type: source?.type || "",
|
|
46
|
+
// headings: source?.headings || [],
|
|
47
|
+
// content: source?.content || [],
|
|
48
|
+
// fields: source?.fields || [],
|
|
49
|
+
// taxonomy: source?.generate_cards
|
|
50
|
+
// ? {
|
|
51
|
+
// generate_cards: source?.generate_cards || {
|
|
52
|
+
// state: false,
|
|
53
|
+
// reason: "",
|
|
54
|
+
// },
|
|
55
|
+
// concepts_facts: source?.concepts_facts || [],
|
|
56
|
+
// fields: source?.fields || [],
|
|
57
|
+
// }
|
|
58
|
+
// : undefined,
|
|
59
|
+
// },
|
|
60
|
+
// };
|
|
61
|
+
// const prompts = await getPrompts("text");
|
|
62
|
+
// const bloomInstructions = prompts.bloom_instructions;
|
|
63
|
+
// const cardInstructions = prompts.card_instructions;
|
|
64
|
+
// const cardExamples = prompts.card_examples;
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})();
|
|
66
|
+
// console.log("Initializing OnlyEverGenerator");
|
|
67
|
+
// const onlyEverGenerator = new OnlyEverGenerator(
|
|
68
|
+
// process.env.OPEN_AI_KEY as string,
|
|
69
|
+
// "o4-mini",
|
|
70
|
+
// contentForGen,
|
|
71
|
+
// "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
|
|
72
|
+
// "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
|
|
73
|
+
// "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6",
|
|
74
|
+
// {
|
|
75
|
+
// bloom_instructions: bloomInstructions,
|
|
76
|
+
// card_instructions: cardInstructions,
|
|
77
|
+
// card_examples: cardExamples,
|
|
78
|
+
// }
|
|
79
|
+
// );
|
|
80
|
+
// const response = await onlyEverGenerator.generate(true, true);
|
|
81
|
+
// console.log(response);
|
|
82
|
+
// })();
|