@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.
@@ -91,6 +91,9 @@ import {
91
91
  UnsupportedFunctionalityError
92
92
  } from "@ai-sdk/provider";
93
93
  import { convertToBase64 } from "@ai-sdk/provider-utils";
94
+ function serializeToolCallArguments(input) {
95
+ return JSON.stringify(input === void 0 ? {} : input);
96
+ }
94
97
  function convertToOpenAIChatMessages({
95
98
  prompt,
96
99
  systemMessageMode = "system"
@@ -221,7 +224,7 @@ function convertToOpenAIChatMessages({
221
224
  type: "function",
222
225
  function: {
223
226
  name: part.toolName,
224
- arguments: JSON.stringify(part.input)
227
+ arguments: serializeToolCallArguments(part.input)
225
228
  }
226
229
  });
227
230
  break;
@@ -2609,6 +2612,9 @@ var toolSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
2609
2612
  });
2610
2613
 
2611
2614
  // src/responses/convert-to-openai-responses-input.ts
2615
+ function serializeToolCallArguments2(input) {
2616
+ return JSON.stringify(input === void 0 ? {} : input);
2617
+ }
2612
2618
  function isFileId(data, prefixes) {
2613
2619
  if (!prefixes) return false;
2614
2620
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -2832,7 +2838,7 @@ async function convertToOpenAIResponsesInput({
2832
2838
  type: "function_call",
2833
2839
  call_id: part.toolCallId,
2834
2840
  name: resolvedToolName,
2835
- arguments: JSON.stringify(part.input),
2841
+ arguments: serializeToolCallArguments2(part.input),
2836
2842
  id
2837
2843
  });
2838
2844
  break;