@ai-sdk/openai 4.0.0-beta.15 → 4.0.0-beta.17
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 +15 -0
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +14 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/responses/convert-to-openai-responses-input.ts +13 -1
- package/src/responses/openai-responses-api.ts +1 -0
- package/src/responses/openai-responses-language-model.ts +2 -2
package/dist/internal/index.mjs
CHANGED
|
@@ -2978,7 +2978,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2978
2978
|
break;
|
|
2979
2979
|
}
|
|
2980
2980
|
case "custom": {
|
|
2981
|
-
if (part.kind === "openai
|
|
2981
|
+
if (part.kind === "openai.compaction") {
|
|
2982
2982
|
const providerOpts = (_n = part.providerOptions) == null ? void 0 : _n[providerOptionsName];
|
|
2983
2983
|
const id = providerOpts == null ? void 0 : providerOpts.itemId;
|
|
2984
2984
|
if (hasConversation && id != null) {
|
|
@@ -3128,6 +3128,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
3128
3128
|
filename: (_a2 = item.filename) != null ? _a2 : "data",
|
|
3129
3129
|
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
3130
3130
|
};
|
|
3131
|
+
case "file-url":
|
|
3132
|
+
return {
|
|
3133
|
+
type: "input_file",
|
|
3134
|
+
file_url: item.url
|
|
3135
|
+
};
|
|
3131
3136
|
default:
|
|
3132
3137
|
warnings.push({
|
|
3133
3138
|
type: "other",
|
|
@@ -3186,6 +3191,12 @@ async function convertToOpenAIResponsesInput({
|
|
|
3186
3191
|
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
3187
3192
|
};
|
|
3188
3193
|
}
|
|
3194
|
+
case "file-url": {
|
|
3195
|
+
return {
|
|
3196
|
+
type: "input_file",
|
|
3197
|
+
file_url: item.url
|
|
3198
|
+
};
|
|
3199
|
+
}
|
|
3189
3200
|
default: {
|
|
3190
3201
|
warnings.push({
|
|
3191
3202
|
type: "other",
|
|
@@ -5684,7 +5695,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5684
5695
|
case "compaction": {
|
|
5685
5696
|
content.push({
|
|
5686
5697
|
type: "custom",
|
|
5687
|
-
kind: "openai
|
|
5698
|
+
kind: "openai.compaction",
|
|
5688
5699
|
providerMetadata: {
|
|
5689
5700
|
[providerOptionsName]: {
|
|
5690
5701
|
type: "compaction",
|
|
@@ -6327,7 +6338,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6327
6338
|
} else if (value.item.type === "compaction") {
|
|
6328
6339
|
controller.enqueue({
|
|
6329
6340
|
type: "custom",
|
|
6330
|
-
kind: "openai
|
|
6341
|
+
kind: "openai.compaction",
|
|
6331
6342
|
providerMetadata: {
|
|
6332
6343
|
[providerOptionsName]: {
|
|
6333
6344
|
type: "compaction",
|