@ai-sdk/provider 2.0.1 → 2.0.2
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 +16 -10
- package/dist/index.js +3 -3
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# @ai-sdk/provider
|
|
2
2
|
|
|
3
|
+
## 2.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0a00b9b: trigger release for all packages after provenance setup
|
|
8
|
+
|
|
3
9
|
## 2.0.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
6
12
|
|
|
7
|
-
-
|
|
13
|
+
- 526fe8d: fix: trigger new release for `@ai-v5` dist-tag
|
|
8
14
|
|
|
9
15
|
## 2.0.0
|
|
10
16
|
|
|
@@ -73,13 +79,13 @@
|
|
|
73
79
|
Before
|
|
74
80
|
|
|
75
81
|
```ts
|
|
76
|
-
import { convertUint8ArrayToBase64 } from
|
|
82
|
+
import { convertUint8ArrayToBase64 } from "@ai-sdk/provider-utils";
|
|
77
83
|
|
|
78
84
|
// Had to manually convert binary data to base64
|
|
79
85
|
const fileData = new Uint8Array([0, 1, 2, 3]);
|
|
80
86
|
const filePart = {
|
|
81
|
-
type:
|
|
82
|
-
mediaType:
|
|
87
|
+
type: "file",
|
|
88
|
+
mediaType: "application/pdf",
|
|
83
89
|
data: convertUint8ArrayToBase64(fileData), // Required conversion
|
|
84
90
|
};
|
|
85
91
|
```
|
|
@@ -90,8 +96,8 @@
|
|
|
90
96
|
// Can use binary data directly
|
|
91
97
|
const fileData = new Uint8Array([0, 1, 2, 3]);
|
|
92
98
|
const filePart = {
|
|
93
|
-
type:
|
|
94
|
-
mediaType:
|
|
99
|
+
type: "file",
|
|
100
|
+
mediaType: "application/pdf",
|
|
95
101
|
data: fileData, // Direct Uint8Array support
|
|
96
102
|
};
|
|
97
103
|
```
|
|
@@ -107,10 +113,10 @@
|
|
|
107
113
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
108
114
|
|
|
109
115
|
```js
|
|
110
|
-
const prompt =
|
|
116
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
111
117
|
|
|
112
118
|
const { providerMetadata } = await experimental_generateImage({
|
|
113
|
-
model: openai.image(
|
|
119
|
+
model: openai.image("dall-e-3"),
|
|
114
120
|
prompt,
|
|
115
121
|
});
|
|
116
122
|
|
|
@@ -269,10 +275,10 @@
|
|
|
269
275
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
270
276
|
|
|
271
277
|
```js
|
|
272
|
-
const prompt =
|
|
278
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
273
279
|
|
|
274
280
|
const { providerMetadata } = await experimental_generateImage({
|
|
275
|
-
model: openai.image(
|
|
281
|
+
model: openai.image("dall-e-3"),
|
|
276
282
|
prompt,
|
|
277
283
|
});
|
|
278
284
|
|
package/dist/index.js
CHANGED
|
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
AISDKError: () => AISDKError,
|
|
24
24
|
APICallError: () => APICallError,
|
|
25
25
|
EmptyResponseBodyError: () => EmptyResponseBodyError,
|
|
@@ -39,7 +39,7 @@ __export(src_exports, {
|
|
|
39
39
|
isJSONObject: () => isJSONObject,
|
|
40
40
|
isJSONValue: () => isJSONValue
|
|
41
41
|
});
|
|
42
|
-
module.exports = __toCommonJS(
|
|
42
|
+
module.exports = __toCommonJS(index_exports);
|
|
43
43
|
|
|
44
44
|
// src/errors/ai-sdk-error.ts
|
|
45
45
|
var marker = "vercel.ai.error";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/provider",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"homepage": "https://ai-sdk.dev/docs",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "
|
|
40
|
+
"url": "https://github.com/vercel/ai",
|
|
41
|
+
"directory": "packages/provider"
|
|
41
42
|
},
|
|
42
43
|
"bugs": {
|
|
43
44
|
"url": "https://github.com/vercel/ai/issues"
|
|
@@ -49,8 +50,6 @@
|
|
|
49
50
|
"build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
|
|
50
51
|
"build:watch": "pnpm clean && tsup --watch",
|
|
51
52
|
"clean": "del-cli dist *.tsbuildinfo",
|
|
52
|
-
"
|
|
53
|
-
"type-check": "tsc --build",
|
|
54
|
-
"prettier-check": "prettier --check \"./**/*.ts*\""
|
|
53
|
+
"type-check": "tsc --build"
|
|
55
54
|
}
|
|
56
55
|
}
|