@ai-sdk/openai 2.1.0-beta.11 → 2.1.0-beta.13

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/dist/index.mjs CHANGED
@@ -49,6 +49,7 @@ function convertToOpenAIChatMessages({
49
49
  prompt,
50
50
  systemMessageMode = "system"
51
51
  }) {
52
+ var _a;
52
53
  const messages = [];
53
54
  const warnings = [];
54
55
  for (const { role, content } of prompt) {
@@ -87,7 +88,7 @@ function convertToOpenAIChatMessages({
87
88
  messages.push({
88
89
  role: "user",
89
90
  content: content.map((part, index) => {
90
- var _a, _b, _c;
91
+ var _a2, _b, _c;
91
92
  switch (part.type) {
92
93
  case "text": {
93
94
  return { type: "text", text: part.text };
@@ -100,7 +101,7 @@ function convertToOpenAIChatMessages({
100
101
  image_url: {
101
102
  url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`,
102
103
  // OpenAI specific extension: image detail
103
- detail: (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.imageDetail
104
+ detail: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.imageDetail
104
105
  }
105
106
  };
106
107
  } else if (part.mediaType.startsWith("audio/")) {
@@ -197,6 +198,9 @@ function convertToOpenAIChatMessages({
197
198
  case "error-text":
198
199
  contentValue = output.value;
199
200
  break;
201
+ case "execution-denied":
202
+ contentValue = (_a = output.reason) != null ? _a : "Tool execution denied.";
203
+ break;
200
204
  case "content":
201
205
  case "json":
202
206
  case "error-json":
@@ -1601,9 +1605,13 @@ import { z as z8 } from "zod/v4";
1601
1605
  var modelMaxImagesPerCall = {
1602
1606
  "dall-e-3": 1,
1603
1607
  "dall-e-2": 10,
1604
- "gpt-image-1": 10
1608
+ "gpt-image-1": 10,
1609
+ "gpt-image-1-mini": 10
1605
1610
  };
1606
- var hasDefaultResponseFormat = /* @__PURE__ */ new Set(["gpt-image-1"]);
1611
+ var hasDefaultResponseFormat = /* @__PURE__ */ new Set([
1612
+ "gpt-image-1",
1613
+ "gpt-image-1-mini"
1614
+ ]);
1607
1615
 
1608
1616
  // src/image/openai-image-model.ts
1609
1617
  var OpenAIImageModel = class {
@@ -2027,7 +2035,7 @@ async function convertToOpenAIResponsesInput({
2027
2035
  store,
2028
2036
  hasLocalShellTool = false
2029
2037
  }) {
2030
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2038
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2031
2039
  const input = [];
2032
2040
  const warnings = [];
2033
2041
  for (const { role, content } of prompt) {
@@ -2230,6 +2238,9 @@ async function convertToOpenAIResponsesInput({
2230
2238
  case "error-text":
2231
2239
  contentValue = output.value;
2232
2240
  break;
2241
+ case "execution-denied":
2242
+ contentValue = (_j = output.reason) != null ? _j : "Tool execution denied.";
2243
+ break;
2233
2244
  case "content":
2234
2245
  case "json":
2235
2246
  case "error-json":
@@ -3810,7 +3821,7 @@ var OpenAISpeechModel = class {
3810
3821
  constructor(modelId, config) {
3811
3822
  this.modelId = modelId;
3812
3823
  this.config = config;
3813
- this.specificationVersion = "v2";
3824
+ this.specificationVersion = "v3";
3814
3825
  }
3815
3826
  get provider() {
3816
3827
  return this.config.provider;
@@ -4008,7 +4019,7 @@ var OpenAITranscriptionModel = class {
4008
4019
  constructor(modelId, config) {
4009
4020
  this.modelId = modelId;
4010
4021
  this.config = config;
4011
- this.specificationVersion = "v2";
4022
+ this.specificationVersion = "v3";
4012
4023
  }
4013
4024
  get provider() {
4014
4025
  return this.config.provider;
@@ -4138,7 +4149,7 @@ var openaiTranscriptionResponseSchema = z19.object({
4138
4149
  });
4139
4150
 
4140
4151
  // src/version.ts
4141
- var VERSION = true ? "2.1.0-beta.11" : "0.0.0-test";
4152
+ var VERSION = true ? "2.1.0-beta.13" : "0.0.0-test";
4142
4153
 
4143
4154
  // src/openai-provider.ts
4144
4155
  function createOpenAI(options = {}) {