@ai-sdk/anthropic 4.0.46 → 4.0.47
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 +9 -0
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +9 -4
- package/dist/internal/index.js.map +1 -1
- package/package.json +3 -3
- package/src/anthropic-files.ts +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 4.0.47
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5190b67: feat(provider): extend the FilesV4 interface with optional `getFileMetadata`, `downloadFile` (streaming), and `deleteFile` operations, plus `abortSignal`/`headers` call options and a `{ type: 'stream' }` upload data variant; upload results now expose `byteSize`, `createdAt`, and `expiresAt` (also surfaced by the core `uploadFile()` helper, which now forwards `abortSignal`/`headers`); add `postMultipartStreamToApi` (streaming multipart uploads with deterministic part ordering and failure-path stream teardown), `deleteFromApi`, and `createBinaryStreamResponseHandler` to provider-utils
|
|
8
|
+
- Updated dependencies [5190b67]
|
|
9
|
+
- @ai-sdk/provider@4.0.10
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.35
|
|
11
|
+
|
|
3
12
|
## 4.0.46
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,9 @@ var AnthropicFiles = class {
|
|
|
71
71
|
async uploadFile({
|
|
72
72
|
data,
|
|
73
73
|
mediaType,
|
|
74
|
-
filename
|
|
74
|
+
filename,
|
|
75
|
+
abortSignal,
|
|
76
|
+
headers
|
|
75
77
|
}) {
|
|
76
78
|
var _a, _b;
|
|
77
79
|
const fileBytes = convertInlineFileDataToUint8Array(data);
|
|
@@ -84,14 +86,17 @@ var AnthropicFiles = class {
|
|
|
84
86
|
}
|
|
85
87
|
const { value: response } = await postFormDataToApi({
|
|
86
88
|
url: `${this.config.baseURL}/files`,
|
|
87
|
-
headers: combineHeaders(
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
headers: combineHeaders(
|
|
90
|
+
this.config.headers(),
|
|
91
|
+
{ "anthropic-beta": "files-api-2025-04-14" },
|
|
92
|
+
headers
|
|
93
|
+
),
|
|
90
94
|
formData,
|
|
91
95
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
92
96
|
successfulResponseHandler: createJsonResponseHandler(
|
|
93
97
|
anthropicUploadFileResponseSchema
|
|
94
98
|
),
|
|
99
|
+
abortSignal,
|
|
95
100
|
fetch: this.config.fetch
|
|
96
101
|
});
|
|
97
102
|
return {
|
|
@@ -7479,7 +7484,7 @@ var AnthropicSkills = class {
|
|
|
7479
7484
|
};
|
|
7480
7485
|
|
|
7481
7486
|
// src/version.ts
|
|
7482
|
-
var VERSION = true ? "4.0.
|
|
7487
|
+
var VERSION = true ? "4.0.47" : "0.0.0-test";
|
|
7483
7488
|
|
|
7484
7489
|
// src/anthropic-provider.ts
|
|
7485
7490
|
var ANTHROPIC_API_URL = "https://api.anthropic.com";
|