@ai-sdk/openai 3.0.0-beta.31 → 3.0.0-beta.33

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.
@@ -2407,22 +2407,33 @@ async function convertToOpenAIResponsesInput({
2407
2407
  break;
2408
2408
  case "content":
2409
2409
  contentValue = output.value.map((item) => {
2410
+ var _a2;
2410
2411
  switch (item.type) {
2411
2412
  case "text": {
2412
2413
  return { type: "input_text", text: item.text };
2413
2414
  }
2414
- case "media": {
2415
- return item.mediaType.startsWith("image/") ? {
2415
+ case "image-data": {
2416
+ return {
2416
2417
  type: "input_image",
2417
2418
  image_url: `data:${item.mediaType};base64,${item.data}`
2418
- } : {
2419
+ };
2420
+ }
2421
+ case "file-data": {
2422
+ return {
2419
2423
  type: "input_file",
2420
- filename: "data",
2424
+ filename: (_a2 = item.filename) != null ? _a2 : "data",
2421
2425
  file_data: `data:${item.mediaType};base64,${item.data}`
2422
2426
  };
2423
2427
  }
2428
+ default: {
2429
+ warnings.push({
2430
+ type: "other",
2431
+ message: `unsupported tool content part type: ${item.type}`
2432
+ });
2433
+ return void 0;
2434
+ }
2424
2435
  }
2425
- });
2436
+ }).filter(import_provider_utils20.isNonNullable);
2426
2437
  break;
2427
2438
  }
2428
2439
  input.push({
@@ -2990,6 +3001,7 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazySchem
2990
3001
  store: import_v415.z.boolean().nullish(),
2991
3002
  strictJsonSchema: import_v415.z.boolean().nullish(),
2992
3003
  textVerbosity: import_v415.z.enum(["low", "medium", "high"]).nullish(),
3004
+ truncation: import_v415.z.enum(["auto", "disabled"]).nullish(),
2993
3005
  user: import_v415.z.string().nullish()
2994
3006
  })
2995
3007
  )
@@ -3496,6 +3508,7 @@ var OpenAIResponsesLanguageModel = class {
3496
3508
  prompt_cache_key: openaiOptions == null ? void 0 : openaiOptions.promptCacheKey,
3497
3509
  safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,
3498
3510
  top_logprobs: topLogprobs,
3511
+ truncation: openaiOptions == null ? void 0 : openaiOptions.truncation,
3499
3512
  // model-specific settings:
3500
3513
  ...modelConfig.isReasoningModel && ((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null) && {
3501
3514
  reasoning: {
@@ -3506,9 +3519,6 @@ var OpenAIResponsesLanguageModel = class {
3506
3519
  summary: openaiOptions.reasoningSummary
3507
3520
  }
3508
3521
  }
3509
- },
3510
- ...modelConfig.requiredAutoTruncation && {
3511
- truncation: "auto"
3512
3522
  }
3513
3523
  };
3514
3524
  if (modelConfig.isReasoningModel) {
@@ -4364,7 +4374,6 @@ function getResponsesModelConfig(modelId) {
4364
4374
  const supportsFlexProcessing2 = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
4365
4375
  const supportsPriorityProcessing2 = 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");
4366
4376
  const defaults = {
4367
- requiredAutoTruncation: false,
4368
4377
  systemMessageMode: "system",
4369
4378
  supportsFlexProcessing: supportsFlexProcessing2,
4370
4379
  supportsPriorityProcessing: supportsPriorityProcessing2