only_ever_generator 0.3.5 → 0.3.7

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.
@@ -35,10 +35,6 @@ function gapFilling(typologyResponse, cardgenResponse) {
35
35
  remainingFacts = allFacts.filter((item) => !generatedFactsSet.includes(item));
36
36
  }
37
37
  return {
38
- // allConcepts: allConcepts,
39
- // allFacts: allFacts,
40
- // generatedConcepts: generatedConceptsSet,
41
- // generatedFacts: generatedFactsSet,
42
38
  remainingConcepts: remainingConcepts,
43
39
  remainingFacts: remainingFacts,
44
40
  };
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ Object.defineProperty(exports, "OnlyEverGenerator", { enumerable: true, get: fun
45
45
  // // summary_prompt: "",
46
46
  // // }
47
47
  // // )
48
- // let typologyRequest = await oeGen.generate(true, true);
48
+ // let typologyRequest = await oeGen.generate(false, true);
49
49
  // res.send(typologyRequest);
50
50
  // }
51
51
  // });
@@ -36,6 +36,7 @@ class GenerateTypology {
36
36
  return this.parseTypologyOnSuccess(response);
37
37
  }
38
38
  else {
39
+ response.metadata.err_message = response.message;
39
40
  return response;
40
41
  }
41
42
  }
@@ -14,10 +14,12 @@ function parseOpenAiSuccessResponse(responseData) {
14
14
  }
15
15
  exports.parseOpenAiSuccessResponse = parseOpenAiSuccessResponse;
16
16
  function parseOpenAiFailureResponse(errorResponse) {
17
+ var _a, _b;
17
18
  let usuage = errorResponse.usuage;
18
19
  // let statusCode =
19
20
  return {
20
21
  'status_code': errorResponse.status,
22
+ 'message': (_b = (_a = errorResponse.data) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.code
21
23
  };
22
24
  }
23
25
  exports.parseOpenAiFailureResponse = parseOpenAiFailureResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "only_ever_generator",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "start": "npm run build && nodemon dist/index.js",
@@ -72,7 +72,10 @@ export class OnlyEverGenerator {
72
72
  if(this.shouldTheCardBeGeneratedAfterTypologyResponse()){
73
73
  this.cardgenResponse = await this.generateCard(
74
74
  this.promptForCardGen,
75
- JSON.stringify(this.typologyResponse),
75
+ "Here are the facts and concepts on which cards needs to be generate, refrain from generating missing facts , concepts similar to available below : " +JSON.stringify({
76
+ "facts": this.typologyResponse.facts,
77
+ "concepts": this.typologyResponse.concepts
78
+ }),
76
79
  false,
77
80
  )
78
81
  responseToReturn.push(this.cardgenResponse);
@@ -107,11 +110,10 @@ export class OnlyEverGenerator {
107
110
  gapFill.remainingFacts.length !== 0
108
111
  ) {
109
112
  response = await this.generateCard(
110
- this.promptForCardGen +
111
- "Generate cards only suitable for the given remaining concepts and facts" +
112
- JSON.stringify(gapFill) +
113
- "Exclude generating cards with content in the following",
114
- JSON.stringify(cardGenData.cards_data),
113
+ this.promptForCardGen ,
114
+
115
+ "Only Generate Cards For the missing concepts and facts given below \n" +
116
+ JSON.stringify(gapFill) + "\n The cards already generated are below, refrain for generating cards similar to these "+ JSON.stringify(cardGenData.cards_data),
115
117
  true
116
118
  );
117
119
  }
@@ -24,6 +24,7 @@ export class GenerateCards {
24
24
  return this.parse(response, isGapFill,headings);
25
25
  } else {
26
26
  response.metadata.status = "failed";
27
+ response.metadata.err_message = response.message;
27
28
  return response;
28
29
  }
29
30
  }