@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.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +8 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/chat/convert-to-openai-chat-messages.ts +5 -1
- package/src/responses/convert-to-openai-responses-input.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.53",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "
|
|
40
|
-
"@ai-sdk/provider
|
|
39
|
+
"@ai-sdk/provider-utils": "4.0.23",
|
|
40
|
+
"@ai-sdk/provider": "3.0.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -6,6 +6,10 @@ import {
|
|
|
6
6
|
import { OpenAIChatPrompt } from './openai-chat-prompt';
|
|
7
7
|
import { convertToBase64 } from '@ai-sdk/provider-utils';
|
|
8
8
|
|
|
9
|
+
function serializeToolCallArguments(input: unknown): string {
|
|
10
|
+
return JSON.stringify(input === undefined ? {} : input);
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
export function convertToOpenAIChatMessages({
|
|
10
14
|
prompt,
|
|
11
15
|
systemMessageMode = 'system',
|
|
@@ -165,7 +169,7 @@ export function convertToOpenAIChatMessages({
|
|
|
165
169
|
type: 'function',
|
|
166
170
|
function: {
|
|
167
171
|
name: part.toolName,
|
|
168
|
-
arguments:
|
|
172
|
+
arguments: serializeToolCallArguments(part.input),
|
|
169
173
|
},
|
|
170
174
|
});
|
|
171
175
|
break;
|
|
@@ -33,6 +33,10 @@ import {
|
|
|
33
33
|
OpenAIResponsesReasoning,
|
|
34
34
|
} from './openai-responses-api';
|
|
35
35
|
|
|
36
|
+
function serializeToolCallArguments(input: unknown): string {
|
|
37
|
+
return JSON.stringify(input === undefined ? {} : input);
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
/**
|
|
37
41
|
* Check if a string is a file ID based on the given prefixes
|
|
38
42
|
* Returns false if prefixes is undefined (disables file ID detection)
|
|
@@ -334,7 +338,7 @@ export async function convertToOpenAIResponsesInput({
|
|
|
334
338
|
type: 'function_call',
|
|
335
339
|
call_id: part.toolCallId,
|
|
336
340
|
name: resolvedToolName,
|
|
337
|
-
arguments:
|
|
341
|
+
arguments: serializeToolCallArguments(part.input),
|
|
338
342
|
id,
|
|
339
343
|
});
|
|
340
344
|
break;
|