@claritylabs/cl-sdk 1.2.1 → 1.3.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/README.md +4 -2
- package/dist/index.d.mts +250 -82
- package/dist/index.d.ts +250 -82
- package/dist/index.js +114 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +114 -96
- package/dist/index.mjs.map +1 -1
- package/dist/storage-sqlite.d.mts +96 -34
- package/dist/storage-sqlite.d.ts +96 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CL-SDK
|
|
2
2
|
|
|
3
|
-
Deterministic insurance intelligence primitives for regulated AI agents.
|
|
3
|
+
Deterministic insurance intelligence primitives for regulated AI agents.
|
|
4
4
|
|
|
5
5
|
**[Documentation](https://cl-sdk.claritylabs.inc/docs)** | **[npm](https://www.npmjs.com/package/@claritylabs/cl-sdk)** | **[GitHub](https://github.com/claritylabs-inc/cl-sdk)**
|
|
6
6
|
|
|
@@ -80,6 +80,8 @@ const extractor = createExtractor({ generateText, generateObject, sourceStore })
|
|
|
80
80
|
const result = await extractor.extract(pdfBase64, "policy-123", { sourceSpans });
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
When source spans are available, section and endorsement extraction returns a compact index with page ranges, short excerpts, and `sourceSpanIds`/`sourceTextHash` instead of asking the model to reproduce full policy wording. Store `result.sourceSpans`/source chunks as the canonical evidence corpus for Q&A and source viewers; use `result.chunks` for structured facts and navigation metadata.
|
|
84
|
+
|
|
83
85
|
See the [full documentation](https://cl-sdk.claritylabs.inc/docs) for architecture, provider setup, API reference, and more.
|
|
84
86
|
|
|
85
87
|
## Multimodal Querying
|
|
@@ -135,7 +137,7 @@ If your callback ignores those fields, the model will only see the text prompt.
|
|
|
135
137
|
|
|
136
138
|
## Model routing metadata
|
|
137
139
|
|
|
138
|
-
Every SDK model callback may receive `taskKind` and `
|
|
140
|
+
Every SDK model callback may receive `taskKind`, `budgetDiagnostics`, and `trace`. Hosts can use these provider-agnostic fields for cheap-first routing, fallback, and telemetry without the SDK hardcoding model names. Example task kinds include `extraction_classify`, `extraction_focused`, `extraction_review`, `query_reason`, `application_extract_fields`, and `pce_impact_analysis`. `budgetDiagnostics` includes the resolved max-token budget and truncation-risk warnings for the current subtask. `trace` identifies the current extractor, page range, format batch, or source-backed call so host logs can show what was being generated instead of a generic model-call label.
|
|
139
141
|
|
|
140
142
|
## Bounded Agentic Workflows
|
|
141
143
|
|