@pdfvector/instance-contract 0.0.58 → 0.0.60

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.
@@ -11,6 +11,7 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>;
14
+ documentId: z.ZodOptional<z.ZodString>;
14
15
  callback: z.ZodOptional<z.ZodObject<{
15
16
  url: z.ZodURL;
16
17
  type: z.ZodOptional<z.ZodString>;
@@ -26,6 +26,13 @@ const askInputSchema = z.object({
26
26
  .min(4, "question must be at least 4 characters")
27
27
  .describe("The question to answer about the bank statement"),
28
28
  model: specializedModelSchema.describe(specializedAskModelDescription),
29
+ documentId: z
30
+ .string()
31
+ .trim()
32
+ .min(1)
33
+ .max(512)
34
+ .optional()
35
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
29
36
  callback: z
30
37
  .object({
31
38
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -55,7 +62,7 @@ const askOutputSchema = z.object({
55
62
  documentId: z
56
63
  .string()
57
64
  .optional()
58
- .describe("Document ID if provided via x-pdfvector-document-id header"),
65
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
59
66
  });
60
67
  const requestExamples = {
61
68
  "Ask from URL": {
@@ -12,6 +12,7 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>;
15
+ documentId: z.ZodOptional<z.ZodString>;
15
16
  callback: z.ZodOptional<z.ZodObject<{
16
17
  url: z.ZodURL;
17
18
  type: z.ZodOptional<z.ZodString>;
@@ -28,6 +28,13 @@ const extractInputSchema = z.object({
28
28
  .describe("The prompt instructing the AI how to extract data from the bank statement"),
29
29
  schema: jsonSchemaInput.describe("JSON Schema describing the structure of the data to extract from the bank statement. Can be a JSON object or a JSON string."),
30
30
  model: specializedModelSchema.describe(specializedExtractModelDescription),
31
+ documentId: z
32
+ .string()
33
+ .trim()
34
+ .min(1)
35
+ .max(512)
36
+ .optional()
37
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
31
38
  callback: z
32
39
  .object({
33
40
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -61,7 +68,7 @@ const extractOutputSchema = z.object({
61
68
  documentId: z
62
69
  .string()
63
70
  .optional()
64
- .describe("Document ID if provided via x-pdfvector-document-id header"),
71
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
65
72
  });
66
73
  const requestExamples = {
67
74
  "Extract from URL": {
@@ -8,6 +8,7 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
8
8
  max: "max";
9
9
  auto: "auto";
10
10
  }>>;
11
+ documentId: z.ZodOptional<z.ZodString>;
11
12
  callback: z.ZodOptional<z.ZodObject<{
12
13
  url: z.ZodURL;
13
14
  type: z.ZodOptional<z.ZodString>;
@@ -23,6 +23,13 @@ const parseInputSchema = z.object({
23
23
  .optional()
24
24
  .describe("Base64-encoded bank statement file content"),
25
25
  model: specializedParseModelSchema.describe(specializedParseModelDescription("bank statement")),
26
+ documentId: z
27
+ .string()
28
+ .trim()
29
+ .min(1)
30
+ .max(512)
31
+ .optional()
32
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
26
33
  callback: z
27
34
  .object({
28
35
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -61,7 +68,7 @@ const parseOutputSchema = z.object({
61
68
  documentId: z
62
69
  .string()
63
70
  .optional()
64
- .describe("Document ID if provided via x-pdfvector-document-id header"),
71
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
65
72
  });
66
73
  const requestExamples = {
67
74
  "Parse from URL": {
@@ -11,6 +11,7 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>>;
14
+ documentId: z.ZodOptional<z.ZodString>;
14
15
  callback: z.ZodOptional<z.ZodObject<{
15
16
  url: z.ZodURL;
16
17
  type: z.ZodOptional<z.ZodString>;
@@ -27,6 +27,13 @@ const askInputSchema = z.object({
27
27
  .optional()
28
28
  .default("auto")
29
29
  .describe(documentAskModelDescription),
30
+ documentId: z
31
+ .string()
32
+ .trim()
33
+ .min(1)
34
+ .max(512)
35
+ .optional()
36
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
30
37
  callback: z
31
38
  .object({
32
39
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -60,7 +67,7 @@ const askOutputSchema = z
60
67
  documentId: z
61
68
  .string()
62
69
  .optional()
63
- .describe("Document ID if provided via x-pdfvector-document-id header"),
70
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
64
71
  })
65
72
  .meta({
66
73
  examples: [
@@ -12,6 +12,7 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>>;
15
+ documentId: z.ZodOptional<z.ZodString>;
15
16
  callback: z.ZodOptional<z.ZodObject<{
16
17
  url: z.ZodURL;
17
18
  type: z.ZodOptional<z.ZodString>;
@@ -29,6 +29,13 @@ const extractInputSchema = z.object({
29
29
  .optional()
30
30
  .default("auto")
31
31
  .describe(documentExtractModelDescription),
32
+ documentId: z
33
+ .string()
34
+ .trim()
35
+ .min(1)
36
+ .max(512)
37
+ .optional()
38
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
32
39
  callback: z
33
40
  .object({
34
41
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -66,7 +73,7 @@ const extractOutputSchema = z
66
73
  documentId: z
67
74
  .string()
68
75
  .optional()
69
- .describe("Document ID if provided via x-pdfvector-document-id header"),
76
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
70
77
  })
71
78
  .meta({
72
79
  examples: [
@@ -14,6 +14,7 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
14
14
  true: "true";
15
15
  false: "false";
16
16
  }>, z.ZodTransform<boolean, "true" | "false">>]>>>;
17
+ documentId: z.ZodOptional<z.ZodString>;
17
18
  callback: z.ZodOptional<z.ZodObject<{
18
19
  url: z.ZodURL;
19
20
  type: z.ZodOptional<z.ZodString>;
@@ -32,6 +32,13 @@ const parseInputSchema = z.object({
32
32
  .optional()
33
33
  .default(false)
34
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."),
35
+ documentId: z
36
+ .string()
37
+ .trim()
38
+ .min(1)
39
+ .max(512)
40
+ .optional()
41
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
35
42
  callback: z
36
43
  .object({
37
44
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -66,7 +73,7 @@ const parseOutputSchema = z.object({
66
73
  documentId: z
67
74
  .string()
68
75
  .optional()
69
- .describe("Document ID if provided via x-pdfvector-document-id header"),
76
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
70
77
  pages: z
71
78
  .array(pageMarkdownSchema)
72
79
  .optional()
@@ -11,6 +11,7 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>;
14
+ documentId: z.ZodOptional<z.ZodString>;
14
15
  callback: z.ZodOptional<z.ZodObject<{
15
16
  url: z.ZodURL;
16
17
  type: z.ZodOptional<z.ZodString>;
@@ -26,6 +26,13 @@ const askInputSchema = z.object({
26
26
  .min(4, "question must be at least 4 characters")
27
27
  .describe("The question to answer about the identity document"),
28
28
  model: specializedModelSchema.describe(specializedAskModelDescription),
29
+ documentId: z
30
+ .string()
31
+ .trim()
32
+ .min(1)
33
+ .max(512)
34
+ .optional()
35
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
29
36
  callback: z
30
37
  .object({
31
38
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -55,7 +62,7 @@ const askOutputSchema = z.object({
55
62
  documentId: z
56
63
  .string()
57
64
  .optional()
58
- .describe("Document ID if provided via x-pdfvector-document-id header"),
65
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
59
66
  });
60
67
  const requestExamples = {
61
68
  "Ask from URL": {
@@ -12,6 +12,7 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>;
15
+ documentId: z.ZodOptional<z.ZodString>;
15
16
  callback: z.ZodOptional<z.ZodObject<{
16
17
  url: z.ZodURL;
17
18
  type: z.ZodOptional<z.ZodString>;
@@ -28,6 +28,13 @@ const extractInputSchema = z.object({
28
28
  .describe("The prompt instructing the AI how to extract data from the identity document"),
29
29
  schema: jsonSchemaInput.describe("JSON Schema describing the structure of the data to extract from the identity document. Can be a JSON object or a JSON string."),
30
30
  model: specializedModelSchema.describe(specializedExtractModelDescription),
31
+ documentId: z
32
+ .string()
33
+ .trim()
34
+ .min(1)
35
+ .max(512)
36
+ .optional()
37
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
31
38
  callback: z
32
39
  .object({
33
40
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -61,7 +68,7 @@ const extractOutputSchema = z.object({
61
68
  documentId: z
62
69
  .string()
63
70
  .optional()
64
- .describe("Document ID if provided via x-pdfvector-document-id header"),
71
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
65
72
  });
66
73
  const requestExamples = {
67
74
  "Extract from URL": {
@@ -8,6 +8,7 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
8
8
  max: "max";
9
9
  auto: "auto";
10
10
  }>>;
11
+ documentId: z.ZodOptional<z.ZodString>;
11
12
  callback: z.ZodOptional<z.ZodObject<{
12
13
  url: z.ZodURL;
13
14
  type: z.ZodOptional<z.ZodString>;
@@ -23,6 +23,13 @@ const parseInputSchema = z.object({
23
23
  .optional()
24
24
  .describe("Base64-encoded identity document file content"),
25
25
  model: specializedParseModelSchema.describe(specializedParseModelDescription("identity document")),
26
+ documentId: z
27
+ .string()
28
+ .trim()
29
+ .min(1)
30
+ .max(512)
31
+ .optional()
32
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
26
33
  callback: z
27
34
  .object({
28
35
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -65,7 +72,7 @@ const parseOutputSchema = z.object({
65
72
  documentId: z
66
73
  .string()
67
74
  .optional()
68
- .describe("Document ID if provided via x-pdfvector-document-id header"),
75
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
69
76
  });
70
77
  const requestExamples = {
71
78
  "Parse from URL": {
@@ -11,6 +11,7 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>;
14
+ documentId: z.ZodOptional<z.ZodString>;
14
15
  callback: z.ZodOptional<z.ZodObject<{
15
16
  url: z.ZodURL;
16
17
  type: z.ZodOptional<z.ZodString>;
@@ -23,6 +23,13 @@ const askInputSchema = z.object({
23
23
  .min(4, "question must be at least 4 characters")
24
24
  .describe("The question to answer about the invoice"),
25
25
  model: specializedModelSchema.describe(specializedAskModelDescription),
26
+ documentId: z
27
+ .string()
28
+ .trim()
29
+ .min(1)
30
+ .max(512)
31
+ .optional()
32
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
26
33
  callback: z
27
34
  .object({
28
35
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -52,7 +59,7 @@ const askOutputSchema = z.object({
52
59
  documentId: z
53
60
  .string()
54
61
  .optional()
55
- .describe("Document ID if provided via x-pdfvector-document-id header"),
62
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
56
63
  });
57
64
  const requestExamples = {
58
65
  "Ask from URL": {
@@ -12,6 +12,7 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>;
15
+ documentId: z.ZodOptional<z.ZodString>;
15
16
  callback: z.ZodOptional<z.ZodObject<{
16
17
  url: z.ZodURL;
17
18
  type: z.ZodOptional<z.ZodString>;
@@ -25,6 +25,13 @@ const extractInputSchema = z.object({
25
25
  .describe("The prompt instructing the AI how to extract data from the invoice"),
26
26
  schema: jsonSchemaInput.describe("JSON Schema describing the structure of the data to extract from the invoice. Can be a JSON object or a JSON string."),
27
27
  model: specializedModelSchema.describe(specializedExtractModelDescription),
28
+ documentId: z
29
+ .string()
30
+ .trim()
31
+ .min(1)
32
+ .max(512)
33
+ .optional()
34
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
28
35
  callback: z
29
36
  .object({
30
37
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -58,7 +65,7 @@ const extractOutputSchema = z.object({
58
65
  documentId: z
59
66
  .string()
60
67
  .optional()
61
- .describe("Document ID if provided via x-pdfvector-document-id header"),
68
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
62
69
  });
63
70
  const requestExamples = {
64
71
  "Extract from URL": {
@@ -8,6 +8,7 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
8
8
  max: "max";
9
9
  auto: "auto";
10
10
  }>>;
11
+ documentId: z.ZodOptional<z.ZodString>;
11
12
  callback: z.ZodOptional<z.ZodObject<{
12
13
  url: z.ZodURL;
13
14
  type: z.ZodOptional<z.ZodString>;
@@ -20,6 +20,13 @@ const parseInputSchema = z.object({
20
20
  .describe(`Invoice file upload via multipart form-data (${supportedFileFormatsDescription})`),
21
21
  base64: z.string().optional().describe("Base64-encoded invoice file content"),
22
22
  model: specializedParseModelSchema.describe(specializedParseModelDescription("invoice")),
23
+ documentId: z
24
+ .string()
25
+ .trim()
26
+ .min(1)
27
+ .max(512)
28
+ .optional()
29
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
23
30
  callback: z
24
31
  .object({
25
32
  url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
@@ -56,7 +63,7 @@ const parseOutputSchema = z.object({
56
63
  documentId: z
57
64
  .string()
58
65
  .optional()
59
- .describe("Document ID if provided via x-pdfvector-document-id header"),
66
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
60
67
  });
61
68
  const requestExamples = {
62
69
  "Parse from URL": {
@@ -61,8 +61,9 @@ function tierDesc(tier, credits, unit, extra) {
61
61
  : "";
62
62
  return `- ${tier}: ${credits} ${unit}. ${extra}${limitStr ? ` ${limitStr}` : ""}`;
63
63
  }
64
- // biome-ignore lint/style/noNonNullAssertion: auto tier always exists
65
64
  const autoLimit = tierLimits.auto;
65
+ if (!autoLimit)
66
+ throw new Error("Missing auto tier limits");
66
67
  const autoLimitStr = `Up to ${autoLimit.maxPages} pages, ${fmtSize(autoLimit.maxFileSize)}.`;
67
68
  /** Model tier descriptions for document parse endpoints. */
68
69
  export const documentParseModelDescription = "Model tier for parsing.\n\n" +
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @pdfvector/instance-contract
2
2
 
3
+ ## 0.0.60
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#286](https://github.com/phuctm97/pdfvector/pull/286) [`1295973`](https://github.com/phuctm97/pdfvector/commit/12959733e27a056c78241404ef1f842f47487d21) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Upgrade dependencies and keep the AI model integration compatible with the latest provider APIs.
9
+
10
+ ## 0.0.59
11
+ ### Patch Changes
12
+
13
+
14
+
15
+ - [#283](https://github.com/phuctm97/pdfvector/pull/283) [`607e8dd`](https://github.com/phuctm97/pdfvector/commit/607e8dd40a9808f7ddfdd09894b959b3fa352c5a) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add request-body document IDs for usage attribution and provider cost breakdown views.
16
+
3
17
  ## 0.0.58
4
18
  ### Patch Changes
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/instance-contract",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "type": "module",
5
5
  "description": "API contract definitions for PDF Vector instance server",
6
6
  "license": "MIT",