only_ever_generator 0.4.2 → 0.4.4
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/card_gen/generate_cards.js +14 -10
- package/dist/constants/prompts/card_gen_prompt.js +174 -136
- package/dist/constants/prompts/typology_prompt.js +4 -4
- package/dist/constants/source_data.js +64 -28
- package/dist/index.js +18 -4
- package/package.json +1 -1
- package/src/card_gen/generate_cards.ts +32 -24
- package/src/constants/prompts/card_gen_prompt.ts +175 -136
- package/src/constants/prompts/typology_prompt.ts +4 -4
- package/src/constants/source_data.ts +79 -43
- package/src/index.ts +19 -1
- package/src/services/open_ai_service.ts +0 -1
package/src/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// import express from "express";
|
|
2
2
|
// import {
|
|
3
|
+
// returnCardResponse,
|
|
4
|
+
// returnHeadings,
|
|
3
5
|
// returnSourceData,
|
|
4
6
|
// } from "./constants/source_data";
|
|
5
7
|
// import config from "./config";
|
|
@@ -8,10 +10,12 @@
|
|
|
8
10
|
|
|
9
11
|
import { OnlyEverGenerator } from "./bootstrap/app";
|
|
10
12
|
// import { returnPromptData } from "./constants/prompt_data";
|
|
13
|
+
// import { GenerateCards } from "./card_gen/generate_cards";
|
|
14
|
+
// import { OpenAiService } from "./services/open_ai_service";
|
|
11
15
|
|
|
12
16
|
/// While Publishing the package , and using this code as a separate npm module
|
|
13
17
|
/// uncomment the below line and comment all the others, expect the import of OnlyEverGenerator
|
|
14
|
-
|
|
18
|
+
export {OnlyEverGenerator};
|
|
15
19
|
|
|
16
20
|
// //. All the Codes Below uses express and are strictly for development purpose, while publishing the package, comment everything
|
|
17
21
|
// //below this line
|
|
@@ -37,6 +41,20 @@ import { OnlyEverGenerator } from "./bootstrap/app";
|
|
|
37
41
|
// res.send(aiRequest);
|
|
38
42
|
// });
|
|
39
43
|
|
|
44
|
+
// app.get("/parseCardData", async(req,res)=>{
|
|
45
|
+
// let cardResp = returnCardResponse();
|
|
46
|
+
// let headings = returnHeadings();
|
|
47
|
+
// cardResp.metadata = {
|
|
48
|
+
// "req_time": cardResp.generated_at ?? new Date(),
|
|
49
|
+
// "req_type": cardResp.type,
|
|
50
|
+
// "req_tokens": cardResp.usage_data?.prompt_tokens,
|
|
51
|
+
// "res_tokens": cardResp.usage_data?.completion_tokens,
|
|
52
|
+
// "model": '40-mini'
|
|
53
|
+
// };
|
|
54
|
+
// let parsedData = new GenerateCards(new OpenAiService("","")).parse(cardResp,false,headings);
|
|
55
|
+
// res.send(parsedData)
|
|
56
|
+
// });
|
|
57
|
+
|
|
40
58
|
// // app.get("/typology", async (req, res) => {
|
|
41
59
|
// // {
|
|
42
60
|
// // let typologyPrompt = returnTypologyPrompt();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { parseOpenAiFailureResponse, parseOpenAiSuccessResponse } from "../utils/parse_openai_response";
|
|
3
3
|
import { openAiEndPoint } from "../constants/api_constants";
|
|
4
|
-
import { ErrorLogger } from "../logger";
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
export class OpenAiService{
|