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 +32 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +35 -35
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
|
-
|
|
38
|
-
});
|
|
39
|
-
app.get("/summarize", (req, res) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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":"
|
|
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
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
|
-
|
|
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
|
-
|
|
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
|
-
});
|
|
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
|
+
// });
|