@pdfvector/instance-contract 0.0.27 → 0.0.29
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/router/academic/index.d.ts +2 -0
- package/.tsc/lib/router/academic/index.js +2 -0
- package/.tsc/lib/router/academic/paper-graph.d.ts +85 -0
- package/.tsc/lib/router/academic/paper-graph.js +140 -0
- package/.tsc/lib/router/academic/similar-papers.d.ts +70 -0
- package/.tsc/lib/router/academic/similar-papers.js +139 -0
- package/.tsc/lib/router/bankStatement/ask.js +6 -22
- package/.tsc/lib/router/bankStatement/extract.js +6 -22
- package/.tsc/lib/router/bankStatement/parse.js +5 -15
- package/.tsc/lib/router/document/ask.js +6 -22
- package/.tsc/lib/router/document/extract.js +6 -22
- package/.tsc/lib/router/document/parse.js +6 -22
- package/.tsc/lib/router/free/bank-statement-parse.js +4 -11
- package/.tsc/lib/router/identity/ask.js +6 -22
- package/.tsc/lib/router/identity/extract.js +6 -22
- package/.tsc/lib/router/identity/parse.js +5 -15
- package/.tsc/lib/router/invoice/ask.js +6 -22
- package/.tsc/lib/router/invoice/extract.js +6 -22
- package/.tsc/lib/router/invoice/parse.js +5 -15
- package/.tsc/lib/supported-mimes.d.ts +29 -0
- package/.tsc/lib/supported-mimes.js +122 -0
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All MIME types accepted for file uploads across all API endpoints.
|
|
3
|
+
* Single source of truth — imported by all contract schemas.
|
|
4
|
+
*/
|
|
5
|
+
export const supportedFileMimes = [
|
|
6
|
+
// PDF
|
|
7
|
+
"application/pdf",
|
|
8
|
+
// Office documents
|
|
9
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
10
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
11
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
12
|
+
// CSV
|
|
13
|
+
"text/csv",
|
|
14
|
+
"application/csv",
|
|
15
|
+
// Images
|
|
16
|
+
"image/png",
|
|
17
|
+
"image/jpeg",
|
|
18
|
+
"image/tiff",
|
|
19
|
+
"image/bmp",
|
|
20
|
+
"image/heif",
|
|
21
|
+
"image/heic",
|
|
22
|
+
// Plain text & structured text
|
|
23
|
+
"text/plain",
|
|
24
|
+
"text/markdown",
|
|
25
|
+
"text/tab-separated-values",
|
|
26
|
+
"text/xml",
|
|
27
|
+
"application/xml",
|
|
28
|
+
// RTF
|
|
29
|
+
"application/rtf",
|
|
30
|
+
"text/rtf",
|
|
31
|
+
// HTML
|
|
32
|
+
"text/html",
|
|
33
|
+
// OpenDocument & EPUB
|
|
34
|
+
"application/epub+zip",
|
|
35
|
+
"application/vnd.oasis.opendocument.text",
|
|
36
|
+
"application/vnd.oasis.opendocument.spreadsheet",
|
|
37
|
+
"application/vnd.oasis.opendocument.presentation",
|
|
38
|
+
// Bibliography / Academic
|
|
39
|
+
"application/x-bibtex",
|
|
40
|
+
];
|
|
41
|
+
export const supportedFileFormatsDescription = "PDF, DOCX, XLSX, PPTX, CSV, PNG, JPG, TIFF, BMP, HEIF, TXT, MD, TSV, XML, RTF, HTML, ODT, ODS, ODP, EPUB, BIB, RIS, NBIB, ENW";
|
|
42
|
+
/**
|
|
43
|
+
* Human-readable description of supported file types with extensions.
|
|
44
|
+
* Used in route-level API descriptions.
|
|
45
|
+
*/
|
|
46
|
+
export const supportedFileTypesLong = "PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), CSV, " +
|
|
47
|
+
"Image (.png, .jpg, .tiff, .bmp, .heif), " +
|
|
48
|
+
"Plain Text (.txt, .md, .tsv, .xml), RTF, HTML, " +
|
|
49
|
+
"OpenDocument (.odt, .ods, .odp), EPUB, " +
|
|
50
|
+
"and Bibliography (.bib, .ris, .nbib, .enw) files";
|
|
51
|
+
/**
|
|
52
|
+
* Per-tier file type support descriptions for model input fields.
|
|
53
|
+
* Format lists are stated once at the bottom to avoid wall-of-text in Scalar.
|
|
54
|
+
*/
|
|
55
|
+
const formatNote = "\n\n" +
|
|
56
|
+
"Supported formats by tier:\n" +
|
|
57
|
+
"- All tiers: PDF, Word, Excel, PowerPoint, CSV, Text, HTML, RTF, OpenDocument, EPUB, Bibliography.\n" +
|
|
58
|
+
"- Pro adds: Image (PNG, JPG).\n" +
|
|
59
|
+
"- Max/Auto adds: Image (PNG, JPG, TIFF, BMP, HEIF).";
|
|
60
|
+
/** Model tier descriptions for document parse endpoints. */
|
|
61
|
+
export const documentParseModelDescription = "Model tier for parsing.\n\n" +
|
|
62
|
+
"- auto (default): Intelligent fallback. Up to 1000 pages, 500MB.\n" +
|
|
63
|
+
"- nano: 1 credit/page. Simple plain text documents. Up to 30 pages, 10MB.\n" +
|
|
64
|
+
"- mini: 2 credits/page. Documents with tables and structured content. Up to 30 pages, 10MB.\n" +
|
|
65
|
+
"- pro: 4 credits/page. Tables, handwritten text, figures, math, Arabic. Up to 30 pages, 40MB.\n" +
|
|
66
|
+
"- max: 8 credits/page. Full Pro capabilities + enhanced multilingual. Up to 1000 pages, 500MB." +
|
|
67
|
+
formatNote;
|
|
68
|
+
/** Model tier descriptions for document extract endpoints. */
|
|
69
|
+
export const documentExtractModelDescription = "Model tier for extracting structured data.\n\n" +
|
|
70
|
+
"- auto (default): Automatically selects the best tier based on document complexity.\n" +
|
|
71
|
+
"- nano: 2 credits/page. Fastest. Best for simple documents with straightforward schemas.\n" +
|
|
72
|
+
"- mini: 4 credits/page. Balanced speed and accuracy. Moderately complex schemas.\n" +
|
|
73
|
+
"- pro: 8 credits/page. High accuracy for complex documents with large or nested schemas.\n" +
|
|
74
|
+
"- max: 16 credits/page. Maximum accuracy. Best for difficult extractions requiring deep reasoning." +
|
|
75
|
+
formatNote;
|
|
76
|
+
/** Model tier descriptions for document ask endpoints. */
|
|
77
|
+
export const documentAskModelDescription = "Model tier for answering the question.\n\n" +
|
|
78
|
+
"- auto (default): Automatically selects the best tier based on document complexity.\n" +
|
|
79
|
+
"- nano: 2 credits/page. Fastest. Best for simple questions about straightforward documents.\n" +
|
|
80
|
+
"- mini: 4 credits/page. Balanced speed and accuracy. Moderately complex questions.\n" +
|
|
81
|
+
"- pro: 8 credits/page. High accuracy for nuanced questions about complex documents.\n" +
|
|
82
|
+
"- max: 16 credits/page. Maximum accuracy. Best for difficult questions requiring deep reasoning." +
|
|
83
|
+
formatNote;
|
|
84
|
+
/** Model tier descriptions for invoice/identity/bankStatement parse endpoints (pro/max/auto only). */
|
|
85
|
+
export const specializedParseModelDescription = (type) => "Model tier for parsing.\n\n" +
|
|
86
|
+
"- auto (default): Intelligent fallback.\n" +
|
|
87
|
+
`- pro: 6 credits/page. Extracts structured ${type} fields with standard accuracy.\n` +
|
|
88
|
+
`- max: 10 credits/page. Extracts structured ${type} fields with highest accuracy and fallback.`;
|
|
89
|
+
/** Model tier descriptions for invoice/identity/bankStatement extract endpoints. */
|
|
90
|
+
export const specializedExtractModelDescription = "Model tier for extracting structured data.\n\n" +
|
|
91
|
+
"- auto (default): Automatically selects the best tier based on document complexity.\n" +
|
|
92
|
+
"- nano: 6 credits/page. Fastest. Best for simple documents with straightforward schemas.\n" +
|
|
93
|
+
"- mini: 10 credits/page. Balanced speed and accuracy. Moderately complex schemas.\n" +
|
|
94
|
+
"- pro: 14 credits/page. High accuracy for complex documents with large or nested schemas.\n" +
|
|
95
|
+
"- max: 18 credits/page. Maximum accuracy. Best for difficult extractions requiring deep reasoning." +
|
|
96
|
+
formatNote;
|
|
97
|
+
/** Model tier descriptions for invoice/identity/bankStatement ask endpoints. */
|
|
98
|
+
export const specializedAskModelDescription = "Model tier for answering the question.\n\n" +
|
|
99
|
+
"- auto (default): Automatically selects the best tier based on document complexity.\n" +
|
|
100
|
+
"- nano: 6 credits/page. Fastest. Best for simple questions about straightforward documents.\n" +
|
|
101
|
+
"- mini: 10 credits/page. Balanced speed and accuracy. Moderately complex questions.\n" +
|
|
102
|
+
"- pro: 14 credits/page. High accuracy for nuanced questions about complex documents.\n" +
|
|
103
|
+
"- max: 18 credits/page. Maximum accuracy. Best for difficult questions requiring deep reasoning." +
|
|
104
|
+
formatNote;
|
|
105
|
+
/** Output model description for parse results. */
|
|
106
|
+
export const outputModelDescription = "Model tier used to parse the document.\n\n" +
|
|
107
|
+
"- nano: Fastest, best for simple documents.\n" +
|
|
108
|
+
"- mini: Balanced speed and accuracy.\n" +
|
|
109
|
+
"- pro: High accuracy for complex documents.\n" +
|
|
110
|
+
"- max: Maximum accuracy with deep reasoning.";
|
|
111
|
+
/** Output model description for extract results. */
|
|
112
|
+
export const outputExtractModelDescription = "Model tier used to extract the data.\n\n" +
|
|
113
|
+
"- nano: Fastest, best for simple documents.\n" +
|
|
114
|
+
"- mini: Balanced speed and accuracy.\n" +
|
|
115
|
+
"- pro: High accuracy for complex documents.\n" +
|
|
116
|
+
"- max: Maximum accuracy with deep reasoning.";
|
|
117
|
+
/** Output model description for ask results. */
|
|
118
|
+
export const outputAskModelDescription = "Model tier used to answer the question.\n\n" +
|
|
119
|
+
"- nano: Fastest, best for simple questions.\n" +
|
|
120
|
+
"- mini: Balanced speed and accuracy.\n" +
|
|
121
|
+
"- pro: High accuracy for complex questions.\n" +
|
|
122
|
+
"- max: Maximum accuracy with deep reasoning.";
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pdfvector/instance-contract
|
|
2
2
|
|
|
3
|
+
## 0.0.29
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#149](https://github.com/phuctm97/pdfvector/pull/149) [`bcffa28`](https://github.com/phuctm97/pdfvector/commit/bcffa2840c98af3e8ab0c971e61d580beedd3b85) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add academic paper graph and similar papers APIs with integration tests
|
|
9
|
+
|
|
10
|
+
## 0.0.28
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
- [#148](https://github.com/phuctm97/pdfvector/pull/148) [`9a8d292`](https://github.com/phuctm97/pdfvector/commit/9a8d2920d022837dd09eb297949c2a40acd04b68) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add support for academic and additional file types
|
|
16
|
+
|
|
3
17
|
## 0.0.27
|
|
4
18
|
### Patch Changes
|
|
5
19
|
|