@absolutejs/rag 0.24.3 → 0.24.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.
@@ -16,6 +16,23 @@ export declare const ReviewSchema: import("@sinclair/typebox").TObject<{
16
16
  }>;
17
17
  }>>;
18
18
  }>;
19
+ /** Make the tool contract match this batch rather than inviting a full-draft review. */
20
+ export declare const reviewSchemaForPaths: (paths: string[]) => import("@sinclair/typebox").TObject<{
21
+ fields: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
22
+ path: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<string>[]>;
23
+ verdict: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"unknown" | "supported" | "unsupported" | "conflicting">[]>;
24
+ citations: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
25
+ passageId: import("@sinclair/typebox").TString;
26
+ }>>;
27
+ reason: import("@sinclair/typebox").TString;
28
+ checks: import("@sinclair/typebox").TObject<{
29
+ answersQuestion: import("@sinclair/typebox").TBoolean;
30
+ correctEntity: import("@sinclair/typebox").TBoolean;
31
+ correctTime: import("@sinclair/typebox").TBoolean;
32
+ preservesScope: import("@sinclair/typebox").TBoolean;
33
+ }>;
34
+ }>>;
35
+ }>;
19
36
  export declare const researchLeaves: (value: unknown, maxFields?: number) => Pick<ResearchField, "value" | "path">[];
20
37
  /** A model review is fallible. Citation validation proves provenance, not truth. */
21
38
  export declare const bindResearchReview: (leaves: ReturnType<typeof researchLeaves>, reviews: {
@@ -123408,6 +123408,12 @@ var ReviewSchema = Type.Object({
123408
123408
  })
123409
123409
  }), { maxItems: 256 })
123410
123410
  });
123411
+ var reviewSchemaForPaths = (paths) => Type.Object({
123412
+ fields: Type.Array(Type.Object({
123413
+ ...ReviewSchema.properties.fields.items.properties,
123414
+ path: Type.Union(paths.map((path) => Type.Literal(path)))
123415
+ }, { additionalProperties: false }), { minItems: paths.length, maxItems: paths.length })
123416
+ }, { additionalProperties: false });
123411
123417
  var researchLeaves = (value, maxFields = 128) => {
123412
123418
  const fields = [];
123413
123419
  const visit = (item, path, depth) => {
@@ -124000,7 +124006,7 @@ Correct the previous schema-invalid response using the validation diagnostics. T
124000
124006
  await persistReview(pass, offset, true, data);
124001
124007
  let reviewed;
124002
124008
  try {
124003
- reviewed = await generate("review", ReviewSchema, "Independently review EVERY JSON pointer and its value. supported requires exact quotes establishing the entire fact for the correct entity and time. A name mention or publication date is insufficient to establish employment, event date, ownership, or buying intent. Check all sources for actual factual contradictions. Complementary details from different sources are not a conflict; a price from one source and a term from another can jointly support a claim. Use conflicting only when sources make incompatible factual statements, unsupported for contradicted claims, unknown for missing support. Match the requested event period: an August release is not a September event even when published in September. Quoted wording must be verbatim; a paraphrase cannot be placed in quotation marks. Vendor claims about first/best status and performance metrics must remain explicitly attributed in the answer itself, not just in your reason. Null is unknown. Cite only supplied passage IDs; their text will be copied verbatim by the runtime. For each field, explicitly check answersQuestion (directly answers query/schema/instructions, not background or a non-answer), correctEntity, correctTime, and preservesScope. Read surrounding context and headings, not only the matching quote. A benefit/trial condition is not a program-wide rule; customer conditions are not partner conditions; eligible is not approved or automatic. Preserve exceptions, qualifiers and marketing attribution. Every check must pass for supported. A leader\u2019s education or career history does not answer who currently leads a team. Keep each reason under 25 words. Cite only the minimum passages needed to establish the entire field, at most four. Do not invent passage IDs. Read adjacent passages for conditions and exceptions, even when citing only one. Return each pointer once. Never treat this review as independent real-world verification.", {
124009
+ reviewed = await generate("review", reviewSchemaForPaths(batch.map((field) => field.path)), "Review ONLY the JSON pointers supplied in fields for this batch. The full answer schema is context, not a request to review other fields or reconstruct the extraction. Return exactly one verdict per supplied pointer and nothing else. supported requires exact quotes establishing the entire fact for the correct entity and time. A name mention or publication date is insufficient to establish employment, event date, ownership, or buying intent. Check all sources for actual factual contradictions. Complementary details from different sources are not a conflict; a price from one source and a term from another can jointly support a claim. Use conflicting only when sources make incompatible factual statements, unsupported for contradicted claims, unknown for missing support. Match the requested event period: an August release is not a September event even when published in September. Quoted wording must be verbatim; a paraphrase cannot be placed in quotation marks. Vendor claims about first/best status and performance metrics must remain explicitly attributed in the answer itself, not just in your reason. Null is unknown. Cite only supplied passage IDs; their text will be copied verbatim by the runtime. For each field, explicitly check answersQuestion (directly answers query/schema/instructions, not background or a non-answer), correctEntity, correctTime, and preservesScope. Read surrounding context and headings, not only the matching quote. A benefit/trial condition is not a program-wide rule; customer conditions are not partner conditions; eligible is not approved or automatic. Preserve exceptions, qualifiers and marketing attribution. Every check must pass for supported. A leader\u2019s education or career history does not answer who currently leads a team. Keep each reason under 25 words. Cite only the minimum passages needed to establish the entire field, at most four. Do not invent passage IDs. Read adjacent passages for conditions and exceptions, even when citing only one. Return each pointer once. Never treat this review as independent real-world verification.", {
124004
124010
  query: input.query,
124005
124011
  asOf: result.generatedAt,
124006
124012
  instructions: task.instructions,
@@ -124211,5 +124217,5 @@ export {
124211
124217
  webIndexPostgresSchemaSql
124212
124218
  };
124213
124219
 
124214
- //# debugId=222ABFDFD829B1BC64756E2164756E21
124220
+ //# debugId=26FFF5EE0DF8239664756E2164756E21
124215
124221
  //# sourceMappingURL=index.js.map