@ai-sdk/openai 2.0.49 → 2.0.50

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
@@ -2185,7 +2185,7 @@ async function convertToOpenAIResponsesInput({
2185
2185
  store,
2186
2186
  hasLocalShellTool = false
2187
2187
  }) {
2188
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2188
+ var _a, _b, _c, _d;
2189
2189
  const input = [];
2190
2190
  const warnings = [];
2191
2191
  for (const { role, content } of prompt) {
@@ -2266,10 +2266,15 @@ async function convertToOpenAIResponsesInput({
2266
2266
  for (const part of content) {
2267
2267
  switch (part.type) {
2268
2268
  case "text": {
2269
+ const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId;
2270
+ if (store && id != null) {
2271
+ input.push({ type: "item_reference", id });
2272
+ break;
2273
+ }
2269
2274
  input.push({
2270
2275
  role: "assistant",
2271
2276
  content: [{ type: "output_text", text: part.text }],
2272
- id: (_c = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId) != null ? _c : void 0
2277
+ id
2273
2278
  });
2274
2279
  break;
2275
2280
  }
@@ -2278,6 +2283,11 @@ async function convertToOpenAIResponsesInput({
2278
2283
  if (part.providerExecuted) {
2279
2284
  break;
2280
2285
  }
2286
+ const id = (_d = (_c = part.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.itemId;
2287
+ if (store && id != null) {
2288
+ input.push({ type: "item_reference", id });
2289
+ break;
2290
+ }
2281
2291
  if (hasLocalShellTool && part.toolName === "local_shell") {
2282
2292
  const parsedInput = await validateTypes({
2283
2293
  value: part.input,
@@ -2286,7 +2296,7 @@ async function convertToOpenAIResponsesInput({
2286
2296
  input.push({
2287
2297
  type: "local_shell_call",
2288
2298
  call_id: part.toolCallId,
2289
- id: (_f = (_e = (_d = part.providerOptions) == null ? void 0 : _d.openai) == null ? void 0 : _e.itemId) != null ? _f : void 0,
2299
+ id,
2290
2300
  action: {
2291
2301
  type: "exec",
2292
2302
  command: parsedInput.action.command,
@@ -2303,7 +2313,7 @@ async function convertToOpenAIResponsesInput({
2303
2313
  call_id: part.toolCallId,
2304
2314
  name: part.toolName,
2305
2315
  arguments: JSON.stringify(part.input),
2306
- id: (_i = (_h = (_g = part.providerOptions) == null ? void 0 : _g.openai) == null ? void 0 : _h.itemId) != null ? _i : void 0
2316
+ id
2307
2317
  });
2308
2318
  break;
2309
2319
  }
@@ -4505,7 +4515,7 @@ var OpenAITranscriptionModel = class {
4505
4515
  };
4506
4516
 
4507
4517
  // src/version.ts
4508
- var VERSION = true ? "2.0.49" : "0.0.0-test";
4518
+ var VERSION = true ? "2.0.50" : "0.0.0-test";
4509
4519
 
4510
4520
  // src/openai-provider.ts
4511
4521
  function createOpenAI(options = {}) {