@ai-sdk/openai 3.0.0-beta.68 → 3.0.0-beta.70
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 +15 -0
- package/dist/index.js +72 -75
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -75
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +71 -74
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +71 -74
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -536,7 +536,10 @@ function prepareChatTools({
|
|
|
536
536
|
});
|
|
537
537
|
break;
|
|
538
538
|
default:
|
|
539
|
-
toolWarnings.push({
|
|
539
|
+
toolWarnings.push({
|
|
540
|
+
type: "unsupported",
|
|
541
|
+
feature: `tool type: ${tool.type}`
|
|
542
|
+
});
|
|
540
543
|
break;
|
|
541
544
|
}
|
|
542
545
|
}
|
|
@@ -606,15 +609,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
606
609
|
})) != null ? _a : {};
|
|
607
610
|
const structuredOutputs = (_b = openaiOptions.structuredOutputs) != null ? _b : true;
|
|
608
611
|
if (topK != null) {
|
|
609
|
-
warnings.push({
|
|
610
|
-
type: "unsupported-setting",
|
|
611
|
-
setting: "topK"
|
|
612
|
-
});
|
|
612
|
+
warnings.push({ type: "unsupported", feature: "topK" });
|
|
613
613
|
}
|
|
614
614
|
if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !structuredOutputs) {
|
|
615
615
|
warnings.push({
|
|
616
|
-
type: "unsupported
|
|
617
|
-
|
|
616
|
+
type: "unsupported",
|
|
617
|
+
feature: "responseFormat",
|
|
618
618
|
details: "JSON response format schema is only supported with structuredOutputs"
|
|
619
619
|
});
|
|
620
620
|
}
|
|
@@ -671,32 +671,32 @@ var OpenAIChatLanguageModel = class {
|
|
|
671
671
|
if (baseArgs.temperature != null) {
|
|
672
672
|
baseArgs.temperature = void 0;
|
|
673
673
|
warnings.push({
|
|
674
|
-
type: "unsupported
|
|
675
|
-
|
|
674
|
+
type: "unsupported",
|
|
675
|
+
feature: "temperature",
|
|
676
676
|
details: "temperature is not supported for reasoning models"
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
679
|
if (baseArgs.top_p != null) {
|
|
680
680
|
baseArgs.top_p = void 0;
|
|
681
681
|
warnings.push({
|
|
682
|
-
type: "unsupported
|
|
683
|
-
|
|
682
|
+
type: "unsupported",
|
|
683
|
+
feature: "topP",
|
|
684
684
|
details: "topP is not supported for reasoning models"
|
|
685
685
|
});
|
|
686
686
|
}
|
|
687
687
|
if (baseArgs.frequency_penalty != null) {
|
|
688
688
|
baseArgs.frequency_penalty = void 0;
|
|
689
689
|
warnings.push({
|
|
690
|
-
type: "unsupported
|
|
691
|
-
|
|
690
|
+
type: "unsupported",
|
|
691
|
+
feature: "frequencyPenalty",
|
|
692
692
|
details: "frequencyPenalty is not supported for reasoning models"
|
|
693
693
|
});
|
|
694
694
|
}
|
|
695
695
|
if (baseArgs.presence_penalty != null) {
|
|
696
696
|
baseArgs.presence_penalty = void 0;
|
|
697
697
|
warnings.push({
|
|
698
|
-
type: "unsupported
|
|
699
|
-
|
|
698
|
+
type: "unsupported",
|
|
699
|
+
feature: "presencePenalty",
|
|
700
700
|
details: "presencePenalty is not supported for reasoning models"
|
|
701
701
|
});
|
|
702
702
|
}
|
|
@@ -731,24 +731,24 @@ var OpenAIChatLanguageModel = class {
|
|
|
731
731
|
if (baseArgs.temperature != null) {
|
|
732
732
|
baseArgs.temperature = void 0;
|
|
733
733
|
warnings.push({
|
|
734
|
-
type: "unsupported
|
|
735
|
-
|
|
734
|
+
type: "unsupported",
|
|
735
|
+
feature: "temperature",
|
|
736
736
|
details: "temperature is not supported for the search preview models and has been removed."
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
740
|
if (openaiOptions.serviceTier === "flex" && !supportsFlexProcessing(this.modelId)) {
|
|
741
741
|
warnings.push({
|
|
742
|
-
type: "unsupported
|
|
743
|
-
|
|
742
|
+
type: "unsupported",
|
|
743
|
+
feature: "serviceTier",
|
|
744
744
|
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
745
745
|
});
|
|
746
746
|
baseArgs.service_tier = void 0;
|
|
747
747
|
}
|
|
748
748
|
if (openaiOptions.serviceTier === "priority" && !supportsPriorityProcessing(this.modelId)) {
|
|
749
749
|
warnings.push({
|
|
750
|
-
type: "unsupported
|
|
751
|
-
|
|
750
|
+
type: "unsupported",
|
|
751
|
+
feature: "serviceTier",
|
|
752
752
|
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"
|
|
753
753
|
});
|
|
754
754
|
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
|
}
|
|
@@ -1708,13 +1708,13 @@ var OpenAIImageModel = class {
|
|
|
1708
1708
|
const warnings = [];
|
|
1709
1709
|
if (aspectRatio != null) {
|
|
1710
1710
|
warnings.push({
|
|
1711
|
-
type: "unsupported
|
|
1712
|
-
|
|
1711
|
+
type: "unsupported",
|
|
1712
|
+
feature: "aspectRatio",
|
|
1713
1713
|
details: "This model does not support aspect ratio. Use `size` instead."
|
|
1714
1714
|
});
|
|
1715
1715
|
}
|
|
1716
1716
|
if (seed != null) {
|
|
1717
|
-
warnings.push({ type: "unsupported
|
|
1717
|
+
warnings.push({ type: "unsupported", feature: "seed" });
|
|
1718
1718
|
}
|
|
1719
1719
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1720
1720
|
const { value: response, responseHeaders } = await postJsonToApi4({
|
|
@@ -3421,7 +3421,10 @@ async function prepareResponsesTools({
|
|
|
3421
3421
|
break;
|
|
3422
3422
|
}
|
|
3423
3423
|
default:
|
|
3424
|
-
toolWarnings.push({
|
|
3424
|
+
toolWarnings.push({
|
|
3425
|
+
type: "unsupported",
|
|
3426
|
+
feature: `function tool ${tool}`
|
|
3427
|
+
});
|
|
3425
3428
|
break;
|
|
3426
3429
|
}
|
|
3427
3430
|
}
|
|
@@ -3482,25 +3485,19 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3482
3485
|
const warnings = [];
|
|
3483
3486
|
const modelConfig = getResponsesModelConfig(this.modelId);
|
|
3484
3487
|
if (topK != null) {
|
|
3485
|
-
warnings.push({ type: "unsupported
|
|
3488
|
+
warnings.push({ type: "unsupported", feature: "topK" });
|
|
3486
3489
|
}
|
|
3487
3490
|
if (seed != null) {
|
|
3488
|
-
warnings.push({ type: "unsupported
|
|
3491
|
+
warnings.push({ type: "unsupported", feature: "seed" });
|
|
3489
3492
|
}
|
|
3490
3493
|
if (presencePenalty != null) {
|
|
3491
|
-
warnings.push({
|
|
3492
|
-
type: "unsupported-setting",
|
|
3493
|
-
setting: "presencePenalty"
|
|
3494
|
-
});
|
|
3494
|
+
warnings.push({ type: "unsupported", feature: "presencePenalty" });
|
|
3495
3495
|
}
|
|
3496
3496
|
if (frequencyPenalty != null) {
|
|
3497
|
-
warnings.push({
|
|
3498
|
-
type: "unsupported-setting",
|
|
3499
|
-
setting: "frequencyPenalty"
|
|
3500
|
-
});
|
|
3497
|
+
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
3501
3498
|
}
|
|
3502
3499
|
if (stopSequences != null) {
|
|
3503
|
-
warnings.push({ type: "unsupported
|
|
3500
|
+
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
3504
3501
|
}
|
|
3505
3502
|
const openaiOptions = await parseProviderOptions5({
|
|
3506
3503
|
provider: "openai",
|
|
@@ -3509,8 +3506,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3509
3506
|
});
|
|
3510
3507
|
if ((openaiOptions == null ? void 0 : openaiOptions.conversation) && (openaiOptions == null ? void 0 : openaiOptions.previousResponseId)) {
|
|
3511
3508
|
warnings.push({
|
|
3512
|
-
type: "unsupported
|
|
3513
|
-
|
|
3509
|
+
type: "unsupported",
|
|
3510
|
+
feature: "conversation",
|
|
3514
3511
|
details: "conversation and previousResponseId cannot be used together"
|
|
3515
3512
|
});
|
|
3516
3513
|
}
|
|
@@ -3607,47 +3604,47 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3607
3604
|
if (baseArgs.temperature != null) {
|
|
3608
3605
|
baseArgs.temperature = void 0;
|
|
3609
3606
|
warnings.push({
|
|
3610
|
-
type: "unsupported
|
|
3611
|
-
|
|
3607
|
+
type: "unsupported",
|
|
3608
|
+
feature: "temperature",
|
|
3612
3609
|
details: "temperature is not supported for reasoning models"
|
|
3613
3610
|
});
|
|
3614
3611
|
}
|
|
3615
3612
|
if (baseArgs.top_p != null) {
|
|
3616
3613
|
baseArgs.top_p = void 0;
|
|
3617
3614
|
warnings.push({
|
|
3618
|
-
type: "unsupported
|
|
3619
|
-
|
|
3615
|
+
type: "unsupported",
|
|
3616
|
+
feature: "topP",
|
|
3620
3617
|
details: "topP is not supported for reasoning models"
|
|
3621
3618
|
});
|
|
3622
3619
|
}
|
|
3623
3620
|
} else {
|
|
3624
3621
|
if ((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null) {
|
|
3625
3622
|
warnings.push({
|
|
3626
|
-
type: "unsupported
|
|
3627
|
-
|
|
3623
|
+
type: "unsupported",
|
|
3624
|
+
feature: "reasoningEffort",
|
|
3628
3625
|
details: "reasoningEffort is not supported for non-reasoning models"
|
|
3629
3626
|
});
|
|
3630
3627
|
}
|
|
3631
3628
|
if ((openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null) {
|
|
3632
3629
|
warnings.push({
|
|
3633
|
-
type: "unsupported
|
|
3634
|
-
|
|
3630
|
+
type: "unsupported",
|
|
3631
|
+
feature: "reasoningSummary",
|
|
3635
3632
|
details: "reasoningSummary is not supported for non-reasoning models"
|
|
3636
3633
|
});
|
|
3637
3634
|
}
|
|
3638
3635
|
}
|
|
3639
3636
|
if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "flex" && !modelConfig.supportsFlexProcessing) {
|
|
3640
3637
|
warnings.push({
|
|
3641
|
-
type: "unsupported
|
|
3642
|
-
|
|
3638
|
+
type: "unsupported",
|
|
3639
|
+
feature: "serviceTier",
|
|
3643
3640
|
details: "flex processing is only available for o3, o4-mini, and gpt-5 models"
|
|
3644
3641
|
});
|
|
3645
3642
|
delete baseArgs.service_tier;
|
|
3646
3643
|
}
|
|
3647
3644
|
if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === "priority" && !modelConfig.supportsPriorityProcessing) {
|
|
3648
3645
|
warnings.push({
|
|
3649
|
-
type: "unsupported
|
|
3650
|
-
|
|
3646
|
+
type: "unsupported",
|
|
3647
|
+
feature: "serviceTier",
|
|
3651
3648
|
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"
|
|
3652
3649
|
});
|
|
3653
3650
|
delete baseArgs.service_tier;
|
|
@@ -4223,8 +4220,21 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4223
4220
|
}
|
|
4224
4221
|
});
|
|
4225
4222
|
}
|
|
4226
|
-
} else if (isResponseOutputItemDoneChunk(value)
|
|
4227
|
-
if (value.item.type === "
|
|
4223
|
+
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
4224
|
+
if (value.item.type === "message") {
|
|
4225
|
+
controller.enqueue({
|
|
4226
|
+
type: "text-end",
|
|
4227
|
+
id: value.item.id,
|
|
4228
|
+
providerMetadata: {
|
|
4229
|
+
[providerKey]: {
|
|
4230
|
+
itemId: value.item.id,
|
|
4231
|
+
...ongoingAnnotations.length > 0 && {
|
|
4232
|
+
annotations: ongoingAnnotations
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
}
|
|
4236
|
+
});
|
|
4237
|
+
} else if (value.item.type === "function_call") {
|
|
4228
4238
|
ongoingToolCalls[value.output_index] = void 0;
|
|
4229
4239
|
hasFunctionCall = true;
|
|
4230
4240
|
controller.enqueue({
|
|
@@ -4593,19 +4603,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4593
4603
|
}
|
|
4594
4604
|
});
|
|
4595
4605
|
}
|
|
4596
|
-
} else if (isResponseOutputItemDoneChunk(value) && value.item.type === "message") {
|
|
4597
|
-
controller.enqueue({
|
|
4598
|
-
type: "text-end",
|
|
4599
|
-
id: value.item.id,
|
|
4600
|
-
providerMetadata: {
|
|
4601
|
-
[providerKey]: {
|
|
4602
|
-
itemId: value.item.id,
|
|
4603
|
-
...ongoingAnnotations.length > 0 && {
|
|
4604
|
-
annotations: ongoingAnnotations
|
|
4605
|
-
}
|
|
4606
|
-
}
|
|
4607
|
-
}
|
|
4608
|
-
});
|
|
4609
4606
|
} else if (isErrorChunk(value)) {
|
|
4610
4607
|
controller.enqueue({ type: "error", error: value });
|
|
4611
4608
|
}
|
|
@@ -4757,8 +4754,8 @@ var OpenAISpeechModel = class {
|
|
|
4757
4754
|
requestBody.response_format = outputFormat;
|
|
4758
4755
|
} else {
|
|
4759
4756
|
warnings.push({
|
|
4760
|
-
type: "unsupported
|
|
4761
|
-
|
|
4757
|
+
type: "unsupported",
|
|
4758
|
+
feature: "outputFormat",
|
|
4762
4759
|
details: `Unsupported output format: ${outputFormat}. Using mp3 instead.`
|
|
4763
4760
|
});
|
|
4764
4761
|
}
|
|
@@ -4774,8 +4771,8 @@ var OpenAISpeechModel = class {
|
|
|
4774
4771
|
}
|
|
4775
4772
|
if (language) {
|
|
4776
4773
|
warnings.push({
|
|
4777
|
-
type: "unsupported
|
|
4778
|
-
|
|
4774
|
+
type: "unsupported",
|
|
4775
|
+
feature: "language",
|
|
4779
4776
|
details: `OpenAI speech models do not support language selection. Language parameter "${language}" was ignored.`
|
|
4780
4777
|
});
|
|
4781
4778
|
}
|
|
@@ -5064,7 +5061,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5064
5061
|
};
|
|
5065
5062
|
|
|
5066
5063
|
// src/version.ts
|
|
5067
|
-
var VERSION = true ? "3.0.0-beta.
|
|
5064
|
+
var VERSION = true ? "3.0.0-beta.70" : "0.0.0-test";
|
|
5068
5065
|
|
|
5069
5066
|
// src/openai-provider.ts
|
|
5070
5067
|
function createOpenAI(options = {}) {
|