@aigne/openai 0.16.16-beta.8 → 0.16.16
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-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-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 +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,253 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.16.16](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.25...openai-v0.16.16) (2026-01-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @aigne/core bumped to 1.72.0
|
|
11
|
+
* @aigne/platform-helpers bumped to 0.6.7
|
|
12
|
+
* devDependencies
|
|
13
|
+
* @aigne/test-utils bumped to 0.5.69
|
|
14
|
+
|
|
15
|
+
## [0.16.16-beta.25](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.24...openai-v0.16.16-beta.25) (2026-01-16)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add dynamic model options resolution with getter pattern ([#708](https://github.com/AIGNE-io/aigne-framework/issues/708)) ([5ed5085](https://github.com/AIGNE-io/aigne-framework/commit/5ed5085203763c70194853c56edc13acf56d81c6))
|
|
21
|
+
* add modalities support for chat model ([#454](https://github.com/AIGNE-io/aigne-framework/issues/454)) ([70d1bf6](https://github.com/AIGNE-io/aigne-framework/commit/70d1bf631f4e711235d89c6df8ee210a19179b30))
|
|
22
|
+
* 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))
|
|
23
|
+
* add reasoningEffort option for chat model ([#680](https://github.com/AIGNE-io/aigne-framework/issues/680)) ([f69d232](https://github.com/AIGNE-io/aigne-framework/commit/f69d232d714d4a3e4946bdc8c6598747c9bcbd57))
|
|
24
|
+
* **core:** add automatic JSON parsing and validation for structured outputs ([#548](https://github.com/AIGNE-io/aigne-framework/issues/548)) ([9077f93](https://github.com/AIGNE-io/aigne-framework/commit/9077f93856865915aaf5e8caa5638ef0b7f05b1e))
|
|
25
|
+
* **core:** add nested getter pattern support for model options ([#796](https://github.com/AIGNE-io/aigne-framework/issues/796)) ([824b2fe](https://github.com/AIGNE-io/aigne-framework/commit/824b2fe55cb2a24620e2bb73b470532918fa2996))
|
|
26
|
+
* improve image model architecture and file handling ([#527](https://github.com/AIGNE-io/aigne-framework/issues/527)) ([4db50aa](https://github.com/AIGNE-io/aigne-framework/commit/4db50aa0387a1a0f045ca11aaa61613e36ca7597))
|
|
27
|
+
* **model:** support video model ([#647](https://github.com/AIGNE-io/aigne-framework/issues/647)) ([de81742](https://github.com/AIGNE-io/aigne-framework/commit/de817421ef1dd3246d0d8c51ff12f0a855658f9f))
|
|
28
|
+
* support custom prefer input file type ([#469](https://github.com/AIGNE-io/aigne-framework/issues/469)) ([db0161b](https://github.com/AIGNE-io/aigne-framework/commit/db0161bbac52542c771ee2f40f361636b0668075))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* add prefer input file type option for image model ([#536](https://github.com/AIGNE-io/aigne-framework/issues/536)) ([3cba8a5](https://github.com/AIGNE-io/aigne-framework/commit/3cba8a5562233a1567b49b6dd5c446c0760f5c4c))
|
|
34
|
+
* add taskTitle to observability traces and fix GPT-5/o1 model parameters ([#700](https://github.com/AIGNE-io/aigne-framework/issues/700)) ([30b513b](https://github.com/AIGNE-io/aigne-framework/commit/30b513b46ab5edb58a37f29e566e311bbb389f44))
|
|
35
|
+
* bump version ([696560f](https://github.com/AIGNE-io/aigne-framework/commit/696560fa2673eddcb4d00ac0523fbbbde7273cb3))
|
|
36
|
+
* bump version ([70d217c](https://github.com/AIGNE-io/aigne-framework/commit/70d217c8360dd0dda7f5f17011c4e92ec836e801))
|
|
37
|
+
* bump version ([af04b69](https://github.com/AIGNE-io/aigne-framework/commit/af04b6931951afa35d52065430acc7fef4b10087))
|
|
38
|
+
* bump version ([ba7ad18](https://github.com/AIGNE-io/aigne-framework/commit/ba7ad184fcf32b49bf0507a3cb638d20fb00690d))
|
|
39
|
+
* bump version ([93a1c10](https://github.com/AIGNE-io/aigne-framework/commit/93a1c10cf35f88eaafe91092481f5d087bd5b3a9))
|
|
40
|
+
* **docs:** update video mode docs ([#695](https://github.com/AIGNE-io/aigne-framework/issues/695)) ([d691001](https://github.com/AIGNE-io/aigne-framework/commit/d69100169457c16c14f2f3e2f7fcd6b2a99330f3))
|
|
41
|
+
* improve image model parameters ([#530](https://github.com/AIGNE-io/aigne-framework/issues/530)) ([d66b5ca](https://github.com/AIGNE-io/aigne-framework/commit/d66b5ca01e14baad2712cc1a84930cdb63703232))
|
|
42
|
+
* 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))
|
|
43
|
+
* input schema of AI agent should includes input key and input file key ([#600](https://github.com/AIGNE-io/aigne-framework/issues/600)) ([b4ca076](https://github.com/AIGNE-io/aigne-framework/commit/b4ca076d6b4a1a1ecb8d4ebb008abd0d7561aadd))
|
|
44
|
+
* **models:** add image parameters support for video generation ([#684](https://github.com/AIGNE-io/aigne-framework/issues/684)) ([b048b7f](https://github.com/AIGNE-io/aigne-framework/commit/b048b7f92bd7a532dbdbeb6fb5fa5499bae6b953))
|
|
45
|
+
* **models:** add mineType for transform file ([#667](https://github.com/AIGNE-io/aigne-framework/issues/667)) ([155a173](https://github.com/AIGNE-io/aigne-framework/commit/155a173e75aff1dbe870a1305455a4300942e07a))
|
|
46
|
+
* **models:** aigne hub video params ([#665](https://github.com/AIGNE-io/aigne-framework/issues/665)) ([d00f836](https://github.com/AIGNE-io/aigne-framework/commit/d00f8368422d8e3707b974e1aff06714731ebb28))
|
|
47
|
+
* **model:** transform local file to base64 before request llm ([#462](https://github.com/AIGNE-io/aigne-framework/issues/462)) ([58ef5d7](https://github.com/AIGNE-io/aigne-framework/commit/58ef5d77046c49f3c4eed15b7f0cc283cbbcd74a))
|
|
48
|
+
* **model:** updated default video duration settings for AI video models ([#663](https://github.com/AIGNE-io/aigne-framework/issues/663)) ([1203941](https://github.com/AIGNE-io/aigne-framework/commit/12039411aaef77ba665e8edfb0fe6f8097c43e39))
|
|
49
|
+
* remove useless parameter ([efb0690](https://github.com/AIGNE-io/aigne-framework/commit/efb0690cf1ada6de95896e160c7cc5ffc7524ab2))
|
|
50
|
+
* standardize file parameter naming across models ([#534](https://github.com/AIGNE-io/aigne-framework/issues/534)) ([f159a9d](https://github.com/AIGNE-io/aigne-framework/commit/f159a9d6af21ec0e99641996b150560929845845))
|
|
51
|
+
* support optional field sturectured output for gemini ([#468](https://github.com/AIGNE-io/aigne-framework/issues/468)) ([70c6279](https://github.com/AIGNE-io/aigne-framework/commit/70c62795039a2862e3333f26707329489bf938de))
|
|
52
|
+
* update deps compatibility in CommonJS environment ([#580](https://github.com/AIGNE-io/aigne-framework/issues/580)) ([a1e35d0](https://github.com/AIGNE-io/aigne-framework/commit/a1e35d016405accb51c1aeb6a544503a1c78e912))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Dependencies
|
|
56
|
+
|
|
57
|
+
* The following workspace dependencies were updated
|
|
58
|
+
* dependencies
|
|
59
|
+
* @aigne/core bumped to 1.72.0-beta.25
|
|
60
|
+
* devDependencies
|
|
61
|
+
* @aigne/test-utils bumped to 0.5.69-beta.25
|
|
62
|
+
|
|
63
|
+
## [0.16.16-beta.24](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.16.16-beta.23...openai-v0.16.16-beta.24) (2026-01-16)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Dependencies
|
|
67
|
+
|
|
68
|
+
* The following workspace dependencies were updated
|
|
69
|
+
* dependencies
|
|
70
|
+
* @aigne/core bumped to 1.72.0-beta.24
|
|
71
|
+
* devDependencies
|
|
72
|
+
* @aigne/test-utils bumped to 0.5.69-beta.24
|
|
73
|
+
|
|
74
|
+
## [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)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Dependencies
|
|
78
|
+
|
|
79
|
+
* The following workspace dependencies were updated
|
|
80
|
+
* dependencies
|
|
81
|
+
* @aigne/core bumped to 1.72.0-beta.23
|
|
82
|
+
* devDependencies
|
|
83
|
+
* @aigne/test-utils bumped to 0.5.69-beta.23
|
|
84
|
+
|
|
85
|
+
## [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)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Dependencies
|
|
89
|
+
|
|
90
|
+
* The following workspace dependencies were updated
|
|
91
|
+
* dependencies
|
|
92
|
+
* @aigne/core bumped to 1.72.0-beta.22
|
|
93
|
+
* devDependencies
|
|
94
|
+
* @aigne/test-utils bumped to 0.5.69-beta.22
|
|
95
|
+
|
|
96
|
+
## [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)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Dependencies
|
|
100
|
+
|
|
101
|
+
* The following workspace dependencies were updated
|
|
102
|
+
* dependencies
|
|
103
|
+
* @aigne/core bumped to 1.72.0-beta.21
|
|
104
|
+
* devDependencies
|
|
105
|
+
* @aigne/test-utils bumped to 0.5.69-beta.21
|
|
106
|
+
|
|
107
|
+
## [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)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Dependencies
|
|
111
|
+
|
|
112
|
+
* The following workspace dependencies were updated
|
|
113
|
+
* dependencies
|
|
114
|
+
* @aigne/core bumped to 1.72.0-beta.20
|
|
115
|
+
* devDependencies
|
|
116
|
+
* @aigne/test-utils bumped to 0.5.69-beta.20
|
|
117
|
+
|
|
118
|
+
## [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)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### Bug Fixes
|
|
122
|
+
|
|
123
|
+
* 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))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Dependencies
|
|
127
|
+
|
|
128
|
+
* The following workspace dependencies were updated
|
|
129
|
+
* dependencies
|
|
130
|
+
* @aigne/core bumped to 1.72.0-beta.19
|
|
131
|
+
* @aigne/platform-helpers bumped to 0.6.7-beta.2
|
|
132
|
+
* devDependencies
|
|
133
|
+
* @aigne/test-utils bumped to 0.5.69-beta.19
|
|
134
|
+
|
|
135
|
+
## [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)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Dependencies
|
|
139
|
+
|
|
140
|
+
* The following workspace dependencies were updated
|
|
141
|
+
* dependencies
|
|
142
|
+
* @aigne/core bumped to 1.72.0-beta.18
|
|
143
|
+
* devDependencies
|
|
144
|
+
* @aigne/test-utils bumped to 0.5.69-beta.18
|
|
145
|
+
|
|
146
|
+
## [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)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Dependencies
|
|
150
|
+
|
|
151
|
+
* The following workspace dependencies were updated
|
|
152
|
+
* dependencies
|
|
153
|
+
* @aigne/core bumped to 1.72.0-beta.17
|
|
154
|
+
* devDependencies
|
|
155
|
+
* @aigne/test-utils bumped to 0.5.69-beta.17
|
|
156
|
+
|
|
157
|
+
## [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)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
### Dependencies
|
|
161
|
+
|
|
162
|
+
* The following workspace dependencies were updated
|
|
163
|
+
* dependencies
|
|
164
|
+
* @aigne/core bumped to 1.72.0-beta.16
|
|
165
|
+
* devDependencies
|
|
166
|
+
* @aigne/test-utils bumped to 0.5.69-beta.16
|
|
167
|
+
|
|
168
|
+
## [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)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
### Dependencies
|
|
172
|
+
|
|
173
|
+
* The following workspace dependencies were updated
|
|
174
|
+
* dependencies
|
|
175
|
+
* @aigne/core bumped to 1.72.0-beta.15
|
|
176
|
+
* devDependencies
|
|
177
|
+
* @aigne/test-utils bumped to 0.5.69-beta.15
|
|
178
|
+
|
|
179
|
+
## [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)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
### Dependencies
|
|
183
|
+
|
|
184
|
+
* The following workspace dependencies were updated
|
|
185
|
+
* dependencies
|
|
186
|
+
* @aigne/core bumped to 1.72.0-beta.14
|
|
187
|
+
* devDependencies
|
|
188
|
+
* @aigne/test-utils bumped to 0.5.69-beta.14
|
|
189
|
+
|
|
190
|
+
## [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)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
### Bug Fixes
|
|
194
|
+
|
|
195
|
+
* bump version ([696560f](https://github.com/AIGNE-io/aigne-framework/commit/696560fa2673eddcb4d00ac0523fbbbde7273cb3))
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
### Dependencies
|
|
199
|
+
|
|
200
|
+
* The following workspace dependencies were updated
|
|
201
|
+
* dependencies
|
|
202
|
+
* @aigne/core bumped to 1.72.0-beta.13
|
|
203
|
+
* @aigne/platform-helpers bumped to 0.6.7-beta.1
|
|
204
|
+
* devDependencies
|
|
205
|
+
* @aigne/test-utils bumped to 0.5.69-beta.13
|
|
206
|
+
|
|
207
|
+
## [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)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
### Dependencies
|
|
211
|
+
|
|
212
|
+
* The following workspace dependencies were updated
|
|
213
|
+
* dependencies
|
|
214
|
+
* @aigne/core bumped to 1.72.0-beta.12
|
|
215
|
+
* devDependencies
|
|
216
|
+
* @aigne/test-utils bumped to 0.5.69-beta.12
|
|
217
|
+
|
|
218
|
+
## [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)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
### Dependencies
|
|
222
|
+
|
|
223
|
+
* The following workspace dependencies were updated
|
|
224
|
+
* dependencies
|
|
225
|
+
* @aigne/core bumped to 1.72.0-beta.11
|
|
226
|
+
* devDependencies
|
|
227
|
+
* @aigne/test-utils bumped to 0.5.69-beta.11
|
|
228
|
+
|
|
229
|
+
## [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)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
### Dependencies
|
|
233
|
+
|
|
234
|
+
* The following workspace dependencies were updated
|
|
235
|
+
* dependencies
|
|
236
|
+
* @aigne/core bumped to 1.72.0-beta.10
|
|
237
|
+
* devDependencies
|
|
238
|
+
* @aigne/test-utils bumped to 0.5.69-beta.10
|
|
239
|
+
|
|
240
|
+
## [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)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
### Dependencies
|
|
244
|
+
|
|
245
|
+
* The following workspace dependencies were updated
|
|
246
|
+
* dependencies
|
|
247
|
+
* @aigne/core bumped to 1.72.0-beta.9
|
|
248
|
+
* devDependencies
|
|
249
|
+
* @aigne/test-utils bumped to 0.5.69-beta.9
|
|
250
|
+
|
|
3
251
|
## [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)
|
|
4
252
|
|
|
5
253
|
|
|
@@ -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
|
}
|
|
@@ -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
|
|
3
|
+
"version": "0.16.16",
|
|
4
4
|
"description": "AIGNE OpenAI SDK for integrating with OpenAI's GPT models and API services",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@aigne/uuid": "^13.0.1",
|
|
39
39
|
"openai": "^6.14.0",
|
|
40
40
|
"zod": "^3.25.67",
|
|
41
|
-
"@aigne/core": "^1.72.0
|
|
42
|
-
"@aigne/platform-helpers": "^0.6.7
|
|
41
|
+
"@aigne/core": "^1.72.0",
|
|
42
|
+
"@aigne/platform-helpers": "^0.6.7"
|
|
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
|
|
50
|
+
"@aigne/test-utils": "^0.5.69"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "tsc --noEmit",
|