@ai-sdk/openai 3.0.53 → 3.0.55

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 (48) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +5 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +41 -12
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/internal/index.d.mts +1 -1
  9. package/dist/internal/index.d.ts +1 -1
  10. package/dist/internal/index.js +4 -2
  11. package/dist/internal/index.js.map +1 -1
  12. package/dist/internal/index.mjs +40 -11
  13. package/dist/internal/index.mjs.map +1 -1
  14. package/package.json +6 -5
  15. package/src/chat/convert-openai-chat-usage.ts +1 -1
  16. package/src/chat/convert-to-openai-chat-messages.ts +4 -4
  17. package/src/chat/map-openai-finish-reason.ts +1 -1
  18. package/src/chat/openai-chat-api.ts +6 -2
  19. package/src/chat/openai-chat-language-model.ts +14 -14
  20. package/src/chat/openai-chat-options.ts +5 -1
  21. package/src/chat/openai-chat-prepare-tools.ts +3 -3
  22. package/src/completion/convert-openai-completion-usage.ts +1 -1
  23. package/src/completion/convert-to-openai-completion-prompt.ts +1 -1
  24. package/src/completion/map-openai-finish-reason.ts +1 -1
  25. package/src/completion/openai-completion-api.ts +5 -1
  26. package/src/completion/openai-completion-language-model.ts +6 -6
  27. package/src/completion/openai-completion-options.ts +5 -1
  28. package/src/embedding/openai-embedding-model.ts +3 -3
  29. package/src/embedding/openai-embedding-options.ts +5 -1
  30. package/src/image/openai-image-model.ts +3 -3
  31. package/src/image/openai-image-options.ts +3 -0
  32. package/src/openai-config.ts +1 -1
  33. package/src/openai-provider.ts +9 -9
  34. package/src/responses/convert-openai-responses-usage.ts +1 -1
  35. package/src/responses/convert-to-openai-responses-input.ts +5 -5
  36. package/src/responses/map-openai-responses-finish-reason.ts +1 -1
  37. package/src/responses/openai-responses-api.ts +6 -2
  38. package/src/responses/openai-responses-language-model.ts +35 -35
  39. package/src/responses/openai-responses-options.ts +5 -1
  40. package/src/responses/openai-responses-prepare-tools.ts +4 -4
  41. package/src/responses/openai-responses-provider-metadata.ts +2 -2
  42. package/src/speech/openai-speech-model.ts +4 -4
  43. package/src/speech/openai-speech-options.ts +5 -1
  44. package/src/tool/file-search.ts +1 -1
  45. package/src/tool/mcp.ts +1 -1
  46. package/src/tool/tool-search.ts +2 -2
  47. package/src/transcription/openai-transcription-model.ts +4 -4
  48. package/src/transcription/openai-transcription-options.ts +5 -1
package/dist/index.mjs CHANGED
@@ -241,7 +241,7 @@ function convertToOpenAIChatMessages({
241
241
  }
242
242
  messages.push({
243
243
  role: "assistant",
244
- content: text,
244
+ content: text || null,
245
245
  tool_calls: toolCalls.length > 0 ? toolCalls : void 0
246
246
  });
247
247
  break;
@@ -315,7 +315,10 @@ function mapOpenAIFinishReason(finishReason) {
315
315
  }
316
316
 
317
317
  // src/chat/openai-chat-api.ts
318
- import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
318
+ import {
319
+ lazySchema,
320
+ zodSchema
321
+ } from "@ai-sdk/provider-utils";
319
322
  import { z as z2 } from "zod/v4";
320
323
  var openaiChatResponseSchema = lazySchema(
321
324
  () => zodSchema(
@@ -457,7 +460,10 @@ var openaiChatChunkSchema = lazySchema(
457
460
  );
458
461
 
459
462
  // src/chat/openai-chat-options.ts
460
- import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
463
+ import {
464
+ lazySchema as lazySchema2,
465
+ zodSchema as zodSchema2
466
+ } from "@ai-sdk/provider-utils";
461
467
  import { z as z3 } from "zod/v4";
462
468
  var openaiLanguageModelChatOptions = lazySchema2(
463
469
  () => zodSchema2(
@@ -1279,7 +1285,10 @@ function mapOpenAIFinishReason2(finishReason) {
1279
1285
 
1280
1286
  // src/completion/openai-completion-api.ts
1281
1287
  import { z as z4 } from "zod/v4";
1282
- import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
1288
+ import {
1289
+ lazySchema as lazySchema3,
1290
+ zodSchema as zodSchema3
1291
+ } from "@ai-sdk/provider-utils";
1283
1292
  var openaiCompletionResponseSchema = lazySchema3(
1284
1293
  () => zodSchema3(
1285
1294
  z4.object({
@@ -1336,7 +1345,10 @@ var openaiCompletionChunkSchema = lazySchema3(
1336
1345
  );
1337
1346
 
1338
1347
  // src/completion/openai-completion-options.ts
1339
- import { lazySchema as lazySchema4, zodSchema as zodSchema4 } from "@ai-sdk/provider-utils";
1348
+ import {
1349
+ lazySchema as lazySchema4,
1350
+ zodSchema as zodSchema4
1351
+ } from "@ai-sdk/provider-utils";
1340
1352
  import { z as z5 } from "zod/v4";
1341
1353
  var openaiLanguageModelCompletionOptions = lazySchema4(
1342
1354
  () => zodSchema4(
@@ -1624,7 +1636,10 @@ import {
1624
1636
  } from "@ai-sdk/provider-utils";
1625
1637
 
1626
1638
  // src/embedding/openai-embedding-options.ts
1627
- import { lazySchema as lazySchema5, zodSchema as zodSchema5 } from "@ai-sdk/provider-utils";
1639
+ import {
1640
+ lazySchema as lazySchema5,
1641
+ zodSchema as zodSchema5
1642
+ } from "@ai-sdk/provider-utils";
1628
1643
  import { z as z6 } from "zod/v4";
1629
1644
  var openaiEmbeddingModelOptions = lazySchema5(
1630
1645
  () => zodSchema5(
@@ -1768,13 +1783,15 @@ var modelMaxImagesPerCall = {
1768
1783
  "gpt-image-1": 10,
1769
1784
  "gpt-image-1-mini": 10,
1770
1785
  "gpt-image-1.5": 10,
1786
+ "gpt-image-2": 10,
1771
1787
  "chatgpt-image-latest": 10
1772
1788
  };
1773
1789
  var defaultResponseFormatPrefixes = [
1774
1790
  "chatgpt-image-",
1775
1791
  "gpt-image-1-mini",
1776
1792
  "gpt-image-1.5",
1777
- "gpt-image-1"
1793
+ "gpt-image-1",
1794
+ "gpt-image-2"
1778
1795
  ];
1779
1796
  function hasDefaultResponseFormat(modelId) {
1780
1797
  return defaultResponseFormatPrefixes.some(
@@ -3348,7 +3365,10 @@ function mapOpenAIResponseFinishReason({
3348
3365
  }
3349
3366
 
3350
3367
  // src/responses/openai-responses-api.ts
3351
- import { lazySchema as lazySchema19, zodSchema as zodSchema19 } from "@ai-sdk/provider-utils";
3368
+ import {
3369
+ lazySchema as lazySchema19,
3370
+ zodSchema as zodSchema19
3371
+ } from "@ai-sdk/provider-utils";
3352
3372
  import { z as z21 } from "zod/v4";
3353
3373
  var jsonValueSchema2 = z21.lazy(
3354
3374
  () => z21.union([
@@ -4193,7 +4213,10 @@ var openaiResponsesResponseSchema = lazySchema19(
4193
4213
  );
4194
4214
 
4195
4215
  // src/responses/openai-responses-options.ts
4196
- import { lazySchema as lazySchema20, zodSchema as zodSchema20 } from "@ai-sdk/provider-utils";
4216
+ import {
4217
+ lazySchema as lazySchema20,
4218
+ zodSchema as zodSchema20
4219
+ } from "@ai-sdk/provider-utils";
4197
4220
  import { z as z22 } from "zod/v4";
4198
4221
  var TOP_LOGPROBS_MAX = 20;
4199
4222
  var openaiResponsesReasoningModelIds = [
@@ -6388,7 +6411,10 @@ import {
6388
6411
  } from "@ai-sdk/provider-utils";
6389
6412
 
6390
6413
  // src/speech/openai-speech-options.ts
6391
- import { lazySchema as lazySchema21, zodSchema as zodSchema21 } from "@ai-sdk/provider-utils";
6414
+ import {
6415
+ lazySchema as lazySchema21,
6416
+ zodSchema as zodSchema21
6417
+ } from "@ai-sdk/provider-utils";
6392
6418
  import { z as z23 } from "zod/v4";
6393
6419
  var openaiSpeechModelOptionsSchema = lazySchema21(
6394
6420
  () => zodSchema21(
@@ -6545,7 +6571,10 @@ var openaiTranscriptionResponseSchema = lazySchema22(
6545
6571
  );
6546
6572
 
6547
6573
  // src/transcription/openai-transcription-options.ts
6548
- import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
6574
+ import {
6575
+ lazySchema as lazySchema23,
6576
+ zodSchema as zodSchema23
6577
+ } from "@ai-sdk/provider-utils";
6549
6578
  import { z as z25 } from "zod/v4";
6550
6579
  var openAITranscriptionModelOptions = lazySchema23(
6551
6580
  () => zodSchema23(
@@ -6744,7 +6773,7 @@ var OpenAITranscriptionModel = class {
6744
6773
  };
6745
6774
 
6746
6775
  // src/version.ts
6747
- var VERSION = true ? "3.0.53" : "0.0.0-test";
6776
+ var VERSION = true ? "3.0.55" : "0.0.0-test";
6748
6777
 
6749
6778
  // src/openai-provider.ts
6750
6779
  function createOpenAI(options = {}) {