@ai-sdk/openai 3.0.113 → 3.0.115
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 +22 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +21 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +21 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/responses/convert-to-openai-responses-input.ts +28 -0
- package/src/responses/openai-responses-api.ts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.115",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ai-sdk/provider": "3.0.16",
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.52"
|
|
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
|
-
"@
|
|
48
|
-
"@ai-
|
|
47
|
+
"@ai-sdk/test-server": "1.0.6",
|
|
48
|
+
"@vercel/ai-tsconfig": "0.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -122,6 +122,34 @@ async function convertFunctionToolResultOutput({
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
case 'file-id': {
|
|
126
|
+
return {
|
|
127
|
+
type: 'input_file' as const,
|
|
128
|
+
file_id:
|
|
129
|
+
typeof item.fileId === 'string'
|
|
130
|
+
? item.fileId
|
|
131
|
+
: item.fileId[providerOptionsName],
|
|
132
|
+
...(promptCacheBreakpoint != null && {
|
|
133
|
+
prompt_cache_breakpoint: promptCacheBreakpoint,
|
|
134
|
+
}),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
case 'image-file-id': {
|
|
139
|
+
return {
|
|
140
|
+
type: 'input_image' as const,
|
|
141
|
+
file_id:
|
|
142
|
+
typeof item.fileId === 'string'
|
|
143
|
+
? item.fileId
|
|
144
|
+
: item.fileId[providerOptionsName],
|
|
145
|
+
detail:
|
|
146
|
+
item.providerOptions?.[providerOptionsName]?.imageDetail,
|
|
147
|
+
...(promptCacheBreakpoint != null && {
|
|
148
|
+
prompt_cache_breakpoint: promptCacheBreakpoint,
|
|
149
|
+
}),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
125
153
|
case 'file-data': {
|
|
126
154
|
return {
|
|
127
155
|
type: 'input_file' as const,
|
|
@@ -204,6 +204,11 @@ export type OpenAIResponsesFunctionCallOutput = {
|
|
|
204
204
|
image_url: string;
|
|
205
205
|
prompt_cache_breakpoint?: { mode: 'explicit' };
|
|
206
206
|
}
|
|
207
|
+
| {
|
|
208
|
+
type: 'input_image';
|
|
209
|
+
file_id: string;
|
|
210
|
+
prompt_cache_breakpoint?: { mode: 'explicit' };
|
|
211
|
+
}
|
|
207
212
|
| {
|
|
208
213
|
type: 'input_file';
|
|
209
214
|
filename: string;
|
|
@@ -215,6 +220,11 @@ export type OpenAIResponsesFunctionCallOutput = {
|
|
|
215
220
|
file_url: string;
|
|
216
221
|
prompt_cache_breakpoint?: { mode: 'explicit' };
|
|
217
222
|
}
|
|
223
|
+
| {
|
|
224
|
+
type: 'input_file';
|
|
225
|
+
file_id: string;
|
|
226
|
+
prompt_cache_breakpoint?: { mode: 'explicit' };
|
|
227
|
+
}
|
|
218
228
|
>;
|
|
219
229
|
};
|
|
220
230
|
|