only_ever_generator 0.8.0 → 0.8.1
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 +3 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -99
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,103 +1,6 @@
|
|
|
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
|
-
|
|
16
|
-
const source_data_1 = require("./constants/source_data");
|
|
17
|
-
const config_1 = __importDefault(require("./config"));
|
|
18
|
-
const app = (0, express_1.default)();
|
|
19
|
-
const port = 3000;
|
|
20
|
-
const prompt_data_1 = require("./constants/prompt_data");
|
|
3
|
+
exports.OnlyEverGenerator = void 0;
|
|
21
4
|
const app_1 = require("./bootstrap/app");
|
|
22
|
-
|
|
23
|
-
/// uncomment the below line and comment all the others, expect the import of OnlyEverGenerator
|
|
24
|
-
// export { OnlyEverGenerator };
|
|
25
|
-
// . All the Codes Below uses express and are strictly for development purpose, while publishing the package, comment everything
|
|
26
|
-
// below this line
|
|
27
|
-
let oeGen = new app_1.OnlyEverGenerator(config_1.default.openAIKey, "gpt-4o-mini", {
|
|
28
|
-
prompt: (0, prompt_data_1.returnPromptData)(),
|
|
29
|
-
content: (0, source_data_1.returnSourceData)(),
|
|
30
|
-
});
|
|
31
|
-
app.get("/", (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
// let data = oeGen.returnParsedContent();
|
|
33
|
-
// let parsedData = parseResponse()
|
|
34
|
-
let cardPrompt = "";
|
|
35
|
-
res.send(cardPrompt);
|
|
36
|
-
}));
|
|
37
|
-
app.get("/openAI", (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
-
// let prompt = returnPromt();
|
|
39
|
-
// let prompt = returnCardGenPrompt();
|
|
40
|
-
// let content = returnSourceData().toString()
|
|
41
|
-
// let headings = returnHeadings();
|
|
42
|
-
// // let aiRequest = await openAIRequest(prompt,content);
|
|
43
|
-
let aiRequest = yield oeGen.generate(true, true);
|
|
44
|
-
res.send(aiRequest);
|
|
45
|
-
}));
|
|
46
|
-
// app.get("/parseCardData", async (req, res) => {
|
|
47
|
-
// let cardResp = returnCardResponse();
|
|
48
|
-
// let headings = returnHeadings();
|
|
49
|
-
// cardResp.metadata = {
|
|
50
|
-
// req_time: cardResp.generated_at ?? new Date(),
|
|
51
|
-
// req_type: "card",
|
|
52
|
-
// req_tokens: cardResp.usage_data?.prompt_tokens,
|
|
53
|
-
// res_tokens: cardResp.usage_data?.completion_tokens,
|
|
54
|
-
// model: "40-mini",
|
|
55
|
-
// };
|
|
56
|
-
// let parsedData = new ParseCardResponse().parse(cardResp, false, {}, 1);
|
|
57
|
-
// res.send(parsedData);
|
|
58
|
-
// });
|
|
59
|
-
// app.get("/generate-cards", async (req, res) => {
|
|
60
|
-
// let cardResp = req.query.data as any;
|
|
61
|
-
// oeGen.parsedContent!.taxonomy = {
|
|
62
|
-
// ...cardResp,
|
|
63
|
-
// fields: returnFields(),
|
|
64
|
-
// };
|
|
65
|
-
// let parsedData = await oeGen.generateCard(
|
|
66
|
-
// returnCardGenPrompt(),
|
|
67
|
-
// JSON.stringify(cardResp),
|
|
68
|
-
// false
|
|
69
|
-
// );
|
|
70
|
-
// res.send(parsedData);
|
|
71
|
-
// });
|
|
72
|
-
// app.get("/typology", async (req, res) => {
|
|
73
|
-
// {
|
|
74
|
-
// let typologyRequest = await oeGen.generate(true, false);
|
|
75
|
-
// res.send(typologyRequest);
|
|
76
|
-
// }
|
|
77
|
-
// });
|
|
78
|
-
// app.get("/local-consolidation", async (req, res) => {
|
|
79
|
-
// const concepts_facts = embeddingsResp.concepts_facts;
|
|
80
|
-
// let locallyConsolidated = new LocalConsolidation().consolidate(
|
|
81
|
-
// concepts_facts,
|
|
82
|
-
// "sourceID"
|
|
83
|
-
// );
|
|
84
|
-
// res.send(locallyConsolidated);
|
|
85
|
-
// });
|
|
86
|
-
// app.get("/global-consolidation", async (req, res) => {
|
|
87
|
-
// const concepts_facts = embeddingsResp.concepts_facts;
|
|
88
|
-
// // let globallyConsolidated = await new GlobalConsolidation().consolidate(
|
|
89
|
-
// // concepts_facts,
|
|
90
|
-
// // "sourceID",
|
|
91
|
-
// // 0.2
|
|
92
|
-
// // );
|
|
93
|
-
// // let globallyConsolidated = await oeGen.globalConsolidation(
|
|
94
|
-
// // concepts_facts,
|
|
95
|
-
// // "sourceID",
|
|
96
|
-
// // 0.2
|
|
97
|
-
// // );
|
|
98
|
-
// // res.send(globallyConsolidated);
|
|
99
|
-
// });
|
|
100
|
-
app.listen(port, () => {
|
|
101
|
-
console.log(`Example app listening at http://localhost:${port}`);
|
|
102
|
-
});
|
|
5
|
+
Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: function () { return app_1.OnlyEverGenerator; } });
|
|
103
6
|
//# 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":";;;AAAA,yCAAoD;AAE3C,kGAFA,uBAAiB,OAEA"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "only_ever_generator",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"main": "dist/
|
|
5
|
-
"types": "dist/
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"start": "npm run build && nodemon dist/
|
|
7
|
+
"start": "npm run build && nodemon dist/index.js",
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
-
"example": "npm run build && nodemon dist/
|
|
10
|
+
"example": "npm run build && nodemon dist/index.js"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [],
|
|
13
13
|
"author": "",
|
package/src/index.ts
ADDED