@ai-sdk/openai 4.0.0-beta.31 → 4.0.0-beta.33
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/CHANGELOG.md +13 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +8 -2
- package/dist/internal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/chat/convert-to-openai-chat-messages.ts +5 -1
- package/src/responses/convert-to-openai-responses-input.ts +5 -1
package/dist/internal/index.js
CHANGED
|
@@ -99,6 +99,9 @@ import {
|
|
|
99
99
|
isProviderReference,
|
|
100
100
|
resolveProviderReference
|
|
101
101
|
} from "@ai-sdk/provider-utils";
|
|
102
|
+
function serializeToolCallArguments(input) {
|
|
103
|
+
return JSON.stringify(input === void 0 ? {} : input);
|
|
104
|
+
}
|
|
102
105
|
function convertToOpenAIChatMessages({
|
|
103
106
|
prompt,
|
|
104
107
|
systemMessageMode = "system"
|
|
@@ -239,7 +242,7 @@ function convertToOpenAIChatMessages({
|
|
|
239
242
|
type: "function",
|
|
240
243
|
function: {
|
|
241
244
|
name: part.toolName,
|
|
242
|
-
arguments:
|
|
245
|
+
arguments: serializeToolCallArguments(part.input)
|
|
243
246
|
}
|
|
244
247
|
});
|
|
245
248
|
break;
|
|
@@ -2705,6 +2708,9 @@ var toolSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
|
|
|
2705
2708
|
});
|
|
2706
2709
|
|
|
2707
2710
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2711
|
+
function serializeToolCallArguments2(input) {
|
|
2712
|
+
return JSON.stringify(input === void 0 ? {} : input);
|
|
2713
|
+
}
|
|
2708
2714
|
function isFileId(data, prefixes) {
|
|
2709
2715
|
if (!prefixes) return false;
|
|
2710
2716
|
return prefixes.some((prefix) => data.startsWith(prefix));
|
|
@@ -2945,7 +2951,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2945
2951
|
type: "function_call",
|
|
2946
2952
|
call_id: part.toolCallId,
|
|
2947
2953
|
name: resolvedToolName,
|
|
2948
|
-
arguments:
|
|
2954
|
+
arguments: serializeToolCallArguments2(part.input),
|
|
2949
2955
|
id
|
|
2950
2956
|
});
|
|
2951
2957
|
break;
|