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

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":
@@ -2027,7 +2031,7 @@ async function convertToOpenAIResponsesInput({
2027
2031
  store,
2028
2032
  hasLocalShellTool = false
2029
2033
  }) {
2030
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2034
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2031
2035
  const input = [];
2032
2036
  const warnings = [];
2033
2037
  for (const { role, content } of prompt) {
@@ -2230,6 +2234,9 @@ async function convertToOpenAIResponsesInput({
2230
2234
  case "error-text":
2231
2235
  contentValue = output.value;
2232
2236
  break;
2237
+ case "execution-denied":
2238
+ contentValue = (_j = output.reason) != null ? _j : "Tool execution denied.";
2239
+ break;
2233
2240
  case "content":
2234
2241
  case "json":
2235
2242
  case "error-json":
@@ -3810,7 +3817,7 @@ var OpenAISpeechModel = class {
3810
3817
  constructor(modelId, config) {
3811
3818
  this.modelId = modelId;
3812
3819
  this.config = config;
3813
- this.specificationVersion = "v2";
3820
+ this.specificationVersion = "v3";
3814
3821
  }
3815
3822
  get provider() {
3816
3823
  return this.config.provider;
@@ -4008,7 +4015,7 @@ var OpenAITranscriptionModel = class {
4008
4015
  constructor(modelId, config) {
4009
4016
  this.modelId = modelId;
4010
4017
  this.config = config;
4011
- this.specificationVersion = "v2";
4018
+ this.specificationVersion = "v3";
4012
4019
  }
4013
4020
  get provider() {
4014
4021
  return this.config.provider;
@@ -4138,7 +4145,7 @@ var openaiTranscriptionResponseSchema = z19.object({
4138
4145
  });
4139
4146
 
4140
4147
  // src/version.ts
4141
- var VERSION = true ? "2.1.0-beta.11" : "0.0.0-test";
4148
+ var VERSION = true ? "2.1.0-beta.12" : "0.0.0-test";
4142
4149
 
4143
4150
  // src/openai-provider.ts
4144
4151
  function createOpenAI(options = {}) {