@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.js
CHANGED
|
@@ -2950,7 +2950,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2950
2950
|
break;
|
|
2951
2951
|
}
|
|
2952
2952
|
case "custom": {
|
|
2953
|
-
if (part.kind === "openai
|
|
2953
|
+
if (part.kind === "openai.compaction") {
|
|
2954
2954
|
const providerOpts = (_n = part.providerOptions) == null ? void 0 : _n[providerOptionsName];
|
|
2955
2955
|
const id = providerOpts == null ? void 0 : providerOpts.itemId;
|
|
2956
2956
|
if (hasConversation && id != null) {
|
|
@@ -3100,6 +3100,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
3100
3100
|
filename: (_a2 = item.filename) != null ? _a2 : "data",
|
|
3101
3101
|
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
3102
3102
|
};
|
|
3103
|
+
case "file-url":
|
|
3104
|
+
return {
|
|
3105
|
+
type: "input_file",
|
|
3106
|
+
file_url: item.url
|
|
3107
|
+
};
|
|
3103
3108
|
default:
|
|
3104
3109
|
warnings.push({
|
|
3105
3110
|
type: "other",
|
|
@@ -3158,6 +3163,12 @@ async function convertToOpenAIResponsesInput({
|
|
|
3158
3163
|
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
3159
3164
|
};
|
|
3160
3165
|
}
|
|
3166
|
+
case "file-url": {
|
|
3167
|
+
return {
|
|
3168
|
+
type: "input_file",
|
|
3169
|
+
file_url: item.url
|
|
3170
|
+
};
|
|
3171
|
+
}
|
|
3161
3172
|
default: {
|
|
3162
3173
|
warnings.push({
|
|
3163
3174
|
type: "other",
|
|
@@ -5626,7 +5637,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5626
5637
|
case "compaction": {
|
|
5627
5638
|
content.push({
|
|
5628
5639
|
type: "custom",
|
|
5629
|
-
kind: "openai
|
|
5640
|
+
kind: "openai.compaction",
|
|
5630
5641
|
providerMetadata: {
|
|
5631
5642
|
[providerOptionsName]: {
|
|
5632
5643
|
type: "compaction",
|
|
@@ -6269,7 +6280,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6269
6280
|
} else if (value.item.type === "compaction") {
|
|
6270
6281
|
controller.enqueue({
|
|
6271
6282
|
type: "custom",
|
|
6272
|
-
kind: "openai
|
|
6283
|
+
kind: "openai.compaction",
|
|
6273
6284
|
providerMetadata: {
|
|
6274
6285
|
[providerOptionsName]: {
|
|
6275
6286
|
type: "compaction",
|