4
4
5
5
namespace WordPress \AiClient \Results \DTO ;
6
6
7
- use WordPress \AiClient \Files \Contracts \ FileInterface ;
7
+ use WordPress \AiClient \Files \DTO \ File ;
8
8
use WordPress \AiClient \Messages \DTO \Message ;
9
9
use WordPress \AiClient \Messages \Enums \MessagePartTypeEnum ;
10
10
use WordPress \AiClient \Results \Contracts \ResultInterface ;
@@ -154,10 +154,10 @@ public function toText(): string
154
154
*
155
155
* @since n.e.x.t
156
156
*
157
- * @return FileInterface The file.
157
+ * @return File The file.
158
158
* @throws \RuntimeException If no file content.
159
159
*/
160
- public function toFile (): FileInterface
160
+ public function toFile (): File
161
161
{
162
162
$ message = $ this ->candidates [0 ]->getMessage ();
163
163
foreach ($ message ->getParts () as $ part ) {
@@ -175,10 +175,10 @@ public function toFile(): FileInterface
175
175
*
176
176
* @since n.e.x.t
177
177
*
178
- * @return FileInterface The image file.
178
+ * @return File The image file.
179
179
* @throws \RuntimeException If no image content.
180
180
*/
181
- public function toImageFile (): FileInterface
181
+ public function toImageFile (): File
182
182
{
183
183
$ file = $ this ->toFile ();
184
184
@@ -196,10 +196,10 @@ public function toImageFile(): FileInterface
196
196
*
197
197
* @since n.e.x.t
198
198
*
199
- * @return FileInterface The audio file.
199
+ * @return File The audio file.
200
200
* @throws \RuntimeException If no audio content.
201
201
*/
202
- public function toAudioFile (): FileInterface
202
+ public function toAudioFile (): File
203
203
{
204
204
$ file = $ this ->toFile ();
205
205
@@ -217,10 +217,10 @@ public function toAudioFile(): FileInterface
217
217
*
218
218
* @since n.e.x.t
219
219
*
220
- * @return FileInterface The video file.
220
+ * @return File The video file.
221
221
* @throws \RuntimeException If no video content.
222
222
*/
223
- public function toVideoFile (): FileInterface
223
+ public function toVideoFile (): File
224
224
{
225
225
$ file = $ this ->toFile ();
226
226
@@ -273,7 +273,7 @@ public function toTexts(): array
273
273
*
274
274
* @since n.e.x.t
275
275
*
276
- * @return FileInterface [] Array of files.
276
+ * @return File [] Array of files.
277
277
*/
278
278
public function toFiles (): array
279
279
{
@@ -296,13 +296,13 @@ public function toFiles(): array
296
296
*
297
297
* @since n.e.x.t
298
298
*
299
- * @return FileInterface [] Array of image files.
299
+ * @return File [] Array of image files.
300
300
*/
301
301
public function toImageFiles (): array
302
302
{
303
303
return array_filter (
304
304
$ this ->toFiles (),
305
- fn (FileInterface $ file ) => $ file ->isImage ()
305
+ fn (File $ file ) => $ file ->isImage ()
306
306
);
307
307
}
308
308
@@ -311,13 +311,13 @@ public function toImageFiles(): array
311
311
*
312
312
* @since n.e.x.t
313
313
*
314
- * @return FileInterface [] Array of audio files.
314
+ * @return File [] Array of audio files.
315
315
*/
316
316
public function toAudioFiles (): array
317
317
{
318
318
return array_filter (
319
319
$ this ->toFiles (),
320
- fn (FileInterface $ file ) => $ file ->isAudio ()
320
+ fn (File $ file ) => $ file ->isAudio ()
321
321
);
322
322
}
323
323
@@ -326,13 +326,13 @@ public function toAudioFiles(): array
326
326
*
327
327
* @since n.e.x.t
328
328
*
329
- * @return FileInterface [] Array of video files.
329
+ * @return File [] Array of video files.
330
330
*/
331
331
public function toVideoFiles (): array
332
332
{
333
333
return array_filter (
334
334
$ this ->toFiles (),
335
- fn (FileInterface $ file ) => $ file ->isVideo ()
335
+ fn (File $ file ) => $ file ->isVideo ()
336
336
);
337
337
}
338
338
0 commit comments