@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 +19 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2941,9 +2941,14 @@ Return JSON only.`;
|
|
|
2941
2941
|
|
|
2942
2942
|
// src/prompts/extractors/declarations.ts
|
|
2943
2943
|
import { z as z27 } from "zod";
|
|
2944
|
-
var
|
|
2945
|
-
"
|
|
2946
|
-
)
|
|
2944
|
+
var DeclarationsFieldSchema = z27.object({
|
|
2945
|
+
field: z27.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
|
|
2946
|
+
value: z27.string().describe("Extracted value exactly as it appears in the document"),
|
|
2947
|
+
section: z27.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
|
|
2948
|
+
});
|
|
2949
|
+
var DeclarationsExtractSchema = z27.object({
|
|
2950
|
+
fields: z27.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
|
|
2951
|
+
});
|
|
2947
2952
|
function buildDeclarationsPrompt() {
|
|
2948
2953
|
return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
|
|
2949
2954
|
|
|
@@ -2967,9 +2972,18 @@ For PERSONAL LINES declarations:
|
|
|
2967
2972
|
- Flood (NFIP): flood zone, community number, building/contents coverage
|
|
2968
2973
|
- Personal Articles: scheduled items list with appraised values
|
|
2969
2974
|
|
|
2970
|
-
|
|
2975
|
+
Return each field as an object with "field" (descriptive name), "value" (exact text from document), and optional "section" (grouping).
|
|
2971
2976
|
|
|
2972
|
-
|
|
2977
|
+
Example output:
|
|
2978
|
+
{
|
|
2979
|
+
"fields": [
|
|
2980
|
+
{ "field": "policyNumber", "value": "GL-2025-78432", "section": "Policy Info" },
|
|
2981
|
+
{ "field": "effectiveDate", "value": "04/10/2025", "section": "Policy Info" },
|
|
2982
|
+
{ "field": "eachOccurrenceLimit", "value": "$1,000,000", "section": "Coverage Limits" }
|
|
2983
|
+
]
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
Preserve original values exactly as they appear. Return JSON only.`;
|
|
2973
2987
|
}
|
|
2974
2988
|
|
|
2975
2989
|
// src/prompts/extractors/loss-history.ts
|