@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.
package/dist/index.mjs CHANGED
@@ -1906,7 +1906,7 @@ async function convertToOpenAIResponsesMessages({
1906
1906
  prompt,
1907
1907
  systemMessageMode
1908
1908
  }) {
1909
- var _a, _b;
1909
+ var _a, _b, _c, _d, _e;
1910
1910
  const messages = [];
1911
1911
  const warnings = [];
1912
1912
  for (const { role, content } of prompt) {
@@ -1941,7 +1941,7 @@ async function convertToOpenAIResponsesMessages({
1941
1941
  messages.push({
1942
1942
  role: "user",
1943
1943
  content: content.map((part, index) => {
1944
- var _a2, _b2, _c;
1944
+ var _a2, _b2, _c2;
1945
1945
  switch (part.type) {
1946
1946
  case "text": {
1947
1947
  return { type: "input_text", text: part.text };
@@ -1963,7 +1963,7 @@ async function convertToOpenAIResponsesMessages({
1963
1963
  }
1964
1964
  return {
1965
1965
  type: "input_file",
1966
- filename: (_c = part.filename) != null ? _c : `part-${index}.pdf`,
1966
+ filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
1967
1967
  file_data: `data:application/pdf;base64,${part.data}`
1968
1968
  };
1969
1969
  } else {
@@ -1996,7 +1996,8 @@ async function convertToOpenAIResponsesMessages({
1996
1996
  type: "function_call",
1997
1997
  call_id: part.toolCallId,
1998
1998
  name: part.toolName,
1999
- arguments: JSON.stringify(part.input)
1999
+ arguments: JSON.stringify(part.input),
2000
+ id: (_c = (_b = (_a = part.providerOptions) == null ? void 0 : _a.openai) == null ? void 0 : _b.itemId) != null ? _c : void 0
2000
2001
  });
2001
2002
  break;
2002
2003
  }
@@ -2013,7 +2014,7 @@ async function convertToOpenAIResponsesMessages({
2013
2014
  providerOptions: part.providerOptions,
2014
2015
  schema: openaiResponsesReasoningProviderOptionsSchema
2015
2016
  });
2016
- const reasoningId = (_a = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _a.id;
2017
+ const reasoningId = (_d = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _d.id;
2017
2018
  if (reasoningId != null) {
2018
2019
  const existingReasoningMessage = reasoningMessages[reasoningId];
2019
2020
  const summaryParts = [];
@@ -2029,7 +2030,7 @@ async function convertToOpenAIResponsesMessages({
2029
2030
  reasoningMessages[reasoningId] = {
2030
2031
  type: "reasoning",
2031
2032
  id: reasoningId,
2032
- encrypted_content: (_b = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _b.encryptedContent,
2033
+ encrypted_content: (_e = providerOptions == null ? void 0 : providerOptions.reasoning) == null ? void 0 : _e.encryptedContent,
2033
2034
  summary: summaryParts
2034
2035
  };
2035
2036
  messages.push(reasoningMessages[reasoningId]);
@@ -2396,7 +2397,8 @@ var OpenAIResponsesLanguageModel = class {
2396
2397
  type: z14.literal("function_call"),
2397
2398
  call_id: z14.string(),
2398
2399
  name: z14.string(),
2399
- arguments: z14.string()
2400
+ arguments: z14.string(),
2401
+ id: z14.string()
2400
2402
  }),
2401
2403
  z14.object({
2402
2404
  type: z14.literal("web_search_call"),
@@ -2485,7 +2487,12 @@ var OpenAIResponsesLanguageModel = class {
2485
2487
  type: "tool-call",
2486
2488
  toolCallId: part.call_id,
2487
2489
  toolName: part.name,
2488
- input: part.arguments
2490
+ input: part.arguments,
2491
+ providerMetadata: {
2492
+ openai: {
2493
+ itemId: part.id
2494
+ }
2495
+ }
2489
2496
  });
2490
2497
  break;
2491
2498
  }
@@ -2670,7 +2677,12 @@ var OpenAIResponsesLanguageModel = class {
2670
2677
  type: "tool-call",
2671
2678
  toolCallId: value.item.call_id,
2672
2679
  toolName: value.item.name,
2673
- input: value.item.arguments
2680
+ input: value.item.arguments,
2681
+ providerMetadata: {
2682
+ openai: {
2683
+ itemId: value.item.id
2684
+ }
2685
+ }
2674
2686
  });
2675
2687
  } else if (value.item.type === "web_search_call") {
2676
2688
  ongoingToolCalls[value.output_index] = void 0;