@semiont/jobs 0.5.7 → 0.5.8

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.
@@ -18,7 +18,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
18
18
  var __getProtoOf = Object.getPrototypeOf;
19
19
  var __hasOwnProp = Object.prototype.hasOwnProperty;
20
20
  var __commonJS = (cb, mod) => function __require() {
21
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
+ try {
22
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
23
+ } catch (e) {
24
+ throw mod = 0, e;
25
+ }
22
26
  };
23
27
  var __copyProps = (to, from, except, desc) => {
24
28
  if (from && typeof from === "object" || typeof from === "function") {
@@ -10056,10 +10060,19 @@ Knowledge graph context:
10056
10060
  ${parts.join("\n")}`;
10057
10061
  }
10058
10062
  }
10063
+ let semanticContextSection = "";
10064
+ const similar = context?.semanticContext?.similar ?? [];
10065
+ if (similar.length > 0) {
10066
+ const lines = [...similar].sort((a, b) => b.score - a.score).slice(0, 3).map((m) => `- (${m.score.toFixed(2)}) ${m.text.slice(0, 240)}`);
10067
+ semanticContextSection = `
10068
+
10069
+ Related passages from the knowledge base:
10070
+ ${lines.join("\n")}`;
10071
+ }
10059
10072
  const structureGuidance = finalMaxTokens >= 1e3 ? "organized into titled sections (## Section) with well-structured paragraphs" : "organized into well-structured paragraphs";
10060
10073
  const prompt = `Generate a concise, informative resource about "${topic}".
10061
10074
  ${entityTypes.length > 0 ? `Focus on these entity types: ${entityTypes.join(", ")}.` : ""}
10062
- ${userPrompt ? `Additional context: ${userPrompt}` : ""}${annotationSection}${contextSection}${graphContextSection}${sourceLanguageInstruction}${languageInstruction}
10075
+ ${userPrompt ? `Additional context: ${userPrompt}` : ""}${annotationSection}${contextSection}${graphContextSection}${semanticContextSection}${sourceLanguageInstruction}${languageInstruction}
10063
10076
 
10064
10077
  Requirements:
10065
10078
  - Start with a clear heading (# Title)