@ai-sdk/openai 4.0.0-canary.47 → 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,19 @@
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
+
11
+ ## 4.0.0-canary.48
12
+
13
+ ### Patch Changes
14
+
15
+ - d6c79e3: feat(openai): add GPT-5.5 chat model IDs
16
+
3
17
  ## 4.0.0-canary.47
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { JSONValue, ProviderV4, LanguageModelV4, EmbeddingModelV4, ImageModelV4,
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
5
5
 
6
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | (string & {});
6
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | (string & {});
7
7
  declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
8
8
  logitBias?: Record<number, number> | undefined;
9
9
  logprobs?: number | boolean | undefined;
@@ -1040,7 +1040,7 @@ declare const openaiTools: {
1040
1040
  }, {}>;
1041
1041
  };
1042
1042
 
1043
- type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
1043
+ type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
1044
1044
  declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
1045
1045
  conversation?: string | null | undefined;
1046
1046
  include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
45
45
  const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
46
46
  const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") && !modelId.startsWith("gpt-5.4-nano") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
47
47
  const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
48
- const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.3") || modelId.startsWith("gpt-5.4");
48
+ const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.3") || modelId.startsWith("gpt-5.4") || modelId.startsWith("gpt-5.5");
49
49
  const systemMessageMode = isReasoningModel ? "developer" : "system";
50
50
  return {
51
51
  supportsFlexProcessing,
@@ -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: (_a2 = item.filename) != null ? _a2 : "data",
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: (_a2 = item.filename) != null ? _a2 : "data",
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 {
@@ -4552,7 +4558,9 @@ var openaiResponsesReasoningModelIds = [
4552
4558
  "gpt-5.4-nano",
4553
4559
  "gpt-5.4-nano-2026-03-17",
4554
4560
  "gpt-5.4-pro",
4555
- "gpt-5.4-pro-2026-03-05"
4561
+ "gpt-5.4-pro-2026-03-05",
4562
+ "gpt-5.5",
4563
+ "gpt-5.5-2026-04-23"
4556
4564
  ];
4557
4565
  var openaiResponsesModelIds = [
4558
4566
  "gpt-4.1",
@@ -7251,7 +7259,7 @@ var OpenAISkills = class {
7251
7259
  };
7252
7260
 
7253
7261
  // src/version.ts
7254
- var VERSION = true ? "4.0.0-canary.47" : "0.0.0-test";
7262
+ var VERSION = true ? "4.0.0-canary.49" : "0.0.0-test";
7255
7263
 
7256
7264
  // src/openai-provider.ts
7257
7265
  function createOpenAI(options = {}) {