@aigne/openai 0.16.16-beta.2 → 0.16.16-beta.23
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 +248 -0
- package/lib/cjs/openai-chat-model.js +10 -4
- package/lib/cjs/openai-image-model.d.ts +1 -1
- package/lib/cjs/openai-image-model.js +2 -2
- package/lib/cjs/openai-video-model.d.ts +1 -1
- package/lib/cjs/openai-video-model.js +2 -2
- package/lib/dts/openai-image-model.d.ts +1 -1
- package/lib/dts/openai-video-model.d.ts +1 -1
- package/lib/esm/openai-chat-model.js +10 -4
- package/lib/esm/openai-image-model.d.ts +1 -1
- package/lib/esm/openai-image-model.js +2 -2
- package/lib/esm/openai-video-model.d.ts +1 -1
- package/lib/esm/openai-video-model.js +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,253 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.16.16-beta.23](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.22...openai-v0.16.16-beta.23) (2026-01-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @aigne/core bumped to 1.72.0-beta.23
|
|
11
|
+
* devDependencies
|
|
12
|
+
* @aigne/test-utils bumped to 0.5.69-beta.23
|
|
13
|
+
|
|
14
|
+
## [0.16.16-beta.22](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.21...openai-v0.16.16-beta.22) (2026-01-15)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Dependencies
|
|
18
|
+
|
|
19
|
+
* The following workspace dependencies were updated
|
|
20
|
+
* dependencies
|
|
21
|
+
* @aigne/core bumped to 1.72.0-beta.22
|
|
22
|
+
* devDependencies
|
|
23
|
+
* @aigne/test-utils bumped to 0.5.69-beta.22
|
|
24
|
+
|
|
25
|
+
## [0.16.16-beta.21](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.20...openai-v0.16.16-beta.21) (2026-01-15)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* The following workspace dependencies were updated
|
|
31
|
+
* dependencies
|
|
32
|
+
* @aigne/core bumped to 1.72.0-beta.21
|
|
33
|
+
* devDependencies
|
|
34
|
+
* @aigne/test-utils bumped to 0.5.69-beta.21
|
|
35
|
+
|
|
36
|
+
## [0.16.16-beta.20](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.19...openai-v0.16.16-beta.20) (2026-01-15)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Dependencies
|
|
40
|
+
|
|
41
|
+
* The following workspace dependencies were updated
|
|
42
|
+
* dependencies
|
|
43
|
+
* @aigne/core bumped to 1.72.0-beta.20
|
|
44
|
+
* devDependencies
|
|
45
|
+
* @aigne/test-utils bumped to 0.5.69-beta.20
|
|
46
|
+
|
|
47
|
+
## [0.16.16-beta.19](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.18...openai-v0.16.16-beta.19) (2026-01-14)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* improve test coverage tracking and reporting ([#903](https://github.com/AIGNE-io/aigne-framework/issues/903)) ([031144e](https://github.com/AIGNE-io/aigne-framework/commit/031144e74f29e882cffe52ffda8f7a18c76ace7f))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Dependencies
|
|
56
|
+
|
|
57
|
+
* The following workspace dependencies were updated
|
|
58
|
+
* dependencies
|
|
59
|
+
* @aigne/core bumped to 1.72.0-beta.19
|
|
60
|
+
* @aigne/platform-helpers bumped to 0.6.7-beta.2
|
|
61
|
+
* devDependencies
|
|
62
|
+
* @aigne/test-utils bumped to 0.5.69-beta.19
|
|
63
|
+
|
|
64
|
+
## [0.16.16-beta.18](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.17...openai-v0.16.16-beta.18) (2026-01-13)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Dependencies
|
|
68
|
+
|
|
69
|
+
* The following workspace dependencies were updated
|
|
70
|
+
* dependencies
|
|
71
|
+
* @aigne/core bumped to 1.72.0-beta.18
|
|
72
|
+
* devDependencies
|
|
73
|
+
* @aigne/test-utils bumped to 0.5.69-beta.18
|
|
74
|
+
|
|
75
|
+
## [0.16.16-beta.17](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.16...openai-v0.16.16-beta.17) (2026-01-12)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Dependencies
|
|
79
|
+
|
|
80
|
+
* The following workspace dependencies were updated
|
|
81
|
+
* dependencies
|
|
82
|
+
* @aigne/core bumped to 1.72.0-beta.17
|
|
83
|
+
* devDependencies
|
|
84
|
+
* @aigne/test-utils bumped to 0.5.69-beta.17
|
|
85
|
+
|
|
86
|
+
## [0.16.16-beta.16](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.15...openai-v0.16.16-beta.16) (2026-01-12)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Dependencies
|
|
90
|
+
|
|
91
|
+
* The following workspace dependencies were updated
|
|
92
|
+
* dependencies
|
|
93
|
+
* @aigne/core bumped to 1.72.0-beta.16
|
|
94
|
+
* devDependencies
|
|
95
|
+
* @aigne/test-utils bumped to 0.5.69-beta.16
|
|
96
|
+
|
|
97
|
+
## [0.16.16-beta.15](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.14...openai-v0.16.16-beta.15) (2026-01-10)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
### Dependencies
|
|
101
|
+
|
|
102
|
+
* The following workspace dependencies were updated
|
|
103
|
+
* dependencies
|
|
104
|
+
* @aigne/core bumped to 1.72.0-beta.15
|
|
105
|
+
* devDependencies
|
|
106
|
+
* @aigne/test-utils bumped to 0.5.69-beta.15
|
|
107
|
+
|
|
108
|
+
## [0.16.16-beta.14](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.13...openai-v0.16.16-beta.14) (2026-01-09)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### Dependencies
|
|
112
|
+
|
|
113
|
+
* The following workspace dependencies were updated
|
|
114
|
+
* dependencies
|
|
115
|
+
* @aigne/core bumped to 1.72.0-beta.14
|
|
116
|
+
* devDependencies
|
|
117
|
+
* @aigne/test-utils bumped to 0.5.69-beta.14
|
|
118
|
+
|
|
119
|
+
## [0.16.16-beta.13](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.12...openai-v0.16.16-beta.13) (2026-01-08)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Bug Fixes
|
|
123
|
+
|
|
124
|
+
* bump version ([696560f](https://github.com/AIGNE-io/aigne-framework/commit/696560fa2673eddcb4d00ac0523fbbbde7273cb3))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Dependencies
|
|
128
|
+
|
|
129
|
+
* The following workspace dependencies were updated
|
|
130
|
+
* dependencies
|
|
131
|
+
* @aigne/core bumped to 1.72.0-beta.13
|
|
132
|
+
* @aigne/platform-helpers bumped to 0.6.7-beta.1
|
|
133
|
+
* devDependencies
|
|
134
|
+
* @aigne/test-utils bumped to 0.5.69-beta.13
|
|
135
|
+
|
|
136
|
+
## [0.16.16-beta.12](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.11...openai-v0.16.16-beta.12) (2026-01-07)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Dependencies
|
|
140
|
+
|
|
141
|
+
* The following workspace dependencies were updated
|
|
142
|
+
* dependencies
|
|
143
|
+
* @aigne/core bumped to 1.72.0-beta.12
|
|
144
|
+
* devDependencies
|
|
145
|
+
* @aigne/test-utils bumped to 0.5.69-beta.12
|
|
146
|
+
|
|
147
|
+
## [0.16.16-beta.11](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.10...openai-v0.16.16-beta.11) (2026-01-06)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
### Dependencies
|
|
151
|
+
|
|
152
|
+
* The following workspace dependencies were updated
|
|
153
|
+
* dependencies
|
|
154
|
+
* @aigne/core bumped to 1.72.0-beta.11
|
|
155
|
+
* devDependencies
|
|
156
|
+
* @aigne/test-utils bumped to 0.5.69-beta.11
|
|
157
|
+
|
|
158
|
+
## [0.16.16-beta.10](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.9...openai-v0.16.16-beta.10) (2026-01-06)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Dependencies
|
|
162
|
+
|
|
163
|
+
* The following workspace dependencies were updated
|
|
164
|
+
* dependencies
|
|
165
|
+
* @aigne/core bumped to 1.72.0-beta.10
|
|
166
|
+
* devDependencies
|
|
167
|
+
* @aigne/test-utils bumped to 0.5.69-beta.10
|
|
168
|
+
|
|
169
|
+
## [0.16.16-beta.9](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.8...openai-v0.16.16-beta.9) (2026-01-02)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Dependencies
|
|
173
|
+
|
|
174
|
+
* The following workspace dependencies were updated
|
|
175
|
+
* dependencies
|
|
176
|
+
* @aigne/core bumped to 1.72.0-beta.9
|
|
177
|
+
* devDependencies
|
|
178
|
+
* @aigne/test-utils bumped to 0.5.69-beta.9
|
|
179
|
+
|
|
180
|
+
## [0.16.16-beta.8](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.7...openai-v0.16.16-beta.8) (2025-12-31)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### Dependencies
|
|
184
|
+
|
|
185
|
+
* The following workspace dependencies were updated
|
|
186
|
+
* dependencies
|
|
187
|
+
* @aigne/core bumped to 1.72.0-beta.8
|
|
188
|
+
* devDependencies
|
|
189
|
+
* @aigne/test-utils bumped to 0.5.69-beta.8
|
|
190
|
+
|
|
191
|
+
## [0.16.16-beta.7](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.6...openai-v0.16.16-beta.7) (2025-12-26)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Dependencies
|
|
195
|
+
|
|
196
|
+
* The following workspace dependencies were updated
|
|
197
|
+
* dependencies
|
|
198
|
+
* @aigne/core bumped to 1.72.0-beta.7
|
|
199
|
+
* devDependencies
|
|
200
|
+
* @aigne/test-utils bumped to 0.5.69-beta.7
|
|
201
|
+
|
|
202
|
+
## [0.16.16-beta.6](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.5...openai-v0.16.16-beta.6) (2025-12-25)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
### Dependencies
|
|
206
|
+
|
|
207
|
+
* The following workspace dependencies were updated
|
|
208
|
+
* dependencies
|
|
209
|
+
* @aigne/core bumped to 1.72.0-beta.6
|
|
210
|
+
* devDependencies
|
|
211
|
+
* @aigne/test-utils bumped to 0.5.69-beta.6
|
|
212
|
+
|
|
213
|
+
## [0.16.16-beta.5](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.4...openai-v0.16.16-beta.5) (2025-12-25)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
### Dependencies
|
|
217
|
+
|
|
218
|
+
* The following workspace dependencies were updated
|
|
219
|
+
* dependencies
|
|
220
|
+
* @aigne/core bumped to 1.72.0-beta.5
|
|
221
|
+
* devDependencies
|
|
222
|
+
* @aigne/test-utils bumped to 0.5.69-beta.5
|
|
223
|
+
|
|
224
|
+
## [0.16.16-beta.4](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.3...openai-v0.16.16-beta.4) (2025-12-24)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
### Dependencies
|
|
228
|
+
|
|
229
|
+
* The following workspace dependencies were updated
|
|
230
|
+
* dependencies
|
|
231
|
+
* @aigne/core bumped to 1.72.0-beta.4
|
|
232
|
+
* devDependencies
|
|
233
|
+
* @aigne/test-utils bumped to 0.5.69-beta.4
|
|
234
|
+
|
|
235
|
+
## [0.16.16-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.2...openai-v0.16.16-beta.3) (2025-12-19)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
### Features
|
|
239
|
+
|
|
240
|
+
* add prompt caching for OpenAI/Gemini/Anthropic and cache token display ([#838](https://github.com/AIGNE-io/aigne-framework/issues/838)) ([46c628f](https://github.com/AIGNE-io/aigne-framework/commit/46c628f180572ea1b955d1a9888aad6145204842))
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
### Dependencies
|
|
244
|
+
|
|
245
|
+
* The following workspace dependencies were updated
|
|
246
|
+
* dependencies
|
|
247
|
+
* @aigne/core bumped to 1.72.0-beta.3
|
|
248
|
+
* devDependencies
|
|
249
|
+
* @aigne/test-utils bumped to 0.5.69-beta.3
|
|
250
|
+
|
|
3
251
|
## [0.16.16-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.1...openai-v0.16.16-beta.2) (2025-12-19)
|
|
4
252
|
|
|
5
253
|
|
|
@@ -288,13 +288,19 @@ class OpenAIChatModel extends core_1.ChatModel {
|
|
|
288
288
|
refusal += delta.refusal;
|
|
289
289
|
}
|
|
290
290
|
if (chunk.usage) {
|
|
291
|
+
const usage = {
|
|
292
|
+
inputTokens: chunk.usage.prompt_tokens,
|
|
293
|
+
outputTokens: chunk.usage.completion_tokens,
|
|
294
|
+
};
|
|
295
|
+
// Parse cache statistics if available
|
|
296
|
+
const inputDetails = chunk.usage.prompt_tokens_details;
|
|
297
|
+
if (inputDetails?.cached_tokens) {
|
|
298
|
+
usage.cacheReadInputTokens = inputDetails.cached_tokens;
|
|
299
|
+
}
|
|
291
300
|
controller.enqueue({
|
|
292
301
|
delta: {
|
|
293
302
|
json: {
|
|
294
|
-
usage
|
|
295
|
-
inputTokens: chunk.usage.prompt_tokens,
|
|
296
|
-
outputTokens: chunk.usage.completion_tokens,
|
|
297
|
-
},
|
|
303
|
+
usage,
|
|
298
304
|
},
|
|
299
305
|
},
|
|
300
306
|
});
|
|
@@ -51,5 +51,5 @@ export declare class OpenAIImageModel extends ImageModel<OpenAIImageModelInput,
|
|
|
51
51
|
* @param input The input to process
|
|
52
52
|
* @returns The generated response
|
|
53
53
|
*/
|
|
54
|
-
process(input: OpenAIImageModelInput,
|
|
54
|
+
process(input: OpenAIImageModelInput, _options: AgentInvokeOptions): Promise<OpenAIImageModelOutput>;
|
|
55
55
|
}
|
|
@@ -74,7 +74,7 @@ class OpenAIImageModel extends core_1.ImageModel {
|
|
|
74
74
|
* @param input The input to process
|
|
75
75
|
* @returns The generated response
|
|
76
76
|
*/
|
|
77
|
-
async process(input,
|
|
77
|
+
async process(input, _options) {
|
|
78
78
|
const model = input.modelOptions?.model || this.credential.model;
|
|
79
79
|
if (input.image?.length && !SUPPORT_EDIT_MODELS.includes(model)) {
|
|
80
80
|
throw new Error(`Model ${model} does not support image editing`);
|
|
@@ -86,7 +86,7 @@ class OpenAIImageModel extends core_1.ImageModel {
|
|
|
86
86
|
const response = input.image?.length
|
|
87
87
|
? (await this.client.images.edit({
|
|
88
88
|
...body,
|
|
89
|
-
image: await Promise.all(input.image.map((image) => this.transformFileType("file", image
|
|
89
|
+
image: await Promise.all(input.image.map((image) => this.transformFileType("file", image).then((file) => new File([Buffer.from(file.data, "base64")], file.filename || "image.png", {
|
|
90
90
|
type: file.mimeType,
|
|
91
91
|
})))),
|
|
92
92
|
}, { stream: false }))
|
|
@@ -88,5 +88,5 @@ export declare class OpenAIVideoModel extends VideoModel<OpenAIVideoModelInput,
|
|
|
88
88
|
};
|
|
89
89
|
get modelOptions(): Omit<Partial<OpenAIVideoModelInput>, "model"> | undefined;
|
|
90
90
|
downloadToFile(videoId: string): Promise<string>;
|
|
91
|
-
process(input: OpenAIVideoModelInput,
|
|
91
|
+
process(input: OpenAIVideoModelInput, _options: AgentInvokeOptions): Promise<OpenAIVideoModelOutput>;
|
|
92
92
|
}
|
|
@@ -66,7 +66,7 @@ class OpenAIVideoModel extends core_1.VideoModel {
|
|
|
66
66
|
const buffer = Buffer.from(arrayBuffer);
|
|
67
67
|
return buffer.toString("base64");
|
|
68
68
|
}
|
|
69
|
-
async process(input,
|
|
69
|
+
async process(input, _options) {
|
|
70
70
|
const model = input.model ?? input.modelOptions?.model ?? this.credential.model;
|
|
71
71
|
const createParams = {
|
|
72
72
|
model: model,
|
|
@@ -77,7 +77,7 @@ class OpenAIVideoModel extends core_1.VideoModel {
|
|
|
77
77
|
if (input.size)
|
|
78
78
|
createParams.size = input.size;
|
|
79
79
|
if (input.image) {
|
|
80
|
-
createParams.input_reference = await this.transformFileType("file", input.image
|
|
80
|
+
createParams.input_reference = await this.transformFileType("file", input.image).then((file) => new File([Buffer.from(file.data, "base64")], file.filename || "image.png", {
|
|
81
81
|
type: file.mimeType,
|
|
82
82
|
}));
|
|
83
83
|
}
|
|
@@ -51,5 +51,5 @@ export declare class OpenAIImageModel extends ImageModel<OpenAIImageModelInput,
|
|
|
51
51
|
* @param input The input to process
|
|
52
52
|
* @returns The generated response
|
|
53
53
|
*/
|
|
54
|
-
process(input: OpenAIImageModelInput,
|
|
54
|
+
process(input: OpenAIImageModelInput, _options: AgentInvokeOptions): Promise<OpenAIImageModelOutput>;
|
|
55
55
|
}
|
|
@@ -88,5 +88,5 @@ export declare class OpenAIVideoModel extends VideoModel<OpenAIVideoModelInput,
|
|
|
88
88
|
};
|
|
89
89
|
get modelOptions(): Omit<Partial<OpenAIVideoModelInput>, "model"> | undefined;
|
|
90
90
|
downloadToFile(videoId: string): Promise<string>;
|
|
91
|
-
process(input: OpenAIVideoModelInput,
|
|
91
|
+
process(input: OpenAIVideoModelInput, _options: AgentInvokeOptions): Promise<OpenAIVideoModelOutput>;
|
|
92
92
|
}
|
|
@@ -283,13 +283,19 @@ export class OpenAIChatModel extends ChatModel {
|
|
|
283
283
|
refusal += delta.refusal;
|
|
284
284
|
}
|
|
285
285
|
if (chunk.usage) {
|
|
286
|
+
const usage = {
|
|
287
|
+
inputTokens: chunk.usage.prompt_tokens,
|
|
288
|
+
outputTokens: chunk.usage.completion_tokens,
|
|
289
|
+
};
|
|
290
|
+
// Parse cache statistics if available
|
|
291
|
+
const inputDetails = chunk.usage.prompt_tokens_details;
|
|
292
|
+
if (inputDetails?.cached_tokens) {
|
|
293
|
+
usage.cacheReadInputTokens = inputDetails.cached_tokens;
|
|
294
|
+
}
|
|
286
295
|
controller.enqueue({
|
|
287
296
|
delta: {
|
|
288
297
|
json: {
|
|
289
|
-
usage
|
|
290
|
-
inputTokens: chunk.usage.prompt_tokens,
|
|
291
|
-
outputTokens: chunk.usage.completion_tokens,
|
|
292
|
-
},
|
|
298
|
+
usage,
|
|
293
299
|
},
|
|
294
300
|
},
|
|
295
301
|
});
|
|
@@ -51,5 +51,5 @@ export declare class OpenAIImageModel extends ImageModel<OpenAIImageModelInput,
|
|
|
51
51
|
* @param input The input to process
|
|
52
52
|
* @returns The generated response
|
|
53
53
|
*/
|
|
54
|
-
process(input: OpenAIImageModelInput,
|
|
54
|
+
process(input: OpenAIImageModelInput, _options: AgentInvokeOptions): Promise<OpenAIImageModelOutput>;
|
|
55
55
|
}
|
|
@@ -71,7 +71,7 @@ export class OpenAIImageModel extends ImageModel {
|
|
|
71
71
|
* @param input The input to process
|
|
72
72
|
* @returns The generated response
|
|
73
73
|
*/
|
|
74
|
-
async process(input,
|
|
74
|
+
async process(input, _options) {
|
|
75
75
|
const model = input.modelOptions?.model || this.credential.model;
|
|
76
76
|
if (input.image?.length && !SUPPORT_EDIT_MODELS.includes(model)) {
|
|
77
77
|
throw new Error(`Model ${model} does not support image editing`);
|
|
@@ -83,7 +83,7 @@ export class OpenAIImageModel extends ImageModel {
|
|
|
83
83
|
const response = input.image?.length
|
|
84
84
|
? (await this.client.images.edit({
|
|
85
85
|
...body,
|
|
86
|
-
image: await Promise.all(input.image.map((image) => this.transformFileType("file", image
|
|
86
|
+
image: await Promise.all(input.image.map((image) => this.transformFileType("file", image).then((file) => new File([Buffer.from(file.data, "base64")], file.filename || "image.png", {
|
|
87
87
|
type: file.mimeType,
|
|
88
88
|
})))),
|
|
89
89
|
}, { stream: false }))
|
|
@@ -88,5 +88,5 @@ export declare class OpenAIVideoModel extends VideoModel<OpenAIVideoModelInput,
|
|
|
88
88
|
};
|
|
89
89
|
get modelOptions(): Omit<Partial<OpenAIVideoModelInput>, "model"> | undefined;
|
|
90
90
|
downloadToFile(videoId: string): Promise<string>;
|
|
91
|
-
process(input: OpenAIVideoModelInput,
|
|
91
|
+
process(input: OpenAIVideoModelInput, _options: AgentInvokeOptions): Promise<OpenAIVideoModelOutput>;
|
|
92
92
|
}
|
|
@@ -63,7 +63,7 @@ export class OpenAIVideoModel extends VideoModel {
|
|
|
63
63
|
const buffer = Buffer.from(arrayBuffer);
|
|
64
64
|
return buffer.toString("base64");
|
|
65
65
|
}
|
|
66
|
-
async process(input,
|
|
66
|
+
async process(input, _options) {
|
|
67
67
|
const model = input.model ?? input.modelOptions?.model ?? this.credential.model;
|
|
68
68
|
const createParams = {
|
|
69
69
|
model: model,
|
|
@@ -74,7 +74,7 @@ export class OpenAIVideoModel extends VideoModel {
|
|
|
74
74
|
if (input.size)
|
|
75
75
|
createParams.size = input.size;
|
|
76
76
|
if (input.image) {
|
|
77
|
-
createParams.input_reference = await this.transformFileType("file", input.image
|
|
77
|
+
createParams.input_reference = await this.transformFileType("file", input.image).then((file) => new File([Buffer.from(file.data, "base64")], file.filename || "image.png", {
|
|
78
78
|
type: file.mimeType,
|
|
79
79
|
}));
|
|
80
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/openai",
|
|
3
|
-
"version": "0.16.16-beta.
|
|
3
|
+
"version": "0.16.16-beta.23",
|
|
4
4
|
"description": "AIGNE OpenAI SDK for integrating with OpenAI's GPT models and API services",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@aigne/uuid": "^13.0.1",
|
|
39
|
-
"openai": "^6.
|
|
39
|
+
"openai": "^6.14.0",
|
|
40
40
|
"zod": "^3.25.67",
|
|
41
|
-
"@aigne/core": "^1.72.0-beta.
|
|
42
|
-
"@aigne/platform-helpers": "^0.6.7-beta"
|
|
41
|
+
"@aigne/core": "^1.72.0-beta.23",
|
|
42
|
+
"@aigne/platform-helpers": "^0.6.7-beta.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/bun": "^1.2.22",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"npm-run-all": "^4.1.5",
|
|
48
48
|
"rimraf": "^6.0.1",
|
|
49
49
|
"typescript": "^5.9.2",
|
|
50
|
-
"@aigne/test-utils": "^0.5.69-beta.
|
|
50
|
+
"@aigne/test-utils": "^0.5.69-beta.23"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "tsc --noEmit",
|