@ai-sdk/openai 3.0.0-beta.26 → 3.0.0-beta.27

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.
@@ -2190,7 +2190,7 @@ async function convertToOpenAIResponsesInput({
2190
2190
  store,
2191
2191
  hasLocalShellTool = false
2192
2192
  }) {
2193
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2193
+ var _a, _b, _c, _d, _e;
2194
2194
  const input = [];
2195
2195
  const warnings = [];
2196
2196
  for (const { role, content } of prompt) {
@@ -2271,10 +2271,15 @@ async function convertToOpenAIResponsesInput({
2271
2271
  for (const part of content) {
2272
2272
  switch (part.type) {
2273
2273
  case "text": {
2274
+ const id = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId;
2275
+ if (store && id != null) {
2276
+ input.push({ type: "item_reference", id });
2277
+ break;
2278
+ }
2274
2279
  input.push({
2275
2280
  role: "assistant",
2276
2281
  content: [{ type: "output_text", text: part.text }],
2277
- id: (_c = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId) != null ? _c : void 0
2282
+ id
2278
2283
  });
2279
2284
  break;
2280
2285
  }
@@ -2283,6 +2288,11 @@ async function convertToOpenAIResponsesInput({
2283
2288
  if (part.providerExecuted) {
2284
2289
  break;
2285
2290
  }
2291
+ const id = (_d = (_c = part.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.itemId;
2292
+ if (store && id != null) {
2293
+ input.push({ type: "item_reference", id });
2294
+ break;
2295
+ }
2286
2296
  if (hasLocalShellTool && part.toolName === "local_shell") {
2287
2297
  const parsedInput = await validateTypes({
2288
2298
  value: part.input,
@@ -2291,7 +2301,7 @@ async function convertToOpenAIResponsesInput({
2291
2301
  input.push({
2292
2302
  type: "local_shell_call",
2293
2303
  call_id: part.toolCallId,
2294
- id: (_f = (_e = (_d = part.providerOptions) == null ? void 0 : _d.openai) == null ? void 0 : _e.itemId) != null ? _f : void 0,
2304
+ id,
2295
2305
  action: {
2296
2306
  type: "exec",
2297
2307
  command: parsedInput.action.command,
@@ -2308,7 +2318,7 @@ async function convertToOpenAIResponsesInput({
2308
2318
  call_id: part.toolCallId,
2309
2319
  name: part.toolName,
2310
2320
  arguments: JSON.stringify(part.input),
2311
- id: (_i = (_h = (_g = part.providerOptions) == null ? void 0 : _g.openai) == null ? void 0 : _h.itemId) != null ? _i : void 0
2321
+ id
2312
2322
  });
2313
2323
  break;
2314
2324
  }
@@ -2401,7 +2411,7 @@ async function convertToOpenAIResponsesInput({
2401
2411
  contentValue = output.value;
2402
2412
  break;
2403
2413
  case "execution-denied":
2404
- contentValue = (_j = output.reason) != null ? _j : "Tool execution denied.";
2414
+ contentValue = (_e = output.reason) != null ? _e : "Tool execution denied.";
2405
2415
  break;
2406
2416
  case "json":
2407
2417
  case "error-json":