@pdfvector/client 0.1.3 → 0.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @pdfvector/client
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#725](https://github.com/orchestero/pdfvector/pull/725) [`4e9bd5f`](https://github.com/orchestero/pdfvector/commit/4e9bd5f264452ee6f733ebf1966e86b1ea94b254) Thanks [@orchestero](https://github.com/orchestero)! - Package metadata: repository moved to orchestero/pdfvector
8
+ - Updated dependencies [[`4e9bd5f`](https://github.com/orchestero/pdfvector/commit/4e9bd5f264452ee6f733ebf1966e86b1ea94b254)]:
9
+ - @pdfvector/instance-client@0.2.1
10
+
11
+ ## 0.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#691](https://github.com/phuctm97/pdfvector/pull/691) [`69e9221`](https://github.com/phuctm97/pdfvector/commit/69e9221bd12b0d941b8809652d4a564ffca1bb8c) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Errors that need a different model now name it: the API returns `data.suggestedModel`, the SDK exposes `error.suggestedModel`, and Make shows it in the error message.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`69e9221`](https://github.com/phuctm97/pdfvector/commit/69e9221bd12b0d941b8809652d4a564ffca1bb8c)]:
20
+ - @pdfvector/instance-client@0.2.0
21
+
3
22
  ## 0.1.3
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -635,7 +635,7 @@ console.log(resultB.documentId); // "doc-b"
635
635
 
636
636
  All API errors are thrown as `PDFVectorError` instances. The SDK maps server errors into specific subclasses and adds user/agent-friendly fields such as `title`, `suggestion`, `userError`, retry flags, and `requestId`.
637
637
 
638
- For `INTERNAL_SERVER_ERROR`, the API returns a safe message and keeps the original provider failure in server diagnostics. Use `requestId` when contacting support. For document processing failures, check `reasonCode` and `retryableWithHigherModel` instead of parsing the message; `EXTRACTION_FAILED` identifies unusable structured output even if message wording changes. `DOCUMENT_PROCESSING_FAILED` identifies a processing rejection that was not confirmed to be a caller-input error, so the SDK suggests retrying or contacting support rather than changing the document. Error responses do not include raw AI output.
638
+ For `INTERNAL_SERVER_ERROR`, the API returns a safe message and keeps the original provider failure in server diagnostics. Use `requestId` when contacting support. For document processing failures, check `reasonCode`, `retryableWithHigherModel` and `suggestedModel` instead of parsing the message; `EXTRACTION_FAILED` identifies unusable structured output even if message wording changes. `DOCUMENT_PROCESSING_FAILED` identifies a processing rejection that was not confirmed to be a caller-input error, so the SDK suggests retrying or contacting support rather than changing the document. Error responses do not include raw AI output.
639
639
 
640
640
  Reason codes (`reasonCode`, from the response's `data.code`) for document input:
641
641
 
@@ -697,6 +697,11 @@ try {
697
697
  if (isPDFVectorError(error) && error.retryableWithHigherModel) {
698
698
  console.error("Retry with a stronger model or a smaller document.");
699
699
  }
700
+
701
+ // e.g. "mini" for a scanned PDF sent to nano, "auto" for a document over the 30-page limit
702
+ if (isPDFVectorError(error) && error.suggestedModel) {
703
+ console.error(`Retry with model ${error.suggestedModel}.`);
704
+ }
700
705
  }
701
706
  ```
702
707
 
@@ -834,6 +839,7 @@ PDFVectorError
834
839
  | `userError` | `boolean` | `true` for expected caller-fixable failures |
835
840
  | `retryable` | `boolean` | `true` when retrying may help |
836
841
  | `retryableWithHigherModel` | `boolean` | `true` when retrying with a stronger model or smaller document may help |
842
+ | `suggestedModel` | `string \| undefined` | Model to retry with when the server names one (`data.suggestedModel`): the next tier after a model that could not read the document, `auto` for files over the tier's page or size limit that fit auto's (no suggestion when nothing fits), the lowest tier that supports the file type. It does not change `retryable` or `retryableWithHigherModel` |
837
843
  | `requestId` | `number \| undefined` | Server-assigned request ID; include in support tickets |
838
844
  | `documentId` | `string \| undefined` | Echoed back if you passed `context.documentId` |
839
845
  | `reasonCode` | `string \| undefined` | More specific server reason when available, such as `NO_PUBLIC_PDF` |