only_ever_generator 0.5.3 → 0.5.5
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 +7 -2
- package/dist/card_gen/generate_cards.js +2 -2
- package/dist/constants/source_data.js +401 -1149
- package/dist/index.js +1 -1
- package/dist/parse/parse_card/parse_cloze_card.js +2 -2
- package/dist/parse/parse_card/parse_match_card.js +2 -2
- package/dist/parse/parse_card/parse_mcq_card.js +2 -2
- package/dist/parse/parse_card_response.js +35 -3
- package/package.json +1 -1
- package/src/bootstrap/app.ts +7 -1
- package/src/card_gen/generate_cards.ts +2 -2
- package/src/constants/source_data.ts +408 -1322
- package/src/index.ts +2 -2
- package/src/parse/parse_card/parse_cloze_card.ts +2 -2
- package/src/parse/parse_card/parse_match_card.ts +2 -2
- package/src/parse/parse_card/parse_mcq_card.ts +2 -2
- package/src/parse/parse_card_response.ts +39 -3
package/dist/bootstrap/app.js
CHANGED
|
@@ -37,6 +37,7 @@ class OnlyEverGenerator {
|
|
|
37
37
|
title: parsedData.title,
|
|
38
38
|
headings: parsedData.headings,
|
|
39
39
|
content: parsedData.content,
|
|
40
|
+
taxonomy: parsedData.taxonomy,
|
|
40
41
|
},
|
|
41
42
|
// parsedData.type == 'cards' ? this.typologyResponse = parsedData.taxonomy : this.typologyResponse = null;
|
|
42
43
|
this.typologyResponse = generationContent.content.taxonomy;
|
|
@@ -57,6 +58,11 @@ class OnlyEverGenerator {
|
|
|
57
58
|
else if (elem == "generate_card") {
|
|
58
59
|
/// for cards gen to occur, there must be presence of source taxonomy
|
|
59
60
|
if (this.shouldTheCardBeGeneratedAfterTypologyResponse()) {
|
|
61
|
+
this.parsedContent.taxonomy = {
|
|
62
|
+
concepts: this.typologyResponse.concepts,
|
|
63
|
+
facts: this.typologyResponse.facts,
|
|
64
|
+
generate_cards: this.typologyResponse.generate_cards,
|
|
65
|
+
};
|
|
60
66
|
this.cardgenResponse = yield this.generateCard(this.promptForCardGen, JSON.stringify(this.typologyResponse), false);
|
|
61
67
|
responseToReturn.push(this.cardgenResponse);
|
|
62
68
|
/// check if gap fill is required ie coverage determination
|
|
@@ -96,8 +102,7 @@ class OnlyEverGenerator {
|
|
|
96
102
|
}
|
|
97
103
|
generateCard(prompt, additionalContent, isGapFill) {
|
|
98
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
|
|
100
|
-
let generateCardsResp = yield new generate_cards_1.GenerateCards(this.openAiService).generateCards(prompt !== null && prompt !== void 0 ? prompt : "", JSON.stringify(this.parsedContent) + additionalContent, isGapFill, (_a = this.parsedContent.headings) !== null && _a !== void 0 ? _a : []);
|
|
105
|
+
let generateCardsResp = yield new generate_cards_1.GenerateCards(this.openAiService).generateCards(prompt !== null && prompt !== void 0 ? prompt : "", JSON.stringify(this.parsedContent) + additionalContent, isGapFill, this.parsedContent.taxonomy);
|
|
101
106
|
// let response = await this.openAiService?.sendRequest(prompt,this.parsedContent);
|
|
102
107
|
// response['type'] = 'card_gen';
|
|
103
108
|
return generateCardsResp;
|
|
@@ -15,7 +15,7 @@ class GenerateCards {
|
|
|
15
15
|
constructor(openAiService) {
|
|
16
16
|
this.openAiService = openAiService;
|
|
17
17
|
}
|
|
18
|
-
generateCards(prompt, parsedContent, isGapFill,
|
|
18
|
+
generateCards(prompt, parsedContent, isGapFill, taxonomy) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
var _a, _b, _c, _d;
|
|
21
21
|
let response = yield ((_a = this.openAiService) === null || _a === void 0 ? void 0 : _a.sendRequest(prompt, parsedContent));
|
|
@@ -30,7 +30,7 @@ class GenerateCards {
|
|
|
30
30
|
};
|
|
31
31
|
if (response.status_code == 200) {
|
|
32
32
|
response.metadata.status = "completed";
|
|
33
|
-
let parseCard = new parse_card_response_1.ParseCardResponse().parse(response, isGapFill);
|
|
33
|
+
let parseCard = new parse_card_response_1.ParseCardResponse().parse(response, isGapFill, taxonomy);
|
|
34
34
|
return parseCard;
|
|
35
35
|
}
|
|
36
36
|
else {
|