@ai-sdk/openai 4.0.0-beta.4 → 4.0.0-beta.6

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.d.mts +17 -17
  3. package/dist/index.d.ts +17 -17
  4. package/dist/index.js +13 -12
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +13 -12
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/internal/index.d.mts +28 -28
  9. package/dist/internal/index.d.ts +28 -28
  10. package/dist/internal/index.js +11 -10
  11. package/dist/internal/index.js.map +1 -1
  12. package/dist/internal/index.mjs +11 -10
  13. package/dist/internal/index.mjs.map +1 -1
  14. package/docs/03-openai.mdx +3 -0
  15. package/package.json +5 -5
  16. package/src/chat/convert-openai-chat-usage.ts +2 -2
  17. package/src/chat/convert-to-openai-chat-messages.ts +5 -5
  18. package/src/chat/map-openai-finish-reason.ts +2 -2
  19. package/src/chat/openai-chat-language-model.ts +22 -22
  20. package/src/chat/openai-chat-options.ts +1 -0
  21. package/src/chat/openai-chat-prepare-tools.ts +6 -6
  22. package/src/completion/convert-openai-completion-usage.ts +2 -2
  23. package/src/completion/convert-to-openai-completion-prompt.ts +2 -2
  24. package/src/completion/map-openai-finish-reason.ts +2 -2
  25. package/src/completion/openai-completion-language-model.ts +20 -20
  26. package/src/embedding/openai-embedding-model.ts +5 -5
  27. package/src/image/openai-image-model.ts +9 -9
  28. package/src/openai-language-model-capabilities.ts +1 -0
  29. package/src/openai-provider.ts +21 -21
  30. package/src/responses/convert-openai-responses-usage.ts +2 -2
  31. package/src/responses/convert-to-openai-responses-input.ts +7 -7
  32. package/src/responses/map-openai-responses-finish-reason.ts +2 -2
  33. package/src/responses/openai-responses-language-model.ts +29 -29
  34. package/src/responses/openai-responses-options.ts +4 -2
  35. package/src/responses/openai-responses-prepare-tools.ts +6 -6
  36. package/src/speech/openai-speech-model.ts +7 -7
  37. package/src/transcription/openai-transcription-model.ts +8 -8
@@ -36,7 +36,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
36
36
  const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
37
37
  const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
38
38
  const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
39
- const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.4");
39
+ const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.3") || modelId.startsWith("gpt-5.4");
40
40
  const systemMessageMode = isReasoningModel ? "developer" : "system";
41
41
  return {
42
42
  supportsFlexProcessing,
@@ -631,7 +631,7 @@ function prepareChatTools({
631
631
  // src/chat/openai-chat-language-model.ts
632
632
  var OpenAIChatLanguageModel = class {
633
633
  constructor(modelId, config) {
634
- this.specificationVersion = "v3";
634
+ this.specificationVersion = "v4";
635
635
  this.supportedUrls = {
636
636
  "image/*": [/^https?:\/\/.*$/]
637
637
  };
@@ -1375,7 +1375,7 @@ var openaiLanguageModelCompletionOptions = lazySchema4(
1375
1375
  // src/completion/openai-completion-language-model.ts
1376
1376
  var OpenAICompletionLanguageModel = class {
1377
1377
  constructor(modelId, config) {
1378
- this.specificationVersion = "v3";
1378
+ this.specificationVersion = "v4";
1379
1379
  this.supportedUrls = {
1380
1380
  // No URLs are supported for completion models.
1381
1381
  };
@@ -1647,7 +1647,7 @@ var openaiTextEmbeddingResponseSchema = lazySchema6(
1647
1647
  // src/embedding/openai-embedding-model.ts
1648
1648
  var OpenAIEmbeddingModel = class {
1649
1649
  constructor(modelId, config) {
1650
- this.specificationVersion = "v3";
1650
+ this.specificationVersion = "v4";
1651
1651
  this.maxEmbeddingsPerCall = 2048;
1652
1652
  this.supportsParallelCalls = true;
1653
1653
  this.modelId = modelId;
@@ -1776,7 +1776,7 @@ var OpenAIImageModel = class {
1776
1776
  constructor(modelId, config) {
1777
1777
  this.modelId = modelId;
1778
1778
  this.config = config;
1779
- this.specificationVersion = "v3";
1779
+ this.specificationVersion = "v4";
1780
1780
  }
1781
1781
  get maxImagesPerCall() {
1782
1782
  var _a;
@@ -2104,7 +2104,7 @@ var OpenAITranscriptionModel = class {
2104
2104
  constructor(modelId, config) {
2105
2105
  this.modelId = modelId;
2106
2106
  this.config = config;
2107
- this.specificationVersion = "v3";
2107
+ this.specificationVersion = "v4";
2108
2108
  }
2109
2109
  get provider() {
2110
2110
  return this.config.provider;
@@ -2232,7 +2232,7 @@ var OpenAISpeechModel = class {
2232
2232
  constructor(modelId, config) {
2233
2233
  this.modelId = modelId;
2234
2234
  this.config = config;
2235
- this.specificationVersion = "v3";
2235
+ this.specificationVersion = "v4";
2236
2236
  }
2237
2237
  get provider() {
2238
2238
  return this.config.provider;
@@ -3927,11 +3927,12 @@ var openaiResponsesReasoningModelIds = [
3927
3927
  "gpt-5.2-chat-latest",
3928
3928
  "gpt-5.2-pro",
3929
3929
  "gpt-5.2-codex",
3930
+ "gpt-5.3-chat-latest",
3931
+ "gpt-5.3-codex",
3930
3932
  "gpt-5.4",
3931
3933
  "gpt-5.4-2026-03-05",
3932
3934
  "gpt-5.4-pro",
3933
- "gpt-5.4-pro-2026-03-05",
3934
- "gpt-5.3-codex"
3935
+ "gpt-5.4-pro-2026-03-05"
3935
3936
  ];
3936
3937
  var openaiResponsesModelIds = [
3937
3938
  "gpt-4.1",
@@ -4735,7 +4736,7 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
4735
4736
  }
4736
4737
  var OpenAIResponsesLanguageModel = class {
4737
4738
  constructor(modelId, config) {
4738
- this.specificationVersion = "v3";
4739
+ this.specificationVersion = "v4";
4739
4740
  this.supportedUrls = {
4740
4741
  "image/*": [/^https?:\/\/.*$/],
4741
4742
  "application/pdf": [/^https?:\/\/.*$/]