@pdfvector/instance-contract 0.0.12 → 0.0.13

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.
@@ -19,4 +19,6 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
19
19
  pro: "pro";
20
20
  max: "max";
21
21
  }>;
22
+ requestId: z.ZodNumber;
23
+ documentId: z.ZodOptional<z.ZodString>;
22
24
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -47,12 +47,21 @@ const askOutputSchema = z
47
47
  "'mini': Supports PDF, Word, Excel, CSV. " +
48
48
  "'pro': Supports PDF, Word, Excel, CSV, Image. " +
49
49
  "'max': Supports PDF, Word, Excel, CSV, Image."),
50
+ requestId: z
51
+ .number()
52
+ .int()
53
+ .describe("Unique request identifier for this API call"),
54
+ documentId: z
55
+ .string()
56
+ .optional()
57
+ .describe("Document ID if provided via x-pdfvector-document-id header"),
50
58
  })
51
59
  .meta({
52
60
  examples: [
53
61
  {
54
62
  markdown: "The study found that viral shedding peaked during the first week of symptoms, with the highest viral loads detected in throat swabs.",
55
63
  model: "mini",
64
+ requestId: 1,
56
65
  },
57
66
  ],
58
67
  });
@@ -20,4 +20,6 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
20
20
  pro: "pro";
21
21
  max: "max";
22
22
  }>;
23
+ requestId: z.ZodNumber;
24
+ documentId: z.ZodOptional<z.ZodString>;
23
25
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -76,6 +76,14 @@ const extractOutputSchema = z
76
76
  "'mini': Supports PDF, Word, Excel, CSV. " +
77
77
  "'pro': Supports PDF, Word, Excel, CSV, Image. " +
78
78
  "'max': Supports PDF, Word, Excel, CSV, Image."),
79
+ requestId: z
80
+ .number()
81
+ .int()
82
+ .describe("Unique request identifier for this API call"),
83
+ documentId: z
84
+ .string()
85
+ .optional()
86
+ .describe("Document ID if provided via x-pdfvector-document-id header"),
79
87
  })
80
88
  .meta({
81
89
  examples: [
@@ -86,6 +94,7 @@ const extractOutputSchema = z
86
94
  year: 2020,
87
95
  },
88
96
  model: "mini",
97
+ requestId: 1,
89
98
  },
90
99
  ],
91
100
  });
@@ -1,5 +1,14 @@
1
1
  export function getDefaultSpec(op, requestExamples) {
2
2
  op.security = [{ bearerAuth: [] }];
3
+ const params = (op.parameters ?? []);
4
+ params.push({
5
+ name: "x-pdfvector-document-id",
6
+ in: "header",
7
+ required: false,
8
+ schema: { type: "string", default: "my-doc-123" },
9
+ description: "Optional document ID to associate with this request. Returned in the response and saved for usage tracking.",
10
+ });
11
+ op.parameters = params;
3
12
  const reqBody = op.requestBody;
4
13
  if (reqBody?.content) {
5
14
  for (const mediaType of Object.values(reqBody.content)) {
@@ -19,4 +19,6 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
19
19
  pro: "pro";
20
20
  max: "max";
21
21
  }>;
22
+ requestId: z.ZodNumber;
23
+ documentId: z.ZodOptional<z.ZodString>;
22
24
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -35,27 +35,22 @@ const parseInputSchema = z.object({
35
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
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."),
37
37
  });
38
- const parseOutputSchema = z
39
- .object({
38
+ const parseOutputSchema = z.object({
40
39
  markdown: z.string().describe("Extracted text content from the document"),
41
- pageCount: z
42
- .number()
43
- .int()
44
- .describe("Total number of pages in the document"),
40
+ pageCount: z.number().int().describe("Total number of pages in the document"),
45
41
  model: pdfvectorModelSchema.describe("Model tier used to parse the document. " +
46
42
  "'nano': Supports PDF, Word, Excel, CSV. " +
47
43
  "'mini': Supports PDF, Word, Excel, CSV. " +
48
44
  "'pro': Supports PDF, Word, Excel, CSV, Image. " +
49
45
  "'max': Supports PDF, Word, Excel, CSV, Image."),
50
- })
51
- .meta({
52
- examples: [
53
- {
54
- markdown: "Nature | Vol 581 | 28 May 2020 | 465\nArticle\nVirological assessment of hospitalized patients with COVID-2019...",
55
- pageCount: 12,
56
- model: "nano",
57
- },
58
- ],
46
+ requestId: z
47
+ .number()
48
+ .int()
49
+ .describe("Unique request identifier for this API call"),
50
+ documentId: z
51
+ .string()
52
+ .optional()
53
+ .describe("Document ID if provided via x-pdfvector-document-id header"),
59
54
  });
60
55
  const requestExamples = {
61
56
  "Parse from URL": {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @pdfvector/instance-contract
2
2
 
3
+ ## 0.0.13
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#87](https://github.com/phuctm97/pdfvector/pull/87) [`a147b7c`](https://github.com/phuctm97/pdfvector/commit/a147b7c7646aab95422e5b874acbc89695a1c985) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Dont store file in instance and update org for spa
9
+
3
10
  ## 0.0.12
4
11
  ### Patch Changes
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/instance-contract",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "main": ".tsc/lib/index.js",
6
6
  "dependencies": {