@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.
@@ -2207,7 +2207,7 @@ async function convertToOpenAIResponsesInput({
2207
2207
  store,
2208
2208
  hasLocalShellTool = false
2209
2209
  }) {
2210
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2210
+ var _a, _b, _c, _d;
2211
2211
  const input = [];
2212
2212
  const warnings = [];
2213
2213
  for (const { role, content } of prompt) {
@@ -2288,10 +2288,15 @@ async function convertToOpenAIResponsesInput({
2288
2288
  for (const part of content) {
2289
2289
  switch (part.type) {
2290
2290
  case "text": {
2291
+ const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId;
2292
+ if (store && id != null) {
2293
+ input.push({ type: "item_reference", id });
2294
+ break;
2295
+ }
2291
2296
  input.push({
2292
2297
  role: "assistant",
2293
2298
  content: [{ type: "output_text", text: part.text }],
2294
- id: (_c = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId) != null ? _c : void 0
2299
+ id
2295
2300
  });
2296
2301
  break;
2297
2302
  }
@@ -2300,6 +2305,11 @@ async function convertToOpenAIResponsesInput({
2300
2305
  if (part.providerExecuted) {
2301
2306
  break;
2302
2307
  }
2308
+ const id = (_d = (_c = part.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.itemId;
2309
+ if (store && id != null) {
2310
+ input.push({ type: "item_reference", id });
2311
+ break;
2312
+ }
2303
2313
  if (hasLocalShellTool && part.toolName === "local_shell") {
2304
2314
  const parsedInput = await validateTypes({
2305
2315
  value: part.input,
@@ -2308,7 +2318,7 @@ async function convertToOpenAIResponsesInput({
2308
2318
  input.push({
2309
2319
  type: "local_shell_call",
2310
2320
  call_id: part.toolCallId,
2311
- id: (_f = (_e = (_d = part.providerOptions) == null ? void 0 : _d.openai) == null ? void 0 : _e.itemId) != null ? _f : void 0,
2321
+ id,
2312
2322
  action: {
2313
2323
  type: "exec",
2314
2324
  command: parsedInput.action.command,
@@ -2325,7 +2335,7 @@ async function convertToOpenAIResponsesInput({
2325
2335
  call_id: part.toolCallId,
2326
2336
  name: part.toolName,
2327
2337
  arguments: JSON.stringify(part.input),
2328
- id: (_i = (_h = (_g = part.providerOptions) == null ? void 0 : _g.openai) == null ? void 0 : _h.itemId) != null ? _i : void 0
2338
+ id
2329
2339
  });
2330
2340
  break;
2331
2341
  }