@ai-sdk/openai 3.0.0-beta.69 → 3.0.0-beta.71
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 -0
- package/dist/index.js +57 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -60
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +56 -59
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +56 -59
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.71
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [03849b0]
|
|
8
|
+
- @ai-sdk/provider-utils@4.0.0-beta.38
|
|
9
|
+
|
|
10
|
+
## 3.0.0-beta.70
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings
|
|
15
|
+
- Updated dependencies [457318b]
|
|
16
|
+
- @ai-sdk/provider@3.0.0-beta.20
|
|
17
|
+
- @ai-sdk/provider-utils@4.0.0-beta.37
|
|
18
|
+
|
|
3
19
|
## 3.0.0-beta.69
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -545,7 +545,10 @@ function prepareChatTools({
|
|
|
545
545
|
});
|
|
546
546
|
break;
|
|
547
547
|
default:
|
|
548
|
-
toolWarnings.push({
|
|
548
|
+
toolWarnings.push({
|
|
549
|
+
type: "unsupported",
|
|
550
|
+
feature: `tool type: ${tool.type}`
|
|
551
|
+
});
|
|
549
552
|
break;
|
|
550
553
|
}
|
|
551
554
|
}
|
|
@@ -615,15 +618,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
615
618
|
})) != null ? _a : {};
|
|
616
619
|
const structuredOutputs = (_b = openaiOptions.structuredOutputs) != null ? _b : true;
|
|
617
620
|
if (topK != null) {
|
|
618
|
-
warnings.push({
|
|
619
|
-
type: "unsupported-setting",
|
|
620
|
-
setting: "topK"
|
|
621
|
-
});
|
|
621
|
+
warnings.push({ type: "unsupported", feature: "topK" });
|
|
622
622
|
}
|
|
623
623
|
if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !structuredOutputs) {
|
|
624
624
|
warnings.push({
|
|
625
|
-
type: "unsupported
|
|
626
|
-
|
|
625
|
+
type: "unsupported",
|
|
626
|
+
feature: "responseFormat",
|
|
627
627
|
details: "JSON response format schema is only supported with structuredOutputs"
|
|
628
628
|
});
|
|
629
629
|
}
|
|
@@ -680,32 +680,32 @@ var OpenAIChatLanguageModel = class {
|
|
|
680
680
|
if (baseArgs.temperature != null) {
|
|
681
681
|
baseArgs.temperature = void 0;
|
|
682
682
|
warnings.push({
|
|
683
|
-
type: "unsupported
|
|
684
|
-
|
|
683
|
+
type: "unsupported",
|
|
684
|
+
feature: "temperature",
|
|
685
685
|
details: "temperature is not supported for reasoning models"
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
if (baseArgs.top_p != null) {
|
|
689
689
|
baseArgs.top_p = void 0;
|
|
690
690
|
warnings.push({
|
|
691
|
-
type: "unsupported
|
|
692
|
-
|
|
691
|
+
type: "unsupported",
|
|
692
|
+
feature: "topP",
|
|
693
693
|
details: "topP is not supported for reasoning models"
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
696
|
if (baseArgs.frequency_penalty != null) {
|
|
697
697
|
baseArgs.frequency_penalty = void 0;
|
|
698
698
|
warnings.push({
|
|
699
|
-
type: "unsupported
|
|
700
|
-
|
|
699
|
+
type: "unsupported",
|
|
700
|
+
feature: "frequencyPenalty",
|
|
701
701
|
details: "frequencyPenalty is not supported for reasoning models"
|
|
702
702
|
});
|
|
703
703
|
}
|
|
704
704
|
if (baseArgs.presence_penalty != null) {
|
|
705
705
|
baseArgs.presence_penalty = void 0;
|
|
706
706
|
warnings.push({
|
|
707
|
-
type: "unsupported
|
|
708
|
-
|
|
707
|
+
type: "unsupported",
|
|
708
|
+
feature: "presencePenalty",
|
|
709
709
|
details: "presencePenalty is not supported for reasoning models"
|
|
710
710
|
});
|
|
711
711
|
}
|
|
@@ -740,24 +740,24 @@ var OpenAIChatLanguageModel = class {
|
|
|
740
740
|
if (baseArgs.temperature != null) {
|
|
741
741
|
baseArgs.temperature = void 0;
|
|
742
742
|
warnings.push({
|
|
743
|
-
type: "unsupported
|
|
744
|
-
|
|
743
|
+
type: "unsupported",
|
|
744
|
+
feature: "temperature",
|
|
745
745
|
details: "temperature is not supported for the search preview models and has been removed."
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
if (openaiOptions.serviceTier === "flex" && !supportsFlexProcessing(this.modelId)) {
|
|
750
750
|
warnings.push({
|
|
751
|
-
type: "unsupported
|
|
752
|
-
|
|
751
|
+
type: "unsupported",
|
|
752
|
+
feature: "serviceTier",
|
|
753
753
|
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
754
754
|
});
|
|
755
755
|
baseArgs.service_tier = void 0;
|
|
756
756
|
}
|
|
757
757
|
if (openaiOptions.serviceTier === "priority" && !supportsPriorityProcessing(this.modelId)) {
|
|
758
758
|
warnings.push({
|
|
759
|
-
type: "unsupported
|
|
760
|
-
|
|
759
|
+
type: "unsupported",
|
|
760
|
+
feature: "serviceTier",
|
|
761
761
|
details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
762
762
|
});
|
|
763
763
|
baseArgs.service_tier = void 0;
|
|
@@ -1344,18 +1344,18 @@ var OpenAICompletionLanguageModel = class {
|
|
|
1344
1344
|
})
|
|
1345
1345
|
};
|
|
1346
1346
|
if (topK != null) {
|
|
1347
|
-
warnings.push({ type: "unsupported
|
|
1347
|
+
warnings.push({ type: "unsupported", feature: "topK" });
|
|
1348
1348
|
}
|
|
1349
1349
|
if (tools == null ? void 0 : tools.length) {
|
|
1350
|
-
warnings.push({ type: "unsupported
|
|
1350
|
+
warnings.push({ type: "unsupported", feature: "tools" });
|
|
1351
1351
|
}
|
|
1352
1352
|
if (toolChoice != null) {
|
|
1353
|
-
warnings.push({ type: "unsupported
|
|
1353
|
+
warnings.push({ type: "unsupported", feature: "toolChoice" });
|
|
1354
1354
|
}
|
|
1355
1355
|
if (responseFormat != null && responseFormat.type !== "text") {
|
|
1356
1356
|
warnings.push({
|
|
1357
|
-
type: "unsupported
|
|
1358
|
-
|
|
1357
|
+
type: "unsupported",
|
|
1358
|
+
feature: "responseFormat",
|
|
1359
1359
|
details: "JSON response format is not supported."
|
|
1360
1360
|
});
|
|
1361
1361
|
}
|
|
@@ -1697,13 +1697,13 @@ var OpenAIImageModel = class {
|
|
|
1697
1697
|
const warnings = [];
|
|
1698
1698
|
if (aspectRatio != null) {
|
|
1699
1699
|
warnings.push({
|
|
1700
|
-
type: "unsupported
|
|
1701
|
-
|
|
1700
|
+
type: "unsupported",
|
|
1701
|
+
feature: "aspectRatio",
|
|
1702
1702
|
details: "This model does not support aspect ratio. Use `size` instead."
|
|
1703
1703
|
});
|
|
1704
1704
|
}
|
|
1705
1705
|
if (seed != null) {
|
|
1706
|
-
warnings.push({ type: "unsupported
|
|
1706
|
+
warnings.push({ type: "unsupported", feature: "seed" });
|
|
1707
1707
|
}
|
|
1708
1708
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1709
1709
|
const { value: response, responseHeaders } = await (0, import_provider_utils13.postJsonToApi)({
|
|
@@ -3364,7 +3364,10 @@ async function prepareResponsesTools({
|
|
|
3364
3364
|
break;
|
|
3365
3365
|
}
|
|
3366
3366
|
default:
|
|
3367
|
-
toolWarnings.push({
|
|
3367
|
+
toolWarnings.push({
|
|
3368
|
+
type: "unsupported",
|
|
3369
|
+
feature: `function tool ${tool}`
|
|
3370
|
+
});
|
|
3368
3371
|
break;
|
|
3369
3372
|
}
|
|
3370
3373
|
}
|
|
@@ -3425,25 +3428,19 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3425
3428
|
const warnings = [];
|
|
3426
3429
|
const modelConfig = getResponsesModelConfig(this.modelId);
|
|
3427
3430
|
if (topK != null) {
|
|
3428
|
-
warnings.push({ type: "unsupported
|
|
3431
|
+
warnings.push({ type: "unsupported", feature: "topK" });
|
|
3429
3432
|
}
|
|
3430
3433
|
if (seed != null) {
|
|
3431
|
-
warnings.push({ type: "unsupported
|
|
3434
|
+
warnings.push({ type: "unsupported", feature: "seed" });
|
|
3432
3435
|
}
|
|
3433
3436
|
if (presencePenalty != null) {
|
|
3434
|
-
warnings.push({
|
|
3435
|
-
type: "unsupported-setting",
|
|
3436
|
-
setting: "presencePenalty"
|
|
3437
|
-
});
|
|
3437
|
+
warnings.push({ type: "unsupported", feature: "presencePenalty" });
|
|
3438
3438
|
}
|
|
3439
3439
|
if (frequencyPenalty != null) {
|
|
3440
|
-
warnings.push({
|
|
3441
|
-
type: "unsupported-setting",
|
|
3442
|
-
setting: "frequencyPenalty"
|
|
3443
|
-
});
|
|
3440
|
+
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
3444
3441
|
}
|
|
3445
3442
|
if (stopSequences != null) {
|
|
3446
|
-
warnings.push({ type: "unsupported
|
|
3443
|
+
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
3447
3444
|
}
|
|
3448
3445
|
const openaiOptions = await (0, import_provider_utils25.parseProviderOptions)({
|
|
3449
3446
|
provider: "openai",
|
|
@@ -3452,8 +3449,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3452
3449
|
});
|
|
3453
3450
|
if ((openaiOptions == null ? void 0 : openaiOptions.conversation) && (openaiOptions == null ? void 0 : openaiOptions.previousResponseId)) {
|
|
3454
3451
|
warnings.push({
|
|
3455
|
-
type: "unsupported
|
|
3456
|
-
|
|
3452
|
+
type: "unsupported",
|
|
3453
|
+
feature: "conversation",
|
|
3457
3454
|
details: "conversation and previousResponseId cannot be used together"
|
|
3458
3455
|
});
|
|
3459
3456
|
}
|
|
@@ -3550,47 +3547,47 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3550
3547
|
if (baseArgs.temperature != null) {
|
|
3551
3548
|
baseArgs.temperature = void 0;
|
|
3552
3549
|
warnings.push({
|
|
3553
|
-
type: "unsupported
|
|
3554
|
-
|
|
3550
|
+
type: "unsupported",
|
|
3551
|
+
feature: "temperature",
|
|
3555
3552
|
details: "temperature is not supported for reasoning models"
|
|
3556
3553
|
});
|
|
3557
3554
|
}
|
|
3558
3555
|
if (baseArgs.top_p != null) {
|
|
3559
3556
|
baseArgs.top_p = void 0;
|
|
3560
3557
|
warnings.push({
|
|
3561
|
-
type: "unsupported
|
|
3562
|
-
|
|
3558
|
+
type: "unsupported",
|
|
3559
|
+
feature: "topP",
|
|
3563
3560
|
details: "topP is not supported for reasoning models"
|
|
3564
3561
|
});
|
|
3565
3562
|
}
|
|
3566
3563
|
} else {
|
|
3567
3564
|
if ((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null) {
|
|
3568
3565
|
warnings.push({
|
|
3569
|
-
type: "unsupported
|
|
3570
|
-
|
|
3566
|
+
type: "unsupported",
|
|
3567
|
+
feature: "reasoningEffort",
|
|
3571
3568
|
details: "reasoningEffort is not supported for non-reasoning models"
|
|
3572
3569
|
});
|
|
3573
3570
|
}
|
|
3574
3571
|
if ((openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null) {
|
|
3575
3572
|
warnings.push({
|
|
3576
|
-
type: "unsupported
|
|
3577
|
-
|
|
3573
|
+
type: "unsupported",
|
|
3574
|
+
feature: "reasoningSummary",
|
|
3578
3575
|
details: "reasoningSummary is not supported for non-reasoning models"
|
|
3579
3576
|
});
|
|
3580
3577
|
}
|
|
3581
3578
|
}
|
|
3582
3579
|
if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "flex" && !modelConfig.supportsFlexProcessing) {
|
|
3583
3580
|
warnings.push({
|
|
3584
|
-
type: "unsupported
|
|
3585
|
-
|
|
3581
|
+
type: "unsupported",
|
|
3582
|
+
feature: "serviceTier",
|
|
3586
3583
|
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
3587
3584
|
});
|
|
3588
3585
|
delete baseArgs.service_tier;
|
|
3589
3586
|
}
|
|
3590
3587
|
if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" && !modelConfig.supportsPriorityProcessing) {
|
|
3591
3588
|
warnings.push({
|
|
3592
|
-
type: "unsupported
|
|
3593
|
-
|
|
3589
|
+
type: "unsupported",
|
|
3590
|
+
feature: "serviceTier",
|
|
3594
3591
|
details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
3595
3592
|
});
|
|
3596
3593
|
delete baseArgs.service_tier;
|
|
@@ -4695,8 +4692,8 @@ var OpenAISpeechModel = class {
|
|
|
4695
4692
|
requestBody.response_format = outputFormat;
|
|
4696
4693
|
} else {
|
|
4697
4694
|
warnings.push({
|
|
4698
|
-
type: "unsupported
|
|
4699
|
-
|
|
4695
|
+
type: "unsupported",
|
|
4696
|
+
feature: "outputFormat",
|
|
4700
4697
|
details: `Unsupported output format: ${outputFormat}. Using mp3 instead.`
|
|
4701
4698
|
});
|
|
4702
4699
|
}
|
|
@@ -4712,8 +4709,8 @@ var OpenAISpeechModel = class {
|
|
|
4712
4709
|
}
|
|
4713
4710
|
if (language) {
|
|
4714
4711
|
warnings.push({
|
|
4715
|
-
type: "unsupported
|
|
4716
|
-
|
|
4712
|
+
type: "unsupported",
|
|
4713
|
+
feature: "language",
|
|
4717
4714
|
details: `OpenAI speech models do not support language selection. Language parameter "${language}" was ignored.`
|
|
4718
4715
|
});
|
|
4719
4716
|
}
|
|
@@ -4995,7 +4992,7 @@ var OpenAITranscriptionModel = class {
|
|
|
4995
4992
|
};
|
|
4996
4993
|
|
|
4997
4994
|
// src/version.ts
|
|
4998
|
-
var VERSION = true ? "3.0.0-beta.
|
|
4995
|
+
var VERSION = true ? "3.0.0-beta.71" : "0.0.0-test";
|
|
4999
4996
|
|
|
5000
4997
|
// src/openai-provider.ts
|
|
5001
4998
|
function createOpenAI(options = {}) {
|