@ai-sdk/openai 2.0.0-beta.7 → 2.0.0-beta.8

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.
@@ -1988,7 +1988,7 @@ async function convertToOpenAIResponsesMessages({
1988
1988
  prompt,
1989
1989
  systemMessageMode
1990
1990
  }) {
1991
- var _a, _b;
1991
+ var _a, _b, _c, _d, _e;
1992
1992
  const messages = [];
1993
1993
  const warnings = [];
1994
1994
  for (const { role, content } of prompt) {
@@ -2023,7 +2023,7 @@ async function convertToOpenAIResponsesMessages({
2023
2023
  messages.push({
2024
2024
  role: "user",
2025
2025
  content: content.map((part, index) => {
2026
- var _a2, _b2, _c;
2026
+ var _a2, _b2, _c2;
2027
2027
  switch (part.type) {
2028
2028
  case "text": {
2029
2029
  return { type: "input_text", text: part.text };
@@ -2045,7 +2045,7 @@ async function convertToOpenAIResponsesMessages({
2045
2045
  }
2046
2046
  return {
2047
2047
  type: "input_file",
2048
- filename: (_c = part.filename) != null ? _c : `part-${index}.pdf`,
2048
+ filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
2049
2049
  file_data: `data:application/pdf;base64,${part.data}`
2050
2050
  };
2051
2051
  } else {
@@ -2078,7 +2078,8 @@ async function convertToOpenAIResponsesMessages({
2078
2078
  type: "function_call",
2079
2079
  call_id: part.toolCallId,
2080
2080
  name: part.toolName,
2081
- arguments: JSON.stringify(part.input)
2081
+ arguments: JSON.stringify(part.input),
2082
+ id: (_c = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId) != null ? _c : void 0
2082
2083
  });
2083
2084
  break;
2084
2085
  }
@@ -2095,7 +2096,7 @@ async function convertToOpenAIResponsesMessages({
2095
2096
  providerOptions: part.providerOptions,
2096
2097
  schema: openaiResponsesReasoningProviderOptionsSchema
2097
2098
  });
2098
- const reasoningId = (_a = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _a.id;
2099
+ const reasoningId = (_d = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _d.id;
2099
2100
  if (reasoningId != null) {
2100
2101
  const existingReasoningMessage = reasoningMessages[reasoningId];
2101
2102
  const summaryParts = [];
@@ -2111,7 +2112,7 @@ async function convertToOpenAIResponsesMessages({
2111
2112
  reasoningMessages[reasoningId] = {
2112
2113
  type: "reasoning",
2113
2114
  id: reasoningId,
2114
- encrypted_content: (_b = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _b.encryptedContent,
2115
+ encrypted_content: (_e = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _e.encryptedContent,
2115
2116
  summary: summaryParts
2116
2117
  };
2117
2118
  messages.push(reasoningMessages[reasoningId]);
@@ -2476,7 +2477,8 @@ var OpenAIResponsesLanguageModel = class {
2476
2477
  type: import_v415.z.literal("function_call"),
2477
2478
  call_id: import_v415.z.string(),
2478
2479
  name: import_v415.z.string(),
2479
- arguments: import_v415.z.string()
2480
+ arguments: import_v415.z.string(),
2481
+ id: import_v415.z.string()
2480
2482
  }),
2481
2483
  import_v415.z.object({
2482
2484
  type: import_v415.z.literal("web_search_call"),
@@ -2565,7 +2567,12 @@ var OpenAIResponsesLanguageModel = class {
2565
2567
  type: "tool-call",
2566
2568
  toolCallId: part.call_id,
2567
2569
  toolName: part.name,
2568
- input: part.arguments
2570
+ input: part.arguments,
2571
+ providerMetadata: {
2572
+ openai: {
2573
+ itemId: part.id
2574
+ }
2575
+ }
2569
2576
  });
2570
2577
  break;
2571
2578
  }
@@ -2750,7 +2757,12 @@ var OpenAIResponsesLanguageModel = class {
2750
2757
  type: "tool-call",
2751
2758
  toolCallId: value.item.call_id,
2752
2759
  toolName: value.item.name,
2753
- input: value.item.arguments
2760
+ input: value.item.arguments,
2761
+ providerMetadata: {
2762
+ openai: {
2763
+ itemId: value.item.id
2764
+ }
2765
+ }
2754
2766
  });
2755
2767
  } else if (value.item.type === "web_search_call") {
2756
2768
  ongoingToolCalls[value.output_index] = void 0;