@pdfvector/instance-contract 0.0.7 → 0.0.8
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/index.d.ts +2 -0
- package/.tsc/lib/index.js +2 -0
- package/.tsc/lib/pdfvector-model-schema.d.ts +7 -0
- package/.tsc/lib/pdfvector-model-schema.js +2 -0
- package/.tsc/lib/pdfvector-model.d.ts +3 -0
- package/.tsc/lib/pdfvector-model.js +0 -0
- package/.tsc/lib/router/document/ask.d.ts +1 -1
- package/.tsc/lib/router/document/ask.js +6 -7
- package/.tsc/lib/router/document/extract.d.ts +1 -1
- package/.tsc/lib/router/document/extract.js +6 -7
- package/.tsc/lib/router/document/parse.d.ts +1 -1
- package/.tsc/lib/router/document/parse.js +8 -9
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
package/.tsc/lib/index.d.ts
CHANGED
|
@@ -3,3 +3,5 @@ import * as contract from "./router";
|
|
|
3
3
|
export { contract };
|
|
4
4
|
export type ContractInputs = InferContractRouterInputs<typeof contract>;
|
|
5
5
|
export type ContractOutputs = InferContractRouterOutputs<typeof contract>;
|
|
6
|
+
export * from "./pdfvector-model";
|
|
7
|
+
export * from "./pdfvector-model-schema";
|
package/.tsc/lib/index.js
CHANGED
|
File without changes
|
|
@@ -5,11 +5,11 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
|
|
|
5
5
|
base64: z.ZodOptional<z.ZodString>;
|
|
6
6
|
question: z.ZodString;
|
|
7
7
|
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
8
|
-
auto: "auto";
|
|
9
8
|
nano: "nano";
|
|
10
9
|
mini: "mini";
|
|
11
10
|
pro: "pro";
|
|
12
11
|
max: "max";
|
|
12
|
+
auto: "auto";
|
|
13
13
|
}>>>;
|
|
14
14
|
}, z.core.$strip>, z.ZodObject<{
|
|
15
15
|
markdown: z.ZodString;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { pdfvectorModelSchema } from "../../pdfvector-model-schema";
|
|
3
4
|
import { getDefaultSpec } from "./get-default-spec";
|
|
4
5
|
const askInputSchema = z.object({
|
|
5
6
|
url: z
|
|
@@ -28,22 +29,20 @@ const askInputSchema = z.object({
|
|
|
28
29
|
.min(4)
|
|
29
30
|
.describe("The question to answer about the document"),
|
|
30
31
|
model: z
|
|
31
|
-
.enum(["auto",
|
|
32
|
+
.enum(["auto", ...pdfvectorModelSchema.options])
|
|
32
33
|
.optional()
|
|
33
34
|
.default("auto")
|
|
34
35
|
.describe("Model tier for answering the question. " +
|
|
35
36
|
"'auto' (default): Automatically selects the best tier based on document page count and document complexity. " +
|
|
36
|
-
"'nano': Uses lightweight models (gpt-
|
|
37
|
+
"'nano': Uses lightweight models (gpt-5-nano, ...). Supports PDF, Word, Excel, CSV. " +
|
|
37
38
|
"'mini': Uses mid-range models (gpt-5-mini, gemini-3-flash, claude-haiku-4-5, ...). Supports PDF, Word, Excel, CSV. " +
|
|
38
39
|
"'pro': Uses capable models (gpt-5.2, gemini-3.1-pro, claude-sonnet-4-6, ...). Supports PDF, Word, Excel, CSV, Image. " +
|
|
39
|
-
"'max': Uses the most powerful models (
|
|
40
|
+
"'max': Uses the most powerful models (claude-opus-4-6, ...). Supports PDF, Word, Excel, CSV, Image."),
|
|
40
41
|
});
|
|
41
42
|
const askOutputSchema = z
|
|
42
43
|
.object({
|
|
43
44
|
markdown: z.string().describe("The answer to the question"),
|
|
44
|
-
model:
|
|
45
|
-
.enum(["nano", "mini", "pro", "max"])
|
|
46
|
-
.describe("Model tier used to answer the question. " +
|
|
45
|
+
model: pdfvectorModelSchema.describe("Model tier used to answer the question. " +
|
|
47
46
|
"'nano': Supports PDF, Word, Excel, CSV. " +
|
|
48
47
|
"'mini': Supports PDF, Word, Excel, CSV. " +
|
|
49
48
|
"'pro': Supports PDF, Word, Excel, CSV, Image. " +
|
|
@@ -99,7 +98,7 @@ const requestExamples = {
|
|
|
99
98
|
export const ask = oc
|
|
100
99
|
.route({
|
|
101
100
|
summary: "Ask a question about a document",
|
|
102
|
-
description: "Parse a document and answer a question about its content using AI. Supports PDF, Word (.docx), Excel (.xlsx), CSV, and Image (.png, .jpg) files. Provide the document via file upload, a public URL, or a base64-encoded string.",
|
|
101
|
+
description: "Parse a document and answer a question about its content using AI. Supports PDF, Word (.docx), Excel (.xlsx), CSV, and Image (.png, .jpg) files. 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.",
|
|
103
102
|
tags: ["Document"],
|
|
104
103
|
spec: (op) => getDefaultSpec(op, requestExamples),
|
|
105
104
|
})
|
|
@@ -6,11 +6,11 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
|
|
|
6
6
|
prompt: z.ZodString;
|
|
7
7
|
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8
8
|
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
9
|
-
auto: "auto";
|
|
10
9
|
nano: "nano";
|
|
11
10
|
mini: "mini";
|
|
12
11
|
pro: "pro";
|
|
13
12
|
max: "max";
|
|
13
|
+
auto: "auto";
|
|
14
14
|
}>>>;
|
|
15
15
|
}, z.core.$strip>, z.ZodObject<{
|
|
16
16
|
data: z.ZodUnknown;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { pdfvectorModelSchema } from "../../pdfvector-model-schema";
|
|
3
4
|
import { getDefaultSpec } from "./get-default-spec";
|
|
4
5
|
const extractInputSchema = z.object({
|
|
5
6
|
url: z
|
|
@@ -31,24 +32,22 @@ const extractInputSchema = z.object({
|
|
|
31
32
|
.record(z.string(), z.unknown())
|
|
32
33
|
.describe("JSON Schema describing the structure of the data to extract from the document"),
|
|
33
34
|
model: z
|
|
34
|
-
.enum(["auto",
|
|
35
|
+
.enum(["auto", ...pdfvectorModelSchema.options])
|
|
35
36
|
.optional()
|
|
36
37
|
.default("auto")
|
|
37
38
|
.describe("Model tier for extracting structured data. " +
|
|
38
39
|
"'auto' (default): Automatically selects the best tier based on document page count and document complexity. " +
|
|
39
|
-
"'nano': Uses lightweight models (gpt-
|
|
40
|
+
"'nano': Uses lightweight models (gpt-5-nano, ...). Supports PDF, Word, Excel, CSV. " +
|
|
40
41
|
"'mini': Uses mid-range models (gpt-5-mini, gemini-3-flash, claude-haiku-4-5, ...). Supports PDF, Word, Excel, CSV. " +
|
|
41
42
|
"'pro': Uses capable models (gpt-5.2, gemini-3.1-pro, claude-sonnet-4-6, ...). Supports PDF, Word, Excel, CSV, Image. " +
|
|
42
|
-
"'max': Uses the most powerful models (
|
|
43
|
+
"'max': Uses the most powerful models (claude-opus-4-6, ...). Supports PDF, Word, Excel, CSV, Image."),
|
|
43
44
|
});
|
|
44
45
|
const extractOutputSchema = z
|
|
45
46
|
.object({
|
|
46
47
|
data: z
|
|
47
48
|
.unknown()
|
|
48
49
|
.describe("Extracted structured data matching the provided JSON Schema"),
|
|
49
|
-
model:
|
|
50
|
-
.enum(["nano", "mini", "pro", "max"])
|
|
51
|
-
.describe("Model tier used to extract the data. " +
|
|
50
|
+
model: pdfvectorModelSchema.describe("Model tier used to extract the data. " +
|
|
52
51
|
"'nano': Supports PDF, Word, Excel, CSV. " +
|
|
53
52
|
"'mini': Supports PDF, Word, Excel, CSV. " +
|
|
54
53
|
"'pro': Supports PDF, Word, Excel, CSV, Image. " +
|
|
@@ -116,7 +115,7 @@ const requestExamples = {
|
|
|
116
115
|
export const extract = oc
|
|
117
116
|
.route({
|
|
118
117
|
summary: "Extract structured data from a document",
|
|
119
|
-
description: "Parse a document and extract structured data matching a provided JSON Schema using AI. Supports PDF, Word (.docx), Excel (.xlsx), CSV, and Image (.png, .jpg) files. Provide the document via file upload, a public URL, or a base64-encoded string.",
|
|
118
|
+
description: "Parse a document and extract structured data matching a provided JSON Schema using AI. Supports PDF, Word (.docx), Excel (.xlsx), CSV, and Image (.png, .jpg) files. 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.",
|
|
120
119
|
tags: ["Document"],
|
|
121
120
|
spec: (op) => getDefaultSpec(op, requestExamples),
|
|
122
121
|
})
|
|
@@ -4,11 +4,11 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
|
|
|
4
4
|
file: z.ZodOptional<z.ZodFile>;
|
|
5
5
|
base64: z.ZodOptional<z.ZodString>;
|
|
6
6
|
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
7
|
-
auto: "auto";
|
|
8
7
|
nano: "nano";
|
|
9
8
|
mini: "mini";
|
|
10
9
|
pro: "pro";
|
|
11
10
|
max: "max";
|
|
11
|
+
auto: "auto";
|
|
12
12
|
}>>>;
|
|
13
13
|
}, z.core.$strip>, z.ZodObject<{
|
|
14
14
|
markdown: z.ZodString;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { pdfvectorModelSchema } from "../../pdfvector-model-schema";
|
|
3
4
|
import { getDefaultSpec } from "./get-default-spec";
|
|
4
5
|
const parseInputSchema = z.object({
|
|
5
6
|
url: z
|
|
@@ -24,15 +25,15 @@ const parseInputSchema = z.object({
|
|
|
24
25
|
.optional()
|
|
25
26
|
.describe("Base64-encoded document file content"),
|
|
26
27
|
model: z
|
|
27
|
-
.enum(["auto",
|
|
28
|
+
.enum(["auto", ...pdfvectorModelSchema.options])
|
|
28
29
|
.optional()
|
|
29
30
|
.default("auto")
|
|
30
31
|
.describe("Model tier for parsing. " +
|
|
31
|
-
"'auto' (default): Automatically selects the best parsing strategy with intelligent fallback. " +
|
|
32
|
-
"'nano': For simple documents with plain text content. Supports PDF, Word, Excel, CSV. " +
|
|
33
|
-
"'mini': For documents with tables and structured content. Supports PDF, Word, Excel, CSV. " +
|
|
34
|
-
"'pro': For documents up to
|
|
35
|
-
"'max': For large documents
|
|
32
|
+
"'auto' (default): Automatically selects the best parsing strategy with intelligent fallback. File up to 1000 pages, up to 500MB in size. Supports PDF, Word, Excel, CSV, Image. " +
|
|
33
|
+
"'nano': For simple documents with plain text content. File up to 30 pages, up to 10MB in size. Supports PDF, Word, Excel, CSV. " +
|
|
34
|
+
"'mini': For documents with tables and structured content. File up to 30 pages, up to 10MB in size. Supports PDF, Word, Excel, CSV. " +
|
|
35
|
+
"'pro': For documents up to 30 pages with tables, handwritten text, figures, math, and Arabic. File up to 30 pages, up to 40MB in size. Supports PDF, Word, Excel, CSV, Image. " +
|
|
36
|
+
"'max': For large documents with full Pro capabilities plus enhanced multilingual support. File up to 1000 pages, up to 500MB in size. Supports PDF, Word, Excel, CSV, Image."),
|
|
36
37
|
});
|
|
37
38
|
const parseOutputSchema = z
|
|
38
39
|
.object({
|
|
@@ -41,9 +42,7 @@ const parseOutputSchema = z
|
|
|
41
42
|
.number()
|
|
42
43
|
.int()
|
|
43
44
|
.describe("Total number of pages in the document"),
|
|
44
|
-
model:
|
|
45
|
-
.enum(["nano", "mini", "pro", "max"])
|
|
46
|
-
.describe("Model tier used to parse the document. " +
|
|
45
|
+
model: pdfvectorModelSchema.describe("Model tier used to parse the document. " +
|
|
47
46
|
"'nano': Supports PDF, Word, Excel, CSV. " +
|
|
48
47
|
"'mini': Supports PDF, Word, Excel, CSV. " +
|
|
49
48
|
"'pro': Supports PDF, Word, Excel, CSV, Image. " +
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @pdfvector/instance-contract
|
|
2
2
|
|
|
3
|
+
## 0.0.8
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#59](https://github.com/phuctm97/pdfvector/pull/59) [`66c1b55`](https://github.com/phuctm97/pdfvector/commit/66c1b558c674a95b9884fca3bffe1fe07e5ee10f) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Update model and add disable libreoffice flag
|
|
9
|
+
|
|
3
10
|
## 0.0.7
|
|
4
11
|
### Patch Changes
|
|
5
12
|
|