@ai-sdk/provider-utils 5.0.74 → 5.0.76
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 +28 -0
- package/dist/experimental-decision/index.js.map +1 -1
- package/dist/experimental-evaluation/index.js.map +1 -1
- package/dist/index.d.ts +68 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +376 -30
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/detect-media-type.ts +7 -4
- package/src/fetch-with-validated-redirects.ts +13 -0
- package/src/index.ts +4 -0
- package/src/json-binary-field-scanner.ts +457 -0
- package/src/read-response-with-size-limit.ts +11 -1
- package/src/resolve-provider-options.ts +68 -0
- package/src/response-handler.ts +57 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.76
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6400cf8: Add `resolveProviderOptions` to parse provider options that a model accepts under several `providerOptions` keys, either as aliases (`first`) or merged in order (`merge`), and use it for the existing multi-key lookups in the OpenAI, OpenAI-compatible, Anthropic, Google, and Amazon Bedrock models. Resolution behavior for these models is unchanged.
|
|
8
|
+
- f608c05: Reject HTTPS-to-HTTP redirects in validated downloads before requesting the insecure target, including when it matches a configured trusted origin.
|
|
9
|
+
- cab9c1f: Return undefined instead of throwing when detectMediaType receives an unsupported topLevelType that matches an inherited object property.
|
|
10
|
+
- Updated dependencies [c70adf6]
|
|
11
|
+
- @ai-sdk/provider@4.0.37
|
|
12
|
+
|
|
13
|
+
## 5.0.75
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 89aff56: feat(provider-utils): add an `experimental_binaryFields` option to `createJsonResponseHandler`
|
|
18
|
+
|
|
19
|
+
Providers whose JSON responses carry large base64 strings (images, files) can list their paths, e.g. `createJsonResponseHandler(schema, { experimental_binaryFields: ['images[*]'] })`. The body is then read as a stream and canonical base64 strings of 64 KiB and more are decoded to `Uint8Array` while they arrive, instead of holding about four copies of the body in memory (chunks, concatenated bytes, text, parsed string). `rawValue`, validation errors and `APICallError.responseBody` contain a short placeholder string instead of the data. Handlers without the option are unchanged. `readResponseWithSizeLimit` accepts an optional `onChunk` callback that receives each chunk instead of the chunks being collected.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [36802d4]
|
|
22
|
+
- Updated dependencies [e0143b0]
|
|
23
|
+
- Updated dependencies [934100c]
|
|
24
|
+
- Updated dependencies [892af4d]
|
|
25
|
+
- Updated dependencies [41465fd]
|
|
26
|
+
- Updated dependencies [9754014]
|
|
27
|
+
- Updated dependencies [4bb73b0]
|
|
28
|
+
- Updated dependencies [2e44144]
|
|
29
|
+
- @ai-sdk/provider@4.0.36
|
|
30
|
+
|
|
3
31
|
## 5.0.74
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|