@claritylabs/cl-sdk 0.7.0 → 0.7.1

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/index.js CHANGED
@@ -3173,9 +3173,14 @@ Return JSON only.`;
3173
3173
 
3174
3174
  // src/prompts/extractors/declarations.ts
3175
3175
  var import_zod27 = require("zod");
3176
- var DeclarationsExtractSchema = import_zod27.z.record(import_zod27.z.string(), import_zod27.z.unknown()).describe(
3177
- "Flexible declarations data \u2014 structure varies by line of business. Keys are descriptive field names, values are the extracted data."
3178
- );
3176
+ var DeclarationsFieldSchema = import_zod27.z.object({
3177
+ field: import_zod27.z.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
3178
+ value: import_zod27.z.string().describe("Extracted value exactly as it appears in the document"),
3179
+ section: import_zod27.z.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
3180
+ });
3181
+ var DeclarationsExtractSchema = import_zod27.z.object({
3182
+ fields: import_zod27.z.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
3183
+ });
3179
3184
  function buildDeclarationsPrompt() {
3180
3185
  return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
3181
3186
 
@@ -3199,9 +3204,18 @@ For PERSONAL LINES declarations:
3199
3204
  - Flood (NFIP): flood zone, community number, building/contents coverage
3200
3205
  - Personal Articles: scheduled items list with appraised values
3201
3206
 
3202
- Use descriptive field names as keys. Preserve original values exactly as they appear.
3207
+ Return each field as an object with "field" (descriptive name), "value" (exact text from document), and optional "section" (grouping).
3203
3208
 
3204
- Return JSON only.`;
3209
+ Example output:
3210
+ {
3211
+ "fields": [
3212
+ { "field": "policyNumber", "value": "GL-2025-78432", "section": "Policy Info" },
3213
+ { "field": "effectiveDate", "value": "04/10/2025", "section": "Policy Info" },
3214
+ { "field": "eachOccurrenceLimit", "value": "$1,000,000", "section": "Coverage Limits" }
3215
+ ]
3216
+ }
3217
+
3218
+ Preserve original values exactly as they appear. Return JSON only.`;
3205
3219
  }
3206
3220
 
3207
3221
  // src/prompts/extractors/loss-history.ts