only_ever_generator 8.1.2 → 8.1.3

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
@@ -1,57 +1,39 @@
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.OnlyEverGenerator = void 0;
16
- const mongodb_1 = require("mongodb");
17
4
  const app_1 = require("./bootstrap/app");
18
5
  Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: function () { return app_1.OnlyEverGenerator; } });
19
- const open_ai_service_1 = require("./services/open_ai_service");
20
- const summarize_1 = require("./typology_gen/summarize");
21
- const mongo_helper_1 = require("./helper/mongo_helper");
22
- // import { LocalConsolidation } from "./embedding_generation/consolidation/local_consolidation";
23
- // import { embeddingsResp } from "./typology-parsed-response";
24
- // import { GlobalConsolidation } from "./embedding_generation/consolidation/global_consolidation";
25
- // import { ParseEmbeddingResponse } from "./embedding_generation/parse_embedding_response";
26
- // import { OpenAIHelper } from "./helper/openai_helper";
27
- // import { GenerateTypology } from "./typology_gen/generate_typology";
28
- // import { OpenAiService } from "./services/open_ai_service";
29
- // import { GenerateConceptFacts } from "./typology_gen/generate_concept_facts";
30
- // import { BaseParamType } from "./types/base_param_type";
31
- // import dotenv from "dotenv";
32
- const express_1 = __importDefault(require("express"));
33
- const app = (0, express_1.default)();
34
- const port = 3000;
35
6
  // dotenv.config();
36
- app.listen(port, () => {
37
- console.log(`Server is running on port ${port}`);
38
- });
39
- app.get("/summarize", (req, res) => __awaiter(void 0, void 0, void 0, function* () {
40
- (0, mongo_helper_1.setUp)();
41
- const promptIdForSummaryCards = "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
42
- const sourceId = "68b114dac849a25097ed1778";
43
- const source = yield mongo_helper_1.database
44
- .collection("_source")
45
- .findOne({ _id: new mongodb_1.ObjectId(sourceId) });
46
- const content = {
47
- title: source === null || source === void 0 ? void 0 : source.title,
48
- h1_headings: source === null || source === void 0 ? void 0 : source.headings,
49
- content: source === null || source === void 0 ? void 0 : source.content,
50
- };
51
- const openAiService = new open_ai_service_1.OpenAiService(process.env.OPEN_AI_KEY || "", "gpt-5-mini");
52
- const summarize = new summarize_1.GenerateSummaryCards(openAiService, sourceId, content, "text", promptIdForSummaryCards, false);
53
- const summaryCards = yield summarize.generate();
54
- console.log(summaryCards);
55
- res.json(summaryCards);
56
- }));
7
+ // app.listen(port, () => {
8
+ // console.log(`Server is running on port ${port}`);
9
+ // });
10
+ // app.get("/summarize", async (req, res) => {
11
+ // setUp();
12
+ // const promptIdForSummaryCards =
13
+ // "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
14
+ // const sourceId = "68b114dac849a25097ed1778";
15
+ // const source = await database
16
+ // .collection("_source")
17
+ // .findOne({ _id: new ObjectId(sourceId) });
18
+ // const content = {
19
+ // title: source?.title,
20
+ // h1_headings: source?.headings,
21
+ // content: source?.content,
22
+ // };
23
+ // const openAiService = new OpenAiService(
24
+ // process.env.OPEN_AI_KEY || "",
25
+ // "gpt-5-mini"
26
+ // );
27
+ // const summarize = new GenerateSummaryCards(
28
+ // openAiService,
29
+ // sourceId,
30
+ // content,
31
+ // "text",
32
+ // promptIdForSummaryCards,
33
+ // false
34
+ // );
35
+ // const summaryCards = await summarize.generate();
36
+ // console.log(summaryCards);
37
+ // res.json(summaryCards);
38
+ // });
57
39
  //# 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,qCAAmC;AACnC,yCAAoD;AAyB3C,kGAzBA,uBAAiB,OAyBA;AAxB1B,gEAA2D;AAC3D,wDAAgE;AAChE,wDAAwD;AACxD,iGAAiG;AACjG,+DAA+D;AAC/D,mGAAmG;AACnG,4FAA4F;AAC5F,yDAAyD;AACzD,uEAAuE;AACvE,8DAA8D;AAC9D,gFAAgF;AAChF,2DAA2D;AAC3D,+BAA+B;AAC/B,sDAA8B;AAC9B,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;AACtB,MAAM,IAAI,GAAG,IAAI,CAAC;AAUlB,mBAAmB;AAEnB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACvC,IAAA,oBAAK,GAAE,CAAC;IACR,MAAM,uBAAuB,GAC3B,uDAAuD,CAAC;IAC1D,MAAM,QAAQ,GAAG,0BAA0B,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,uBAAQ;SAC1B,UAAU,CAAC,SAAS,CAAC;SACrB,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,kBAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG;QACd,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK;QACpB,WAAW,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ;QAC7B,OAAO,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO;KACzB,CAAC;IACF,MAAM,aAAa,GAAG,IAAI,+BAAa,CACrC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,EAC7B,YAAY,CACb,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,gCAAoB,CACxC,aAAa,EACb,QAAQ,EACR,OAAO,EACP,MAAM,EACN,uBAAuB,EACvB,KAAK,CACN,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1B,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACzB,CAAC,CAAA,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoD;AAyB3C,kGAzBA,uBAAiB,OAyBA;AAC1B,mBAAmB;AAEnB,2BAA2B;AAC3B,sDAAsD;AACtD,MAAM;AAEN,8CAA8C;AAC9C,aAAa;AACb,oCAAoC;AACpC,+DAA+D;AAC/D,iDAAiD;AACjD,kCAAkC;AAClC,6BAA6B;AAC7B,iDAAiD;AACjD,sBAAsB;AACtB,4BAA4B;AAC5B,qCAAqC;AACrC,gCAAgC;AAChC,OAAO;AACP,6CAA6C;AAC7C,qCAAqC;AACrC,mBAAmB;AACnB,OAAO;AACP,gDAAgD;AAChD,qBAAqB;AACrB,gBAAgB;AAChB,eAAe;AACf,cAAc;AACd,+BAA+B;AAC/B,YAAY;AACZ,OAAO;AACP,qDAAqD;AACrD,+BAA+B;AAC/B,4BAA4B;AAC5B,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "only_ever_generator",
3
- "version": "8.1.2",
3
+ "version": "8.1.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -13,9 +13,9 @@ import { database, setUp } from "./helper/mongo_helper";
13
13
  // import { GenerateConceptFacts } from "./typology_gen/generate_concept_facts";
14
14
  // import { BaseParamType } from "./types/base_param_type";
15
15
  // import dotenv from "dotenv";
16
- import express from "express";
17
- const app = express();
18
- const port = 3000;
16
+ // import express from "express";
17
+ // const app = express();
18
+ // const port = 3000;
19
19
 
20
20
  // // import { OnlyEverGenerator } from "./bootstrap/app";
21
21
  // import { database, ObjectId, setUp } from "./helper/mongo_helper";
@@ -27,36 +27,36 @@ const port = 3000;
27
27
  export { OnlyEverGenerator };
28
28
  // dotenv.config();
29
29
 
30
- app.listen(port, () => {
31
- console.log(`Server is running on port ${port}`);
32
- });
30
+ // app.listen(port, () => {
31
+ // console.log(`Server is running on port ${port}`);
32
+ // });
33
33
 
34
- app.get("/summarize", async (req, res) => {
35
- setUp();
36
- const promptIdForSummaryCards =
37
- "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
38
- const sourceId = "68b114dac849a25097ed1778";
39
- const source = await database
40
- .collection("_source")
41
- .findOne({ _id: new ObjectId(sourceId) });
42
- const content = {
43
- title: source?.title,
44
- h1_headings: source?.headings,
45
- content: source?.content,
46
- };
47
- const openAiService = new OpenAiService(
48
- process.env.OPEN_AI_KEY || "",
49
- "gpt-5-mini"
50
- );
51
- const summarize = new GenerateSummaryCards(
52
- openAiService,
53
- sourceId,
54
- content,
55
- "text",
56
- promptIdForSummaryCards,
57
- false
58
- );
59
- const summaryCards = await summarize.generate();
60
- console.log(summaryCards);
61
- res.json(summaryCards);
62
- });
34
+ // app.get("/summarize", async (req, res) => {
35
+ // setUp();
36
+ // const promptIdForSummaryCards =
37
+ // "pmpt_6902c30a973481968395935cc6dfa78605f50d2b01d4afbd";
38
+ // const sourceId = "68b114dac849a25097ed1778";
39
+ // const source = await database
40
+ // .collection("_source")
41
+ // .findOne({ _id: new ObjectId(sourceId) });
42
+ // const content = {
43
+ // title: source?.title,
44
+ // h1_headings: source?.headings,
45
+ // content: source?.content,
46
+ // };
47
+ // const openAiService = new OpenAiService(
48
+ // process.env.OPEN_AI_KEY || "",
49
+ // "gpt-5-mini"
50
+ // );
51
+ // const summarize = new GenerateSummaryCards(
52
+ // openAiService,
53
+ // sourceId,
54
+ // content,
55
+ // "text",
56
+ // promptIdForSummaryCards,
57
+ // false
58
+ // );
59
+ // const summaryCards = await summarize.generate();
60
+ // console.log(summaryCards);
61
+ // res.json(summaryCards);
62
+ // });