@ai-sdk/openai 3.0.113 → 3.0.114
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 +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 +3 -3
- package/src/responses/convert-to-openai-responses-input.ts +28 -0
- package/src/responses/openai-responses-api.ts +10 -0
package/dist/internal/index.mjs
CHANGED
|
@@ -3140,7 +3140,7 @@ async function convertFunctionToolResultOutput({
|
|
|
3140
3140
|
return convertScalarOutput(JSON.stringify(output.value));
|
|
3141
3141
|
case "content":
|
|
3142
3142
|
return output.value.map((item) => {
|
|
3143
|
-
var _a3, _b, _c, _d, _e;
|
|
3143
|
+
var _a3, _b, _c, _d, _e, _f, _g;
|
|
3144
3144
|
const promptCacheBreakpoint2 = getPromptCacheBreakpoint2(
|
|
3145
3145
|
item.providerOptions,
|
|
3146
3146
|
providerOptionsName
|
|
@@ -3175,10 +3175,29 @@ async function convertFunctionToolResultOutput({
|
|
|
3175
3175
|
}
|
|
3176
3176
|
};
|
|
3177
3177
|
}
|
|
3178
|
+
case "file-id": {
|
|
3179
|
+
return {
|
|
3180
|
+
type: "input_file",
|
|
3181
|
+
file_id: typeof item.fileId === "string" ? item.fileId : item.fileId[providerOptionsName],
|
|
3182
|
+
...promptCacheBreakpoint2 != null && {
|
|
3183
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
}
|
|
3187
|
+
case "image-file-id": {
|
|
3188
|
+
return {
|
|
3189
|
+
type: "input_image",
|
|
3190
|
+
file_id: typeof item.fileId === "string" ? item.fileId : item.fileId[providerOptionsName],
|
|
3191
|
+
detail: (_f = (_e = item.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.imageDetail,
|
|
3192
|
+
...promptCacheBreakpoint2 != null && {
|
|
3193
|
+
prompt_cache_breakpoint: promptCacheBreakpoint2
|
|
3194
|
+
}
|
|
3195
|
+
};
|
|
3196
|
+
}
|
|
3178
3197
|
case "file-data": {
|
|
3179
3198
|
return {
|
|
3180
3199
|
type: "input_file",
|
|
3181
|
-
filename: (
|
|
3200
|
+
filename: (_g = item.filename) != null ? _g : "data",
|
|
3182
3201
|
file_data: `data:${item.mediaType};base64,${item.data}`,
|
|
3183
3202
|
...promptCacheBreakpoint2 != null && {
|
|
3184
3203
|
prompt_cache_breakpoint: promptCacheBreakpoint2
|