@pdfvector/instance-contract 0.0.48 → 0.0.56
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/.tsc/lib/page-markdown-schema.d.ts +5 -0
- package/.tsc/lib/page-markdown-schema.js +9 -0
- package/.tsc/lib/router/academic/fetch.js +2 -0
- package/.tsc/lib/router/academic/find-citations.js +2 -0
- package/.tsc/lib/router/academic/paper-graph.js +2 -0
- package/.tsc/lib/router/academic/parse.d.ts +5 -0
- package/.tsc/lib/router/academic/parse.js +20 -0
- package/.tsc/lib/router/academic/search-grants.js +2 -0
- package/.tsc/lib/router/academic/search.js +2 -0
- package/.tsc/lib/router/academic/similar-papers.js +2 -0
- package/.tsc/lib/router/bankStatement/ask.js +6 -1
- package/.tsc/lib/router/bankStatement/extract.js +6 -1
- package/.tsc/lib/router/bankStatement/parse.js +6 -1
- package/.tsc/lib/router/document/ask.js +6 -1
- package/.tsc/lib/router/document/extract.js +6 -1
- package/.tsc/lib/router/document/parse.d.ts +8 -0
- package/.tsc/lib/router/document/parse.js +26 -1
- package/.tsc/lib/router/identity/ask.js +6 -1
- package/.tsc/lib/router/identity/extract.js +6 -1
- package/.tsc/lib/router/identity/parse.js +6 -1
- package/.tsc/lib/router/invoice/ask.js +6 -1
- package/.tsc/lib/router/invoice/extract.js +6 -1
- package/.tsc/lib/router/invoice/parse.js +6 -1
- package/CHANGELOG.md +75 -0
- package/package.json +5 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { academicCreditCosts } from "@pdfvector/util";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { providerSchema } from "./provider.js";
|
|
@@ -112,6 +113,7 @@ export const fetch = oc
|
|
|
112
113
|
mediaType.examples = requestExamples;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
116
|
+
op["x-codeSamples"] = getOpenApiCodeSamples("academic-fetch");
|
|
115
117
|
return op;
|
|
116
118
|
},
|
|
117
119
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { academicCreditCosts } from "@pdfvector/util";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { providerSchema } from "./provider.js";
|
|
@@ -109,6 +110,7 @@ export const findCitations = oc
|
|
|
109
110
|
mediaType.examples = requestExamples;
|
|
110
111
|
}
|
|
111
112
|
}
|
|
113
|
+
op["x-codeSamples"] = getOpenApiCodeSamples("academic-find-citations");
|
|
112
114
|
return op;
|
|
113
115
|
},
|
|
114
116
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { academicCreditCosts } from "@pdfvector/util";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { providerSchema } from "./provider.js";
|
|
@@ -137,6 +138,7 @@ export const paperGraph = oc
|
|
|
137
138
|
mediaType.examples = requestExamples;
|
|
138
139
|
}
|
|
139
140
|
}
|
|
141
|
+
op["x-codeSamples"] = getOpenApiCodeSamples("academic-paper-graph");
|
|
140
142
|
return op;
|
|
141
143
|
},
|
|
142
144
|
});
|
|
@@ -9,6 +9,7 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
|
|
|
9
9
|
max: "max";
|
|
10
10
|
auto: "auto";
|
|
11
11
|
}>>>;
|
|
12
|
+
includePages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
12
13
|
callback: z.ZodOptional<z.ZodObject<{
|
|
13
14
|
url: z.ZodURL;
|
|
14
15
|
type: z.ZodOptional<z.ZodString>;
|
|
@@ -41,4 +42,8 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
|
|
|
41
42
|
credits: z.ZodNumber;
|
|
42
43
|
requestId: z.ZodNumber;
|
|
43
44
|
html: z.ZodOptional<z.ZodString>;
|
|
45
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
46
|
+
pageNumber: z.ZodNumber;
|
|
47
|
+
markdown: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
44
49
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { academicParseOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
5
|
+
import { pageMarkdownSchema } from "../../page-markdown-schema.js";
|
|
4
6
|
import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
|
|
5
7
|
import { documentParseModelDescription, outputModelDescription, } from "../../supported-mimes.js";
|
|
6
8
|
import { providerSchema } from "./provider.js";
|
|
@@ -33,6 +35,11 @@ const parseInputSchema = z
|
|
|
33
35
|
.optional()
|
|
34
36
|
.default("auto")
|
|
35
37
|
.describe(documentParseModelDescription),
|
|
38
|
+
includePages: z
|
|
39
|
+
.boolean()
|
|
40
|
+
.optional()
|
|
41
|
+
.default(false)
|
|
42
|
+
.describe("Set to true to include page-separated markdown in the pages array. Existing markdown output is still returned as the full paper text."),
|
|
36
43
|
callback: callbackSchema,
|
|
37
44
|
})
|
|
38
45
|
.superRefine((input, ctx) => {
|
|
@@ -82,6 +89,10 @@ const parseOutputSchema = z.object({
|
|
|
82
89
|
.string()
|
|
83
90
|
.optional()
|
|
84
91
|
.describe("Full HTML representation of the paper content. Only available when using the 'max' model."),
|
|
92
|
+
pages: z
|
|
93
|
+
.array(pageMarkdownSchema)
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("Page-separated markdown content. Returned only when includePages is true."),
|
|
85
96
|
});
|
|
86
97
|
const requestExamples = {
|
|
87
98
|
"Parse ArXiv paper by ID": {
|
|
@@ -105,6 +116,14 @@ const requestExamples = {
|
|
|
105
116
|
model: "auto",
|
|
106
117
|
},
|
|
107
118
|
},
|
|
119
|
+
"Parse paper with page-separated output": {
|
|
120
|
+
summary: "Parse paper with page-separated output",
|
|
121
|
+
value: {
|
|
122
|
+
id: "1706.03762",
|
|
123
|
+
model: "auto",
|
|
124
|
+
includePages: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
108
127
|
};
|
|
109
128
|
export const parse = oc
|
|
110
129
|
.input(parseInputSchema)
|
|
@@ -121,6 +140,7 @@ export const parse = oc
|
|
|
121
140
|
mediaType.examples = requestExamples;
|
|
122
141
|
}
|
|
123
142
|
}
|
|
143
|
+
op["x-codeSamples"] = academicParseOpenApiCodeSamples;
|
|
124
144
|
return op;
|
|
125
145
|
},
|
|
126
146
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { academicCreditCosts } from "@pdfvector/util";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { grantProviderSchema } from "./provider.js";
|
|
@@ -164,6 +165,7 @@ export const searchGrants = oc
|
|
|
164
165
|
mediaType.examples = requestExamples;
|
|
165
166
|
}
|
|
166
167
|
}
|
|
168
|
+
op["x-codeSamples"] = getOpenApiCodeSamples("academic-search-grants");
|
|
167
169
|
return op;
|
|
168
170
|
},
|
|
169
171
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { academicCreditCosts } from "@pdfvector/util";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { providerSchema } from "./provider.js";
|
|
@@ -147,6 +148,7 @@ export const search = oc
|
|
|
147
148
|
mediaType.examples = requestExamples;
|
|
148
149
|
}
|
|
149
150
|
}
|
|
151
|
+
op["x-codeSamples"] = getOpenApiCodeSamples("academic-search");
|
|
150
152
|
return op;
|
|
151
153
|
},
|
|
152
154
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { academicCreditCosts } from "@pdfvector/util";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { providerSchema } from "./provider.js";
|
|
@@ -136,6 +137,7 @@ export const similarPapers = oc
|
|
|
136
137
|
mediaType.examples = requestExamples;
|
|
137
138
|
}
|
|
138
139
|
}
|
|
140
|
+
op["x-codeSamples"] = getOpenApiCodeSamples("academic-similar-papers");
|
|
139
141
|
return op;
|
|
140
142
|
},
|
|
141
143
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
|
|
@@ -70,7 +71,11 @@ export const ask = oc
|
|
|
70
71
|
summary: "Ask a question about a bank statement",
|
|
71
72
|
description: `Parse a bank statement and answer a question about its content using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
72
73
|
tags: ["Bank Statement"],
|
|
73
|
-
spec: (op) =>
|
|
74
|
+
spec: (op) => {
|
|
75
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
76
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("bank-statement-ask");
|
|
77
|
+
return spec;
|
|
78
|
+
},
|
|
74
79
|
})
|
|
75
80
|
.input(askInputSchema)
|
|
76
81
|
.output(askOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { jsonSchemaInput } from "../../json-schema-input.js";
|
|
@@ -95,7 +96,11 @@ export const extract = oc
|
|
|
95
96
|
summary: "Extract structured data from a bank statement",
|
|
96
97
|
description: `Parse a bank statement and extract structured data matching a provided JSON Schema using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
97
98
|
tags: ["Bank Statement"],
|
|
98
|
-
spec: (op) =>
|
|
99
|
+
spec: (op) => {
|
|
100
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
101
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("bank-statement-extract");
|
|
102
|
+
return spec;
|
|
103
|
+
},
|
|
99
104
|
})
|
|
100
105
|
.input(extractInputSchema)
|
|
101
106
|
.output(extractOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { specializedParseModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
|
|
@@ -87,7 +88,11 @@ export const parse = oc
|
|
|
87
88
|
summary: "Parse a bank statement",
|
|
88
89
|
description: `Extract text and structured data from a bank statement. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
89
90
|
tags: ["Bank Statement"],
|
|
90
|
-
spec: (op) =>
|
|
91
|
+
spec: (op) => {
|
|
92
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
93
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("bank-statement-parse");
|
|
94
|
+
return spec;
|
|
95
|
+
},
|
|
91
96
|
})
|
|
92
97
|
.input(parseInputSchema)
|
|
93
98
|
.output(parseOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
|
|
@@ -116,7 +117,11 @@ export const ask = oc
|
|
|
116
117
|
summary: "Ask a question about a document",
|
|
117
118
|
description: `Parse a document and answer a question about its content using AI. Supports ${supportedFileTypesLong}. Files up to 1000 pages and up to 500MB in size. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
118
119
|
tags: ["Document"],
|
|
119
|
-
spec: (op) =>
|
|
120
|
+
spec: (op) => {
|
|
121
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
122
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("document-ask");
|
|
123
|
+
return spec;
|
|
124
|
+
},
|
|
120
125
|
})
|
|
121
126
|
.input(askInputSchema)
|
|
122
127
|
.output(askOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { jsonSchemaInput } from "../../json-schema-input.js";
|
|
@@ -134,7 +135,11 @@ export const extract = oc
|
|
|
134
135
|
summary: "Extract structured data from a document",
|
|
135
136
|
description: `Parse a document and extract structured data matching a provided JSON Schema using AI. Supports ${supportedFileTypesLong}. Files up to 1000 pages and up to 500MB in size. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
136
137
|
tags: ["Document"],
|
|
137
|
-
spec: (op) =>
|
|
138
|
+
spec: (op) => {
|
|
139
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
140
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("document-extract");
|
|
141
|
+
return spec;
|
|
142
|
+
},
|
|
138
143
|
})
|
|
139
144
|
.input(extractInputSchema)
|
|
140
145
|
.output(extractOutputSchema);
|
|
@@ -10,6 +10,10 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
|
|
|
10
10
|
max: "max";
|
|
11
11
|
auto: "auto";
|
|
12
12
|
}>>>;
|
|
13
|
+
includePages: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodPipe<z.ZodEnum<{
|
|
14
|
+
true: "true";
|
|
15
|
+
false: "false";
|
|
16
|
+
}>, z.ZodTransform<boolean, "true" | "false">>]>>>;
|
|
13
17
|
callback: z.ZodOptional<z.ZodObject<{
|
|
14
18
|
url: z.ZodURL;
|
|
15
19
|
type: z.ZodOptional<z.ZodString>;
|
|
@@ -27,4 +31,8 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
|
|
|
27
31
|
requestId: z.ZodNumber;
|
|
28
32
|
html: z.ZodOptional<z.ZodString>;
|
|
29
33
|
documentId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
|
+
pageNumber: z.ZodNumber;
|
|
36
|
+
markdown: z.ZodString;
|
|
37
|
+
}, z.core.$strip>>>;
|
|
30
38
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { documentParseOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
5
|
+
import { pageMarkdownSchema } from "../../page-markdown-schema.js";
|
|
4
6
|
import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
|
|
5
7
|
import { documentParseModelDescription, outputModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
|
|
6
8
|
import { getDefaultSpec } from "./get-default-spec.js";
|
|
@@ -22,6 +24,14 @@ const parseInputSchema = z.object({
|
|
|
22
24
|
.optional()
|
|
23
25
|
.default("auto")
|
|
24
26
|
.describe(documentParseModelDescription),
|
|
27
|
+
includePages: z
|
|
28
|
+
.union([
|
|
29
|
+
z.boolean(),
|
|
30
|
+
z.enum(["true", "false"]).transform((value) => value === "true"),
|
|
31
|
+
])
|
|
32
|
+
.optional()
|
|
33
|
+
.default(false)
|
|
34
|
+
.describe("Set to true to include page-separated markdown in the pages array. Existing markdown output is still returned as the full document text."),
|
|
25
35
|
callback: z
|
|
26
36
|
.object({
|
|
27
37
|
url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
|
|
@@ -57,6 +67,10 @@ const parseOutputSchema = z.object({
|
|
|
57
67
|
.string()
|
|
58
68
|
.optional()
|
|
59
69
|
.describe("Document ID if provided via x-pdfvector-document-id header"),
|
|
70
|
+
pages: z
|
|
71
|
+
.array(pageMarkdownSchema)
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Page-separated markdown content. Returned only when includePages is true."),
|
|
60
74
|
});
|
|
61
75
|
const requestExamples = {
|
|
62
76
|
"Parse from URL": {
|
|
@@ -84,6 +98,13 @@ const requestExamples = {
|
|
|
84
98
|
model: "nano",
|
|
85
99
|
},
|
|
86
100
|
},
|
|
101
|
+
"Parse with page-separated output": {
|
|
102
|
+
summary: "Parse with page-separated output",
|
|
103
|
+
value: {
|
|
104
|
+
url: "https://drive.google.com/file/d/13T04Yk20OwBNIDyvJJ3XlUg9WfOsmbjm/view?usp=share_link",
|
|
105
|
+
includePages: true,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
87
108
|
"Parse with small complex documents (pro)": {
|
|
88
109
|
summary: "Parse with small complex documents (pro)",
|
|
89
110
|
value: {
|
|
@@ -104,7 +125,11 @@ export const parse = oc
|
|
|
104
125
|
summary: "Parse a document",
|
|
105
126
|
description: `Extract text and page count from a document. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
106
127
|
tags: ["Document"],
|
|
107
|
-
spec: (op) =>
|
|
128
|
+
spec: (op) => {
|
|
129
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
130
|
+
spec["x-codeSamples"] = documentParseOpenApiCodeSamples;
|
|
131
|
+
return spec;
|
|
132
|
+
},
|
|
108
133
|
})
|
|
109
134
|
.input(parseInputSchema)
|
|
110
135
|
.output(parseOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
|
|
@@ -77,7 +78,11 @@ export const ask = oc
|
|
|
77
78
|
summary: "Ask a question about an identity document",
|
|
78
79
|
description: `Parse an identity document and answer a question about its content using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
79
80
|
tags: ["Identity"],
|
|
80
|
-
spec: (op) =>
|
|
81
|
+
spec: (op) => {
|
|
82
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
83
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("identity-ask");
|
|
84
|
+
return spec;
|
|
85
|
+
},
|
|
81
86
|
})
|
|
82
87
|
.input(askInputSchema)
|
|
83
88
|
.output(askOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { jsonSchemaInput } from "../../json-schema-input.js";
|
|
@@ -85,7 +86,11 @@ export const extract = oc
|
|
|
85
86
|
summary: "Extract structured data from an identity document",
|
|
86
87
|
description: `Parse an identity document and extract structured data matching a provided JSON Schema using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
87
88
|
tags: ["Identity"],
|
|
88
|
-
spec: (op) =>
|
|
89
|
+
spec: (op) => {
|
|
90
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
91
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("identity-extract");
|
|
92
|
+
return spec;
|
|
93
|
+
},
|
|
89
94
|
})
|
|
90
95
|
.input(extractInputSchema)
|
|
91
96
|
.output(extractOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { specializedParseModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
|
|
@@ -91,7 +92,11 @@ export const parse = oc
|
|
|
91
92
|
summary: "Parse an identity document",
|
|
92
93
|
description: `Extract text and structured data from an identity document. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
93
94
|
tags: ["Identity"],
|
|
94
|
-
spec: (op) =>
|
|
95
|
+
spec: (op) => {
|
|
96
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
97
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("identity-parse");
|
|
98
|
+
return spec;
|
|
99
|
+
},
|
|
95
100
|
})
|
|
96
101
|
.input(parseInputSchema)
|
|
97
102
|
.output(parseOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
|
|
@@ -67,7 +68,11 @@ export const ask = oc
|
|
|
67
68
|
summary: "Ask a question about an invoice",
|
|
68
69
|
description: `Parse an invoice and answer a question about its content using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
69
70
|
tags: ["Invoice"],
|
|
70
|
-
spec: (op) =>
|
|
71
|
+
spec: (op) => {
|
|
72
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
73
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("invoice-ask");
|
|
74
|
+
return spec;
|
|
75
|
+
},
|
|
71
76
|
})
|
|
72
77
|
.input(askInputSchema)
|
|
73
78
|
.output(askOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { jsonSchemaInput } from "../../json-schema-input.js";
|
|
@@ -91,7 +92,11 @@ export const extract = oc
|
|
|
91
92
|
summary: "Extract structured data from an invoice",
|
|
92
93
|
description: `Parse an invoice and extract structured data matching a provided JSON Schema using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
93
94
|
tags: ["Invoice"],
|
|
94
|
-
spec: (op) =>
|
|
95
|
+
spec: (op) => {
|
|
96
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
97
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("invoice-extract");
|
|
98
|
+
return spec;
|
|
99
|
+
},
|
|
95
100
|
})
|
|
96
101
|
.input(extractInputSchema)
|
|
97
102
|
.output(extractOutputSchema);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
4
5
|
import { specializedParseModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
|
|
@@ -82,7 +83,11 @@ export const parse = oc
|
|
|
82
83
|
summary: "Parse an invoice",
|
|
83
84
|
description: `Extract text and structured data from an invoice. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
84
85
|
tags: ["Invoice"],
|
|
85
|
-
spec: (op) =>
|
|
86
|
+
spec: (op) => {
|
|
87
|
+
const spec = getDefaultSpec(op, requestExamples);
|
|
88
|
+
spec["x-codeSamples"] = getOpenApiCodeSamples("invoice-parse");
|
|
89
|
+
return spec;
|
|
90
|
+
},
|
|
86
91
|
})
|
|
87
92
|
.input(parseInputSchema)
|
|
88
93
|
.output(parseOutputSchema);
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# @pdfvector/instance-contract
|
|
2
2
|
|
|
3
|
+
## 0.0.56
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#274](https://github.com/phuctm97/pdfvector/pull/274) [`5f61021`](https://github.com/phuctm97/pdfvector/commit/5f61021385f3d97e02bc92d2d8b5ed2ad3ffd17f) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Expand shared public API docs, export pricing, add full OpenAPI code samples, and remove the redundant website skills.sh route.
|
|
9
|
+
|
|
10
|
+
- Updated dependencies [[`5f61021`](https://github.com/phuctm97/pdfvector/commit/5f61021385f3d97e02bc92d2d8b5ed2ad3ffd17f)]:
|
|
11
|
+
- @pdfvector/api-docs@0.0.6
|
|
12
|
+
|
|
13
|
+
## 0.0.55
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
- [#273](https://github.com/phuctm97/pdfvector/pull/273) [`905025f`](https://github.com/phuctm97/pdfvector/commit/905025f926b760b5b1b7f6cfc876fc8557c70d46) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Release npm packages with trusted publishing
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`905025f`](https://github.com/phuctm97/pdfvector/commit/905025f926b760b5b1b7f6cfc876fc8557c70d46)]:
|
|
21
|
+
- @pdfvector/api-docs@0.0.5
|
|
22
|
+
- @pdfvector/util@0.0.23
|
|
23
|
+
|
|
24
|
+
## 0.0.54
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- [#271](https://github.com/phuctm97/pdfvector/pull/271) [`054e4db`](https://github.com/phuctm97/pdfvector/commit/054e4dbeb712d5fe482c80f08082c33e09480942) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Authenticate npm package release workflows
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`054e4db`](https://github.com/phuctm97/pdfvector/commit/054e4dbeb712d5fe482c80f08082c33e09480942)]:
|
|
32
|
+
- @pdfvector/api-docs@0.0.4
|
|
33
|
+
|
|
34
|
+
## 0.0.53
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
- [#270](https://github.com/phuctm97/pdfvector/pull/270) [`e3503c4`](https://github.com/phuctm97/pdfvector/commit/e3503c4922384cad889e92cc2a6f5979b05544fe) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Use npm publish for npm package release workflows
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [[`e3503c4`](https://github.com/phuctm97/pdfvector/commit/e3503c4922384cad889e92cc2a6f5979b05544fe)]:
|
|
42
|
+
- @pdfvector/api-docs@0.0.3
|
|
43
|
+
|
|
44
|
+
## 0.0.52
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
- [#269](https://github.com/phuctm97/pdfvector/pull/269) [`11c2f38`](https://github.com/phuctm97/pdfvector/commit/11c2f3891ceaa9f051664598624a3e75aa5f096d) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Fix npm package release publishing
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [[`11c2f38`](https://github.com/phuctm97/pdfvector/commit/11c2f3891ceaa9f051664598624a3e75aa5f096d)]:
|
|
52
|
+
- @pdfvector/api-docs@0.0.2
|
|
53
|
+
|
|
54
|
+
## 0.0.51
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
- [#268](https://github.com/phuctm97/pdfvector/pull/268) [`37c6f35`](https://github.com/phuctm97/pdfvector/commit/37c6f35a6d2129e95a79fd44f7834a6e12df04ee) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add page-separated parse output
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [[`37c6f35`](https://github.com/phuctm97/pdfvector/commit/37c6f35a6d2129e95a79fd44f7834a6e12df04ee)]:
|
|
62
|
+
- @pdfvector/api-docs@0.0.1
|
|
63
|
+
|
|
64
|
+
## 0.0.50
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
- [#267](https://github.com/phuctm97/pdfvector/pull/267) [`d6f79b3`](https://github.com/phuctm97/pdfvector/commit/d6f79b3d9a8bf5554e3f8dc0912468031ddb0c7a) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Suppress image empty parse Sentry noise
|
|
70
|
+
|
|
71
|
+
## 0.0.49
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
- [#260](https://github.com/phuctm97/pdfvector/pull/260) [`e24aa70`](https://github.com/phuctm97/pdfvector/commit/e24aa706cdd48a10efa13d3d613d63cebf921d16) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Update workspace dependencies
|
|
77
|
+
|
|
3
78
|
## 0.0.48
|
|
4
79
|
### Patch Changes
|
|
5
80
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdfvector/instance-contract",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "API contract definitions for PDF Vector instance server",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"main": ".tsc/lib/index.js",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@orpc/client": "^1.14.
|
|
24
|
-
"@orpc/contract": "^1.14.
|
|
25
|
-
"@pdfvector/
|
|
23
|
+
"@orpc/client": "^1.14.5",
|
|
24
|
+
"@orpc/contract": "^1.14.5",
|
|
25
|
+
"@pdfvector/api-docs": "^0.0.6",
|
|
26
|
+
"@pdfvector/util": "^0.0.23"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"zod": "^4.4.3"
|