@ai-sdk/openai 4.0.0-canary.48 → 4.0.0-canary.49
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,13 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-canary.49
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7bbc194: feat(provider/openai): forward imageDetail providerOptions on tool-result image content
|
|
8
|
+
- Updated dependencies [2427d88]
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.0-canary.33
|
|
10
|
+
|
|
3
11
|
## 4.0.0-canary.48
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3467,12 +3467,13 @@ async function convertToOpenAIResponsesInput({
|
|
|
3467
3467
|
break;
|
|
3468
3468
|
case "content":
|
|
3469
3469
|
outputValue = output.value.map((item) => {
|
|
3470
|
-
var _a2;
|
|
3470
|
+
var _a2, _b2, _c2;
|
|
3471
3471
|
switch (item.type) {
|
|
3472
3472
|
case "text":
|
|
3473
3473
|
return { type: "input_text", text: item.text };
|
|
3474
3474
|
case "file": {
|
|
3475
3475
|
const topLevel = getTopLevelMediaType2(item.mediaType);
|
|
3476
|
+
const imageDetail = (_b2 = (_a2 = item.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail;
|
|
3476
3477
|
if (item.data.type === "data") {
|
|
3477
3478
|
const fullMediaType = resolveFullMediaType2({
|
|
3478
3479
|
part: item
|
|
@@ -3480,12 +3481,13 @@ async function convertToOpenAIResponsesInput({
|
|
|
3480
3481
|
if (topLevel === "image") {
|
|
3481
3482
|
return {
|
|
3482
3483
|
type: "input_image",
|
|
3483
|
-
image_url: `data:${fullMediaType};base64,${convertToBase642(item.data.data)}
|
|
3484
|
+
image_url: `data:${fullMediaType};base64,${convertToBase642(item.data.data)}`,
|
|
3485
|
+
detail: imageDetail
|
|
3484
3486
|
};
|
|
3485
3487
|
}
|
|
3486
3488
|
return {
|
|
3487
3489
|
type: "input_file",
|
|
3488
|
-
filename: (
|
|
3490
|
+
filename: (_c2 = item.filename) != null ? _c2 : "data",
|
|
3489
3491
|
file_data: `data:${fullMediaType};base64,${convertToBase642(item.data.data)}`
|
|
3490
3492
|
};
|
|
3491
3493
|
}
|
|
@@ -3493,7 +3495,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
3493
3495
|
if (topLevel === "image") {
|
|
3494
3496
|
return {
|
|
3495
3497
|
type: "input_image",
|
|
3496
|
-
image_url: item.data.url.toString()
|
|
3498
|
+
image_url: item.data.url.toString(),
|
|
3499
|
+
detail: imageDetail
|
|
3497
3500
|
};
|
|
3498
3501
|
}
|
|
3499
3502
|
return {
|
|
@@ -3541,13 +3544,14 @@ async function convertToOpenAIResponsesInput({
|
|
|
3541
3544
|
break;
|
|
3542
3545
|
case "content":
|
|
3543
3546
|
contentValue = output.value.map((item) => {
|
|
3544
|
-
var _a2;
|
|
3547
|
+
var _a2, _b2, _c2;
|
|
3545
3548
|
switch (item.type) {
|
|
3546
3549
|
case "text": {
|
|
3547
3550
|
return { type: "input_text", text: item.text };
|
|
3548
3551
|
}
|
|
3549
3552
|
case "file": {
|
|
3550
3553
|
const topLevel = getTopLevelMediaType2(item.mediaType);
|
|
3554
|
+
const imageDetail = (_b2 = (_a2 = item.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail;
|
|
3551
3555
|
if (item.data.type === "data") {
|
|
3552
3556
|
const fullMediaType = resolveFullMediaType2({
|
|
3553
3557
|
part: item
|
|
@@ -3555,12 +3559,13 @@ async function convertToOpenAIResponsesInput({
|
|
|
3555
3559
|
if (topLevel === "image") {
|
|
3556
3560
|
return {
|
|
3557
3561
|
type: "input_image",
|
|
3558
|
-
image_url: `data:${fullMediaType};base64,${convertToBase642(item.data.data)}
|
|
3562
|
+
image_url: `data:${fullMediaType};base64,${convertToBase642(item.data.data)}`,
|
|
3563
|
+
detail: imageDetail
|
|
3559
3564
|
};
|
|
3560
3565
|
}
|
|
3561
3566
|
return {
|
|
3562
3567
|
type: "input_file",
|
|
3563
|
-
filename: (
|
|
3568
|
+
filename: (_c2 = item.filename) != null ? _c2 : "data",
|
|
3564
3569
|
file_data: `data:${fullMediaType};base64,${convertToBase642(item.data.data)}`
|
|
3565
3570
|
};
|
|
3566
3571
|
}
|
|
@@ -3568,7 +3573,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
3568
3573
|
if (topLevel === "image") {
|
|
3569
3574
|
return {
|
|
3570
3575
|
type: "input_image",
|
|
3571
|
-
image_url: item.data.url.toString()
|
|
3576
|
+
image_url: item.data.url.toString(),
|
|
3577
|
+
detail: imageDetail
|
|
3572
3578
|
};
|
|
3573
3579
|
}
|
|
3574
3580
|
return {
|
|
@@ -7253,7 +7259,7 @@ var OpenAISkills = class {
|
|
|
7253
7259
|
};
|
|
7254
7260
|
|
|
7255
7261
|
// src/version.ts
|
|
7256
|
-
var VERSION = true ? "4.0.0-canary.
|
|
7262
|
+
var VERSION = true ? "4.0.0-canary.49" : "0.0.0-test";
|
|
7257
7263
|
|
|
7258
7264
|
// src/openai-provider.ts
|
|
7259
7265
|
function createOpenAI(options = {}) {
|