only_ever_generator 8.4.3 → 8.4.5

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/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- import { OnlyEverGenerator } from "./bootstrap/app";
2
- export { OnlyEverGenerator };
3
1
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMpD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -1,72 +1,71 @@
1
1
  "use strict";
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
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.OnlyEverGenerator = void 0;
16
- const express_1 = __importDefault(require("express"));
17
- const app_1 = require("./bootstrap/app");
18
- Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: function () { return app_1.OnlyEverGenerator; } });
19
- const mongodb_1 = require("mongodb");
20
- const mongo_helper_1 = require("./helper/mongo_helper");
21
- const default_generation_variables_1 = require("./constants/default_generation_variables");
22
- const app = (0, express_1.default)();
23
- app.get("/generate", (req, res) => __awaiter(void 0, void 0, void 0, function* () {
24
- var _a, _b, _c;
25
- const source = new mongodb_1.ObjectId("692837542bd1597ff832d383");
26
- // setUp();
27
- const database = yield (0, mongo_helper_1.setUpMongoClient)();
28
- const openAiKey = process.env.OPEN_AI_KEY;
29
- const document = yield database
30
- .collection("_source")
31
- .findOne({ _id: source });
32
- if (!document) {
33
- return res.status(404).json({ error: "Source not found" });
34
- }
35
- const promptIdForClassify = "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594";
36
- const promptIdForConceptFacts = "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8";
37
- const promptIdForCardGeneration = "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6";
38
- const promptIdForMissingConceptsFacts = "pmpt_687ab50298dc8194b214804999d23df10e03b855371691f9";
39
- const promptIdForSummarize = "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
40
- // const generationCurriculum = process.env.GENERATION_CURRICULUM;
41
- const n = process.env.N;
42
- const generationContent = {
43
- content: {
44
- source_id: document.source_id,
45
- title: document.title,
46
- headings: document.headings,
47
- content: document.content,
48
- fields: [],
49
- taxonomy: {
50
- concepts_facts: (_a = document.concepts_facts) !== null && _a !== void 0 ? _a : [],
51
- fields: (_b = document.fields) !== null && _b !== void 0 ? _b : [],
52
- summary_cards: (_c = document.summary_cards) !== null && _c !== void 0 ? _c : [],
53
- learn_value: document.learn_value,
54
- },
55
- type: document.type,
56
- },
57
- };
58
- const generationVariablesSchema = default_generation_variables_1.defaultGenerationVariables;
59
- const generator = new app_1.OnlyEverGenerator(openAiKey !== null && openAiKey !== void 0 ? openAiKey : "", "gpt-4o-mini", generationContent, generationVariablesSchema, false, 1);
60
- const response = yield generator.generate(true, true, [
61
- "cloze",
62
- "mcq",
63
- "flash",
64
- "match",
65
- ]);
66
- console.log("Close");
67
- res.json(response);
68
- }));
69
- app.listen(3000, () => {
70
- console.log("Server is running on port 3000");
71
- });
2
+ // import express from "express";
3
+ // import { OnlyEverGenerator } from "./bootstrap/app";
4
+ // import { ObjectId } from "mongodb";
5
+ // import { setUpMongoClient } from "./helper/mongo_helper";
6
+ // import { GenerationVariablesSchema } from "./types/generation_variables_schema";
7
+ // import { defaultGenerationVariables } from "./constants/default_generation_variables";
8
+ // export { OnlyEverGenerator };
9
+ // const app = express();
10
+ // app.get("/generate", async (req, res) => {
11
+ // const source = new ObjectId("692837542bd1597ff832d383");
12
+ // // setUp();
13
+ // const database = await setUpMongoClient();
14
+ // const openAiKey = process.env.OPEN_AI_KEY;
15
+ // const document = await database
16
+ // .collection("_source")
17
+ // .findOne({ _id: source });
18
+ // if (!document) {
19
+ // return res.status(404).json({ error: "Source not found" });
20
+ // }
21
+ // const promptIdForClassify =
22
+ // "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594";
23
+ // const promptIdForConceptFacts =
24
+ // "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8";
25
+ // const promptIdForCardGeneration =
26
+ // "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6";
27
+ // const promptIdForMissingConceptsFacts =
28
+ // "pmpt_687ab50298dc8194b214804999d23df10e03b855371691f9";
29
+ // const promptIdForSummarize =
30
+ // "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
31
+ // // const generationCurriculum = process.env.GENERATION_CURRICULUM;
32
+ // const n = process.env.N;
33
+ // const generationContent = {
34
+ // content: {
35
+ // source_id: document.source_id,
36
+ // title: document.title,
37
+ // headings: document.headings,
38
+ // content: document.content,
39
+ // fields: [],
40
+ // taxonomy: {
41
+ // concepts_facts: document.concepts_facts ?? [],
42
+ // fields: document.fields ?? [],
43
+ // summary_cards: document.summary_cards ?? [],
44
+ // learn_value: document.learn_value,
45
+ // },
46
+ // type: document.type,
47
+ // },
48
+ // };
49
+ // const generationVariablesSchema: GenerationVariablesSchema =
50
+ // defaultGenerationVariables;
51
+ // const generator = new OnlyEverGenerator(
52
+ // openAiKey ?? "",
53
+ // "gpt-4o-mini",
54
+ // generationContent,
55
+ // generationVariablesSchema,
56
+ // false,
57
+ // 1
58
+ // );
59
+ // const response = await generator.generate(true, true, [
60
+ // "cloze",
61
+ // "mcq",
62
+ // "flash",
63
+ // "match",
64
+ // ]);
65
+ // console.log("Close");
66
+ // res.json(response);
67
+ // });
68
+ // app.listen(3000, () => {
69
+ // console.log("Server is running on port 3000");
70
+ // });
72
71
  //# 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,sDAA8B;AAC9B,yCAAoD;AAM3C,kGANA,uBAAiB,OAMA;AAL1B,qCAAmC;AACnC,wDAAyD;AAEzD,2FAAsF;AAItF,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;AAEtB,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;;IACtC,MAAM,MAAM,GAAG,IAAI,kBAAQ,CAAC,0BAA0B,CAAC,CAAC;IACxD,aAAa;IACb,MAAM,QAAQ,GAAG,MAAM,IAAA,+BAAgB,GAAE,CAAC;IAC1C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,QAAQ;SAC5B,UAAU,CAAC,SAAS,CAAC;SACrB,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,MAAM,mBAAmB,GACvB,uDAAuD,CAAC;IAC1D,MAAM,uBAAuB,GAC3B,uDAAuD,CAAC;IAC1D,MAAM,yBAAyB,GAC7B,uDAA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C,gCAAgC,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,uDAAuD;AACvD,sCAAsC;AACtC,4DAA4D;AAC5D,mFAAmF;AACnF,yFAAyF;AAEzF,gCAAgC;AAEhC,yBAAyB;AAEzB,6CAA6C;AAC7C,6DAA6D;AAC7D,kBAAkB;AAClB,+CAA+C;AAC/C,+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,oBAAoB;AACpB,yDAAyD;AACzD,yCAAyC;AACzC,uDAAuD;AACvD,6CAA6C;AAC7C,WAAW;AACX,6BAA6B;AAC7B,SAAS;AACT,OAAO;AACP,iEAAiE;AACjE,kCAAkC;AAClC,6CAA6C;AAC7C,uBAAuB;AACvB,qBAAqB;AACrB,yBAAyB;AACzB,iCAAiC;AACjC,aAAa;AACb,QAAQ;AACR,OAAO;AACP,4DAA4D;AAC5D,eAAe;AACf,aAAa;AACb,eAAe;AACf,eAAe;AACf,QAAQ;AACR,0BAA0B;AAC1B,wBAAwB;AACxB,MAAM;AAEN,2BAA2B;AAC3B,mDAAmD;AACnD,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "only_ever_generator",
3
- "version": "8.4.3",
3
+ "version": "8.4.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -1,73 +1,73 @@
1
- import express from "express";
2
- import { OnlyEverGenerator } from "./bootstrap/app";
3
- import { ObjectId } from "mongodb";
4
- import { setUpMongoClient } from "./helper/mongo_helper";
5
- import { GenerationVariablesSchema } from "./types/generation_variables_schema";
6
- import { defaultGenerationVariables } from "./constants/default_generation_variables";
1
+ // import express from "express";
2
+ // import { OnlyEverGenerator } from "./bootstrap/app";
3
+ // import { ObjectId } from "mongodb";
4
+ // import { setUpMongoClient } from "./helper/mongo_helper";
5
+ // import { GenerationVariablesSchema } from "./types/generation_variables_schema";
6
+ // import { defaultGenerationVariables } from "./constants/default_generation_variables";
7
7
 
8
- export { OnlyEverGenerator };
8
+ // export { OnlyEverGenerator };
9
9
 
10
- const app = express();
10
+ // const app = express();
11
11
 
12
- app.get("/generate", async (req, res) => {
13
- const source = new ObjectId("692837542bd1597ff832d383");
14
- // setUp();
15
- const database = await setUpMongoClient();
16
- const openAiKey = process.env.OPEN_AI_KEY;
17
- const document = await database
18
- .collection("_source")
19
- .findOne({ _id: source });
20
- if (!document) {
21
- return res.status(404).json({ error: "Source not found" });
22
- }
23
- const promptIdForClassify =
24
- "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594";
25
- const promptIdForConceptFacts =
26
- "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8";
27
- const promptIdForCardGeneration =
28
- "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6";
29
- const promptIdForMissingConceptsFacts =
30
- "pmpt_687ab50298dc8194b214804999d23df10e03b855371691f9";
31
- const promptIdForSummarize =
32
- "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
33
- // const generationCurriculum = process.env.GENERATION_CURRICULUM;
34
- const n = process.env.N;
35
- const generationContent = {
36
- content: {
37
- source_id: document.source_id,
38
- title: document.title,
39
- headings: document.headings,
40
- content: document.content,
41
- fields: [],
42
- taxonomy: {
43
- concepts_facts: document.concepts_facts ?? [],
44
- fields: document.fields ?? [],
45
- summary_cards: document.summary_cards ?? [],
46
- learn_value: document.learn_value,
47
- },
48
- type: document.type,
49
- },
50
- };
51
- const generationVariablesSchema: GenerationVariablesSchema =
52
- defaultGenerationVariables;
53
- const generator = new OnlyEverGenerator(
54
- openAiKey ?? "",
55
- "gpt-4o-mini",
56
- generationContent,
57
- generationVariablesSchema,
58
- false,
59
- 1
60
- );
61
- const response = await generator.generate(true, true, [
62
- "cloze",
63
- "mcq",
64
- "flash",
65
- "match",
66
- ]);
67
- console.log("Close");
68
- res.json(response);
69
- });
12
+ // app.get("/generate", async (req, res) => {
13
+ // const source = new ObjectId("692837542bd1597ff832d383");
14
+ // // setUp();
15
+ // const database = await setUpMongoClient();
16
+ // const openAiKey = process.env.OPEN_AI_KEY;
17
+ // const document = await database
18
+ // .collection("_source")
19
+ // .findOne({ _id: source });
20
+ // if (!document) {
21
+ // return res.status(404).json({ error: "Source not found" });
22
+ // }
23
+ // const promptIdForClassify =
24
+ // "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594";
25
+ // const promptIdForConceptFacts =
26
+ // "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8";
27
+ // const promptIdForCardGeneration =
28
+ // "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6";
29
+ // const promptIdForMissingConceptsFacts =
30
+ // "pmpt_687ab50298dc8194b214804999d23df10e03b855371691f9";
31
+ // const promptIdForSummarize =
32
+ // "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
33
+ // // const generationCurriculum = process.env.GENERATION_CURRICULUM;
34
+ // const n = process.env.N;
35
+ // const generationContent = {
36
+ // content: {
37
+ // source_id: document.source_id,
38
+ // title: document.title,
39
+ // headings: document.headings,
40
+ // content: document.content,
41
+ // fields: [],
42
+ // taxonomy: {
43
+ // concepts_facts: document.concepts_facts ?? [],
44
+ // fields: document.fields ?? [],
45
+ // summary_cards: document.summary_cards ?? [],
46
+ // learn_value: document.learn_value,
47
+ // },
48
+ // type: document.type,
49
+ // },
50
+ // };
51
+ // const generationVariablesSchema: GenerationVariablesSchema =
52
+ // defaultGenerationVariables;
53
+ // const generator = new OnlyEverGenerator(
54
+ // openAiKey ?? "",
55
+ // "gpt-4o-mini",
56
+ // generationContent,
57
+ // generationVariablesSchema,
58
+ // false,
59
+ // 1
60
+ // );
61
+ // const response = await generator.generate(true, true, [
62
+ // "cloze",
63
+ // "mcq",
64
+ // "flash",
65
+ // "match",
66
+ // ]);
67
+ // console.log("Close");
68
+ // res.json(response);
69
+ // });
70
70
 
71
- app.listen(3000, () => {
72
- console.log("Server is running on port 3000");
73
- });
71
+ // app.listen(3000, () => {
72
+ // console.log("Server is running on port 3000");
73
+ // });