only_ever_generator 3.0.8 → 3.0.9

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.
@@ -5,14 +5,16 @@ export declare class GenerateConceptFacts {
5
5
  openAIHelper: OpenAIHelper;
6
6
  content: {
7
7
  title: string;
8
- headings: string[];
8
+ h1_headings?: string[];
9
+ timecodes?: string[];
9
10
  content: any[];
10
11
  };
11
12
  type: string;
12
13
  promptIdForConceptFacts: string;
13
14
  constructor(openAiService: OpenAiService, content: {
14
15
  title: string;
15
- headings: string[];
16
+ h1_headings?: string[];
17
+ timecodes?: string[];
16
18
  content: any[];
17
19
  }, type: string, promptIdForConceptFacts: string);
18
20
  generate(): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"generate_concept_facts.d.ts","sourceRoot":"","sources":["../../src/typology_gen/generate_concept_facts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,qBAAa,oBAAoB;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC;KAChB,CAAC;IACK,IAAI,EAAE,MAAM,CAAM;IAClB,uBAAuB,EAAE,MAAM,CAAC;gBAErC,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC;KAChB,EACD,IAAI,EAAE,MAAM,EACZ,uBAAuB,EAAE,MAAM;IAS3B,QAAQ;CA0Cf"}
1
+ {"version":3,"file":"generate_concept_facts.d.ts","sourceRoot":"","sources":["../../src/typology_gen/generate_concept_facts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,qBAAa,oBAAoB;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,EAAE,GAAG,EAAE,CAAC;KAChB,CAAC;IACK,IAAI,EAAE,MAAM,CAAM;IAClB,uBAAuB,EAAE,MAAM,CAAC;gBAErC,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,EAAE,GAAG,EAAE,CAAC;KAChB,EACD,IAAI,EAAE,MAAM,EACZ,uBAAuB,EAAE,MAAM;IAS3B,QAAQ;CA8Cf"}
@@ -24,7 +24,10 @@ class GenerateConceptFacts {
24
24
  generate() {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
26
  try {
27
- const schema = (0, build_concept_facts_schema_1.buildConceptFactSchema)(this.content.headings, "concept_fact_gen_schema", true);
27
+ const headings = this.type === "text"
28
+ ? this.content.h1_headings || []
29
+ : this.content.timecodes || [];
30
+ const schema = (0, build_concept_facts_schema_1.buildConceptFactSchema)(headings, "concept_fact_gen_schema", true);
28
31
  const openAiResponse = yield this.openAIHelper.openAI.responses.create({
29
32
  prompt: {
30
33
  id: this.promptIdForConceptFacts,
@@ -1 +1 @@
1
- {"version":3,"file":"generate_concept_facts.js","sourceRoot":"","sources":["../../src/typology_gen/generate_concept_facts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mGAA4F;AAC5F,2DAAuD;AA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,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;KAAA;CACF;AArED,oDAqEC"}
1
+ {"version":3,"file":"generate_concept_facts.js","sourceRoot":"","sources":["../../src/typology_gen/generate_concept_facts.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mGAA4F;AAC5F,2DAAuD;AAGvD,MAAa,oBAAoB;IAW/B,YACE,aAA4B,EAC5B,OAKC,EACD,IAAY,EACZ,uBAA+B;QAX1B,SAAI,GAAW,EAAE,CAAC;QAavB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEK,QAAQ;;YACZ,IAAI,CAAC;gBACH,MAAM,QAAQ,GACZ,IAAI,CAAC,IAAI,KAAK,MAAM;oBAClB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE;oBAChC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;gBACnC,MAAM,MAAM,GAAG,IAAA,mDAAsB,EACnC,QAAQ,EACR,yBAAyB,EACzB,IAAI,CACL,CAAC;gBACF,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;oBACrE,MAAM,EAAE;wBACN,EAAE,EAAE,IAAI,CAAC,uBAAuB;wBAChC,SAAS,EAAE;4BACT,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;yBAC/D;qBACF;oBACD,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE;gCACP;oCACE,IAAI,EAAE,YAAY;oCAClB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;iCACnC;6BACF;yBACF;qBACF;oBACD,uCAAuC;oBACvC,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE;wBACJ,MAAM,EAAE;4BACN,IAAI,EAAE,aAAa;4BACnB,IAAI,EAAE,MAAM,CAAC,IAAI;4BACjB,MAAM,EAAE,MAAM,CAAC,MAAM;4BACrB,MAAM,EAAE,MAAM,CAAC,MAAM;yBACtB;qBACF;iBACF,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;KAAA;CACF;AA3ED,oDA2EC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "only_ever_generator",
3
- "version": "3.0.8",
3
+ "version": "3.0.9",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -7,7 +7,8 @@ export class GenerateConceptFacts {
7
7
  public openAIHelper: OpenAIHelper;
8
8
  public content: {
9
9
  title: string;
10
- headings: string[];
10
+ h1_headings?: string[];
11
+ timecodes?: string[];
11
12
  content: any[];
12
13
  };
13
14
  public type: string = "";
@@ -16,7 +17,8 @@ export class GenerateConceptFacts {
16
17
  openAiService: OpenAiService,
17
18
  content: {
18
19
  title: string;
19
- headings: string[];
20
+ h1_headings?: string[];
21
+ timecodes?: string[];
20
22
  content: any[];
21
23
  },
22
24
  type: string,
@@ -31,8 +33,12 @@ export class GenerateConceptFacts {
31
33
 
32
34
  async generate() {
33
35
  try {
36
+ const headings =
37
+ this.type === "text"
38
+ ? this.content.h1_headings || []
39
+ : this.content.timecodes || [];
34
40
  const schema = buildConceptFactSchema(
35
- this.content.headings,
41
+ headings,
36
42
  "concept_fact_gen_schema",
37
43
  true
38
44
  );