only_ever_generator 5.0.6 → 5.0.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.
package/dist/index.js CHANGED
@@ -9,71 +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
- const mongo_helper_1 = require("./helper/mongo_helper");
26
- const get_prompts_1 = require("./services/get_prompts");
27
- (() => __awaiter(void 0, void 0, void 0, function* () {
28
- var _a;
29
- const openAIKey = "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";
30
- const promptForSummary = {
31
- promptId: "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
32
- version: "13",
33
- };
34
- const promptForConceptFacts = {
35
- promptId: "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
36
- version: "6",
37
- };
38
- (0, mongo_helper_1.setUp)();
39
- const source = yield mongo_helper_1.database.collection("_source").findOne({
40
- _id: new mongo_helper_1.ObjectId("6753b1d77bb31d8ccf586c2c"),
41
- });
42
- const contentForGen = {
43
- prompt: {
44
- typology: "",
45
- card_generation: "",
46
- },
47
- content: {
48
- source_id: ((_a = source === null || source === void 0 ? void 0 : source._id) === null || _a === void 0 ? void 0 : _a.toString()) || "",
49
- title: (source === null || source === void 0 ? void 0 : source.title) || "",
50
- type: (source === null || source === void 0 ? void 0 : source.type) || "",
51
- headings: (source === null || source === void 0 ? void 0 : source.headings) || [],
52
- content: (source === null || source === void 0 ? void 0 : source.content) || [],
53
- fields: (source === null || source === void 0 ? void 0 : source.fields) || [],
54
- taxonomy: (source === null || source === void 0 ? void 0 : source.generate_cards)
55
- ? {
56
- generate_cards: (source === null || source === void 0 ? void 0 : source.generate_cards) || {
57
- state: false,
58
- reason: "",
59
- },
60
- concepts_facts: (source === null || source === void 0 ? void 0 : source.concepts_facts) || [],
61
- fields: (source === null || source === void 0 ? void 0 : source.fields) || [],
62
- }
63
- : undefined,
64
- },
65
- };
66
- const prompts = yield (0, get_prompts_1.getPrompts)("text");
67
- const bloomInstructions = prompts.bloom_instructions;
68
- const cardInstructions = prompts.card_instructions;
69
- const cardExamples = prompts.card_examples;
70
- console.log("Initializing OnlyEverGenerator");
71
- const onlyEverGenerator = new app_1.OnlyEverGenerator(process.env.OPEN_AI_KEY, "o4-mini", contentForGen, "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594", "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8", "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6", {
72
- bloom_instructions: bloomInstructions,
73
- card_instructions: cardInstructions,
74
- card_examples: cardExamples,
75
- });
76
- const response = yield onlyEverGenerator.generate(true, true);
77
- console.log(response);
78
- }))();
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("6753b1ec56e5e922b57ee2df"),
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?.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
+ // })();
79
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;;;;;;;;;;;;AAE3D,yCAAoD;AAK3C,kGALA,uBAAiB,OAKA;AAJ1B,wDAAkE;AAClE,wDAAoD;AAKpD,CAAC,GAAS,EAAE;;IACV,MAAM,SAAS,GACb,sKAAsK,CAAC;IACzK,MAAM,gBAAgB,GAAG;QACvB,QAAQ,EAAE,uDAAuD;QACjE,OAAO,EAAE,IAAI;KACd,CAAC;IACF,MAAM,qBAAqB,GAAG;QAC5B,QAAQ,EAAE,uDAAuD;QACjE,OAAO,EAAE,GAAG;KACb,CAAC;IAEF,IAAA,oBAAK,GAAE,CAAC;IAER,MAAM,MAAM,GAAG,MAAM,uBAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;QAC1D,GAAG,EAAE,IAAI,uBAAQ,CAAC,0BAA0B,CAAC;KAC9C,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG;QACpB,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE;YACZ,eAAe,EAAE,EAAE;SACpB;QACD,OAAO,EAAE;YACP,SAAS,EAAE,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,0CAAE,QAAQ,EAAE,KAAI,EAAE;YACxC,KAAK,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,KAAI,EAAE;YAC1B,IAAI,EAA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C,qCAAqC;AACrC,QAAQ;AACR,OAAO;AACP,mEAAmE;AACnE,2BAA2B;AAC3B,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "only_ever_generator",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -16,67 +16,68 @@ import { BaseParamType } from "./types/base_param_type";
16
16
 
17
17
  export { OnlyEverGenerator };
18
18
 
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
- };
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
- setUp();
31
+ // setUp();
32
32
 
33
- const source = await database.collection("_source").findOne({
34
- _id: new ObjectId("6753b1d77bb31d8ccf586c2c"),
35
- });
33
+ // const source = await database.collection("_source").findOne({
34
+ // _id: new ObjectId("6753b1ec56e5e922b57ee2df"),
35
+ // });
36
36
 
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;
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?.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;
65
65
 
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
- })();
66
+ // console.log("Initializing OnlyEverGenerator");
67
+ // const onlyEverGenerator = new OnlyEverGenerator(
68
+ // process.env.OPEN_AI_KEY as string,
69
+ // "o4-mini",
70
+ // contentForGen,
71
+
72
+ // "pmpt_687a8872d1c8819088a9cdc97dcb688b0893663621695594",
73
+ // "pmpt_687aa547f99c8193b99467ca53630c2607f5a8caf451e7e8",
74
+ // "pmpt_688118a923e4819098176a13a2f401920d2ea17d881cc6c6",
75
+ // {
76
+ // bloom_instructions: bloomInstructions,
77
+ // card_instructions: cardInstructions,
78
+ // card_examples: cardExamples,
79
+ // }
80
+ // );
81
+ // const response = await onlyEverGenerator.generate(true, true);
82
+ // console.log(response);
83
+ // })();