@ai-sdk/openai 3.0.131 → 3.0.132
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 +6 -0
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +88 -3
- package/dist/internal/index.d.ts +88 -3
- package/dist/internal/index.js +18 -7
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -7
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/internal/index.ts +1 -0
- package/src/responses/openai-responses-language-model.ts +1 -0
- package/src/responses/openai-responses-prepare-tools.ts +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.132",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "
|
|
40
|
-
"@ai-sdk/provider
|
|
39
|
+
"@ai-sdk/provider-utils": "4.0.62",
|
|
40
|
+
"@ai-sdk/provider": "3.0.19"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
44
44
|
"tsup": "^8",
|
|
45
45
|
"typescript": "5.8.3",
|
|
46
46
|
"zod": "3.25.76",
|
|
47
|
-
"@ai-
|
|
48
|
-
"@
|
|
47
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
48
|
+
"@ai-sdk/test-server": "1.0.6"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^3.25.76 || ^4.1.8"
|
package/src/internal/index.ts
CHANGED
|
@@ -16,5 +16,6 @@ export * from '../tool/apply-patch';
|
|
|
16
16
|
export * from '../tool/code-interpreter';
|
|
17
17
|
export * from '../tool/file-search';
|
|
18
18
|
export * from '../tool/image-generation';
|
|
19
|
+
export * from '../tool/tool-search';
|
|
19
20
|
export * from '../tool/web-search';
|
|
20
21
|
export * from '../tool/web-search-preview';
|
|
@@ -271,6 +271,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
|
|
|
271
271
|
toolNameMapping,
|
|
272
272
|
customProviderToolNames,
|
|
273
273
|
supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling,
|
|
274
|
+
providerOptionsName,
|
|
274
275
|
});
|
|
275
276
|
|
|
276
277
|
const configurationUpdateUnsupportedReason =
|
|
@@ -44,6 +44,7 @@ export async function prepareResponsesTools({
|
|
|
44
44
|
toolNameMapping,
|
|
45
45
|
customProviderToolNames,
|
|
46
46
|
supportsAsyncToolCalling = true,
|
|
47
|
+
providerOptionsName = 'openai',
|
|
47
48
|
}: {
|
|
48
49
|
tools: LanguageModelV3CallOptions['tools'];
|
|
49
50
|
toolChoice: LanguageModelV3CallOptions['toolChoice'] | undefined;
|
|
@@ -54,6 +55,7 @@ export async function prepareResponsesTools({
|
|
|
54
55
|
toolNameMapping?: ToolNameMapping;
|
|
55
56
|
customProviderToolNames?: Set<string>;
|
|
56
57
|
supportsAsyncToolCalling?: boolean;
|
|
58
|
+
providerOptionsName?: string;
|
|
57
59
|
}): Promise<{
|
|
58
60
|
tools?: Array<OpenAIResponsesTool>;
|
|
59
61
|
toolChoice?:
|
|
@@ -125,9 +127,8 @@ export async function prepareResponsesTools({
|
|
|
125
127
|
for (const tool of tools) {
|
|
126
128
|
switch (tool.type) {
|
|
127
129
|
case 'function': {
|
|
128
|
-
const openaiOptions = tool.providerOptions?.
|
|
129
|
-
|
|
|
130
|
-
| undefined;
|
|
130
|
+
const openaiOptions = (tool.providerOptions?.[providerOptionsName] ??
|
|
131
|
+
tool.providerOptions?.openai) as OpenAIToolOptions | undefined;
|
|
131
132
|
const openaiFunctionTool = prepareFunctionTool({
|
|
132
133
|
tool,
|
|
133
134
|
options: openaiOptions,
|