@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.
@@ -41,6 +41,7 @@ function convertToOpenAIChatMessages({
41
41
  prompt,
42
42
  systemMessageMode = "system"
43
43
  }) {
44
+ var _a;
44
45
  const messages = [];
45
46
  const warnings = [];
46
47
  for (const { role, content } of prompt) {
@@ -79,7 +80,7 @@ function convertToOpenAIChatMessages({
79
80
  messages.push({
80
81
  role: "user",
81
82
  content: content.map((part, index) => {
82
- var _a, _b, _c;
83
+ var _a2, _b, _c;
83
84
  switch (part.type) {
84
85
  case "text": {
85
86
  return { type: "text", text: part.text };
@@ -92,7 +93,7 @@ function convertToOpenAIChatMessages({
92
93
  image_url: {
93
94
  url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`,
94
95
  // OpenAI specific extension: image detail
95
- detail: (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.imageDetail
96
+ detail: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.imageDetail
96
97
  }
97
98
  };
98
99
  } else if (part.mediaType.startsWith("audio/")) {
@@ -189,6 +190,9 @@ function convertToOpenAIChatMessages({
189
190
  case "error-text":
190
191
  contentValue = output.value;
191
192
  break;
193
+ case "execution-denied":
194
+ contentValue = (_a = output.reason) != null ? _a : "Tool execution denied.";
195
+ break;
192
196
  case "content":
193
197
  case "json":
194
198
  case "error-json":
@@ -1783,7 +1787,7 @@ var OpenAITranscriptionModel = class {
1783
1787
  constructor(modelId, config) {
1784
1788
  this.modelId = modelId;
1785
1789
  this.config = config;
1786
- this.specificationVersion = "v2";
1790
+ this.specificationVersion = "v3";
1787
1791
  }
1788
1792
  get provider() {
1789
1793
  return this.config.provider;
@@ -1928,7 +1932,7 @@ var OpenAISpeechModel = class {
1928
1932
  constructor(modelId, config) {
1929
1933
  this.modelId = modelId;
1930
1934
  this.config = config;
1931
- this.specificationVersion = "v2";
1935
+ this.specificationVersion = "v3";
1932
1936
  }
1933
1937
  get provider() {
1934
1938
  return this.config.provider;
@@ -2080,7 +2084,7 @@ async function convertToOpenAIResponsesInput({
2080
2084
  store,
2081
2085
  hasLocalShellTool = false
2082
2086
  }) {
2083
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2087
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2084
2088
  const input = [];
2085
2089
  const warnings = [];
2086
2090
  for (const { role, content } of prompt) {
@@ -2283,6 +2287,9 @@ async function convertToOpenAIResponsesInput({
2283
2287
  case "error-text":
2284
2288
  contentValue = output.value;
2285
2289
  break;
2290
+ case "execution-denied":
2291
+ contentValue = (_j = output.reason) != null ? _j : "Tool execution denied.";
2292
+ break;
2286
2293
  case "content":
2287
2294
  case "json":
2288
2295
  case "error-json":