@pdfvector/instance-contract 0.0.25 → 0.0.26
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.
|
@@ -82,6 +82,8 @@ const extractInputSchema = z.object({
|
|
|
82
82
|
const extractOutputSchema = z.object({
|
|
83
83
|
data: z
|
|
84
84
|
.unknown()
|
|
85
|
+
.refine((val) => val != null &&
|
|
86
|
+
(typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
|
|
85
87
|
.describe("Extracted structured data matching the provided JSON Schema"),
|
|
86
88
|
pageCount: z.number().int().describe("Total number of pages in the document"),
|
|
87
89
|
model: pdfvectorModelSchema.describe("Model tier used to extract the data"),
|
|
@@ -85,6 +85,8 @@ const extractOutputSchema = z
|
|
|
85
85
|
.object({
|
|
86
86
|
data: z
|
|
87
87
|
.unknown()
|
|
88
|
+
.refine((val) => val != null &&
|
|
89
|
+
(typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
|
|
88
90
|
.describe("Extracted structured data matching the provided JSON Schema"),
|
|
89
91
|
pageCount: z
|
|
90
92
|
.number()
|
|
@@ -82,6 +82,8 @@ const extractInputSchema = z.object({
|
|
|
82
82
|
const extractOutputSchema = z.object({
|
|
83
83
|
data: z
|
|
84
84
|
.unknown()
|
|
85
|
+
.refine((val) => val != null &&
|
|
86
|
+
(typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
|
|
85
87
|
.describe("Extracted structured data matching the provided JSON Schema"),
|
|
86
88
|
pageCount: z.number().int().describe("Total number of pages in the document"),
|
|
87
89
|
model: pdfvectorModelSchema.describe("Model tier used to extract the data"),
|
|
@@ -79,6 +79,8 @@ const extractInputSchema = z.object({
|
|
|
79
79
|
const extractOutputSchema = z.object({
|
|
80
80
|
data: z
|
|
81
81
|
.unknown()
|
|
82
|
+
.refine((val) => val != null &&
|
|
83
|
+
(typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
|
|
82
84
|
.describe("Extracted structured data matching the provided JSON Schema"),
|
|
83
85
|
pageCount: z.number().int().describe("Total number of pages in the document"),
|
|
84
86
|
model: pdfvectorModelSchema.describe("Model tier used to extract the data"),
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @pdfvector/instance-contract
|
|
2
2
|
|
|
3
|
+
## 0.0.26
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#144](https://github.com/phuctm97/pdfvector/pull/144) [`4ba69fc`](https://github.com/phuctm97/pdfvector/commit/4ba69fc05b9fe462bfb9475d923cad66211c3222) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add schema mismatch retry and empty output validation for extract API
|
|
9
|
+
|
|
3
10
|
## 0.0.25
|
|
4
11
|
### Patch Changes
|
|
5
12
|
|