@ai-sdk/openai 3.0.51 → 3.0.53

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.
@@ -137,6 +137,9 @@ function convertOpenAIChatUsage(usage) {
137
137
  // src/chat/convert-to-openai-chat-messages.ts
138
138
  var import_provider = require("@ai-sdk/provider");
139
139
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
140
+ function serializeToolCallArguments(input) {
141
+ return JSON.stringify(input === void 0 ? {} : input);
142
+ }
140
143
  function convertToOpenAIChatMessages({
141
144
  prompt,
142
145
  systemMessageMode = "system"
@@ -267,7 +270,7 @@ function convertToOpenAIChatMessages({
267
270
  type: "function",
268
271
  function: {
269
272
  name: part.toolName,
270
- arguments: JSON.stringify(part.input)
273
+ arguments: serializeToolCallArguments(part.input)
271
274
  }
272
275
  });
273
276
  break;
@@ -2583,6 +2586,9 @@ var toolSearchToolFactory = (0, import_provider_utils22.createProviderToolFactor
2583
2586
  });
2584
2587
 
2585
2588
  // src/responses/convert-to-openai-responses-input.ts
2589
+ function serializeToolCallArguments2(input) {
2590
+ return JSON.stringify(input === void 0 ? {} : input);
2591
+ }
2586
2592
  function isFileId(data, prefixes) {
2587
2593
  if (!prefixes) return false;
2588
2594
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -2806,7 +2812,7 @@ async function convertToOpenAIResponsesInput({
2806
2812
  type: "function_call",
2807
2813
  call_id: part.toolCallId,
2808
2814
  name: resolvedToolName,
2809
- arguments: JSON.stringify(part.input),
2815
+ arguments: serializeToolCallArguments2(part.input),
2810
2816
  id
2811
2817
  });
2812
2818
  break;