@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.17",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "4.0.0-beta.
|
|
40
|
-
"@ai-sdk/provider-utils": "5.0.0-beta.
|
|
39
|
+
"@ai-sdk/provider": "4.0.0-beta.5",
|
|
40
|
+
"@ai-sdk/provider-utils": "5.0.0-beta.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -546,7 +546,7 @@ export async function convertToOpenAIResponsesInput({
|
|
|
546
546
|
}
|
|
547
547
|
|
|
548
548
|
case 'custom': {
|
|
549
|
-
if (part.kind === 'openai
|
|
549
|
+
if (part.kind === 'openai.compaction') {
|
|
550
550
|
const providerOpts =
|
|
551
551
|
part.providerOptions?.[providerOptionsName];
|
|
552
552
|
const id = providerOpts?.itemId as string | undefined;
|
|
@@ -740,6 +740,11 @@ export async function convertToOpenAIResponsesInput({
|
|
|
740
740
|
filename: item.filename ?? 'data',
|
|
741
741
|
file_data: `data:${item.mediaType};base64,${item.data}`,
|
|
742
742
|
};
|
|
743
|
+
case 'file-url':
|
|
744
|
+
return {
|
|
745
|
+
type: 'input_file' as const,
|
|
746
|
+
file_url: item.url,
|
|
747
|
+
};
|
|
743
748
|
default:
|
|
744
749
|
warnings.push({
|
|
745
750
|
type: 'other',
|
|
@@ -804,6 +809,13 @@ export async function convertToOpenAIResponsesInput({
|
|
|
804
809
|
};
|
|
805
810
|
}
|
|
806
811
|
|
|
812
|
+
case 'file-url': {
|
|
813
|
+
return {
|
|
814
|
+
type: 'input_file' as const,
|
|
815
|
+
file_url: item.url,
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
|
|
807
819
|
default: {
|
|
808
820
|
warnings.push({
|
|
809
821
|
type: 'other',
|
|
@@ -107,6 +107,7 @@ export type OpenAIResponsesFunctionCallOutput = {
|
|
|
107
107
|
| { type: 'input_text'; text: string }
|
|
108
108
|
| { type: 'input_image'; image_url: string }
|
|
109
109
|
| { type: 'input_file'; filename: string; file_data: string }
|
|
110
|
+
| { type: 'input_file'; file_url: string }
|
|
110
111
|
>;
|
|
111
112
|
};
|
|
112
113
|
|
|
@@ -996,7 +996,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV4 {
|
|
|
996
996
|
case 'compaction': {
|
|
997
997
|
content.push({
|
|
998
998
|
type: 'custom',
|
|
999
|
-
kind: 'openai
|
|
999
|
+
kind: 'openai.compaction',
|
|
1000
1000
|
providerMetadata: {
|
|
1001
1001
|
[providerOptionsName]: {
|
|
1002
1002
|
type: 'compaction',
|
|
@@ -1815,7 +1815,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV4 {
|
|
|
1815
1815
|
} else if (value.item.type === 'compaction') {
|
|
1816
1816
|
controller.enqueue({
|
|
1817
1817
|
type: 'custom',
|
|
1818
|
-
kind: 'openai
|
|
1818
|
+
kind: 'openai.compaction',
|
|
1819
1819
|
providerMetadata: {
|
|
1820
1820
|
[providerOptionsName]: {
|
|
1821
1821
|
type: 'compaction',
|