only_ever_generator 0.6.0 → 0.6.2
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/bootstrap/app.js
CHANGED
|
@@ -85,8 +85,8 @@ class OnlyEverGenerator {
|
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
_generationForGapFill(
|
|
89
|
-
return __awaiter(this,
|
|
88
|
+
_generationForGapFill(typologyData, cardGenData) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
90
|
let gapFill = (0, calculate_gap_fill_1.gapFilling)(typologyData, cardGenData);
|
|
91
91
|
let response;
|
|
92
92
|
if (gapFill.remainingConcepts.length !== 0 ||
|
|
@@ -95,7 +95,7 @@ class OnlyEverGenerator {
|
|
|
95
95
|
this.typologyResponse.concepts = gapFill.remainingConcepts;
|
|
96
96
|
response = yield this.generateCard(this.promptForCardGen +
|
|
97
97
|
"Generate cards only suitable for the given remaining concepts and facts" +
|
|
98
|
-
JSON.stringify(gapFill), "", true
|
|
98
|
+
JSON.stringify(gapFill), "", true);
|
|
99
99
|
}
|
|
100
100
|
return response;
|
|
101
101
|
});
|
|
@@ -114,8 +114,8 @@ class OnlyEverGenerator {
|
|
|
114
114
|
return response;
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
gapFill(
|
|
118
|
-
return __awaiter(this,
|
|
117
|
+
gapFill(factsMaps_1, aiCards_1) {
|
|
118
|
+
return __awaiter(this, arguments, void 0, function* (factsMaps, aiCards, n = 0) {
|
|
119
119
|
/// factsmap
|
|
120
120
|
/// {
|
|
121
121
|
/// remaining_facts: [],
|
|
@@ -126,7 +126,7 @@ class OnlyEverGenerator {
|
|
|
126
126
|
response = yield this.generateCard(this.promptForCardGen +
|
|
127
127
|
"Generate cards only suitable for the given remaining concepts and facts" +
|
|
128
128
|
JSON.stringify(factsMaps) +
|
|
129
|
-
"Exclude generating cards with content in the following", JSON.stringify(aiCards), true);
|
|
129
|
+
"Exclude generating cards with content in the following", JSON.stringify(aiCards), true, n);
|
|
130
130
|
return response;
|
|
131
131
|
});
|
|
132
132
|
}
|
|
@@ -19,13 +19,14 @@ class GenerateCards {
|
|
|
19
19
|
return __awaiter(this, arguments, void 0, function* (prompt, parsedContent, isGapFill, taxonomy, n = 0) {
|
|
20
20
|
var _a, _b, _c, _d, _e;
|
|
21
21
|
let response = yield ((_a = this.openAiService) === null || _a === void 0 ? void 0 : _a.sendRequest(prompt, parsedContent));
|
|
22
|
+
var updatedNumber = n + 1;
|
|
22
23
|
// console.log("response to card generation ", response);
|
|
23
24
|
// response["request_type"] = ;
|
|
24
25
|
response.metadata = {
|
|
25
26
|
req_time: (_b = response.generated_at) !== null && _b !== void 0 ? _b : new Date(),
|
|
26
27
|
req_type: {
|
|
27
28
|
type: "depth",
|
|
28
|
-
n:
|
|
29
|
+
n: updatedNumber,
|
|
29
30
|
bloom_level: 1,
|
|
30
31
|
},
|
|
31
32
|
req_tokens: (_c = response.usage_data) === null || _c === void 0 ? void 0 : _c.prompt_tokens,
|
package/package.json
CHANGED
package/src/bootstrap/app.ts
CHANGED
|
@@ -97,7 +97,7 @@ export class OnlyEverGenerator {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
async _generationForGapFill(typologyData: any, cardGenData: any,
|
|
100
|
+
async _generationForGapFill(typologyData: any, cardGenData: any,) {
|
|
101
101
|
let gapFill = gapFilling(typologyData, cardGenData);
|
|
102
102
|
let response: any;
|
|
103
103
|
if (
|
|
@@ -112,7 +112,7 @@ export class OnlyEverGenerator {
|
|
|
112
112
|
JSON.stringify(gapFill),
|
|
113
113
|
|
|
114
114
|
"",
|
|
115
|
-
true,
|
|
115
|
+
true,
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
return response;
|
|
@@ -148,7 +148,7 @@ export class OnlyEverGenerator {
|
|
|
148
148
|
return response;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
async gapFill(factsMaps: any, aiCards: Array<any
|
|
151
|
+
async gapFill(factsMaps: any, aiCards: Array<any>, n: number = 0) {
|
|
152
152
|
/// factsmap
|
|
153
153
|
/// {
|
|
154
154
|
/// remaining_facts: [],
|
|
@@ -164,7 +164,8 @@ export class OnlyEverGenerator {
|
|
|
164
164
|
JSON.stringify(factsMaps) +
|
|
165
165
|
"Exclude generating cards with content in the following",
|
|
166
166
|
JSON.stringify(aiCards),
|
|
167
|
-
true
|
|
167
|
+
true,
|
|
168
|
+
n,
|
|
168
169
|
);
|
|
169
170
|
|
|
170
171
|
return response;
|
|
@@ -16,13 +16,14 @@ export class GenerateCards {
|
|
|
16
16
|
n: number = 0,
|
|
17
17
|
) {
|
|
18
18
|
let response = await this.openAiService?.sendRequest(prompt, parsedContent);
|
|
19
|
+
var updatedNumber = n + 1;
|
|
19
20
|
// console.log("response to card generation ", response);
|
|
20
21
|
// response["request_type"] = ;
|
|
21
22
|
response.metadata = {
|
|
22
23
|
req_time: response.generated_at ?? new Date(),
|
|
23
24
|
req_type: {
|
|
24
25
|
type: "depth",
|
|
25
|
-
n:
|
|
26
|
+
n: updatedNumber,
|
|
26
27
|
bloom_level: 1,
|
|
27
28
|
},
|
|
28
29
|
req_tokens: response.usage_data?.prompt_tokens,
|