@aviaryhq/cloudglue-js 0.5.9 → 0.6.0
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/dist/generated/Collections.d.ts +3 -1
- package/dist/generated/Collections.js +13 -11
- package/dist/generated/Describe.d.ts +7722 -43
- package/dist/generated/Describe.js +4 -64
- package/dist/generated/Files.d.ts +1097 -27
- package/dist/generated/Files.js +174 -0
- package/dist/generated/Response.d.ts +727 -0
- package/dist/generated/Response.js +318 -0
- package/dist/generated/Search.js +3 -3
- package/dist/generated/Segmentations.d.ts +6311 -933
- package/dist/generated/Segmentations.js +48 -0
- package/dist/generated/Segments.d.ts +4 -21
- package/dist/generated/Segments.js +8 -16
- package/dist/generated/common.d.ts +3745 -22
- package/dist/generated/common.js +86 -2
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +3 -1
- package/dist/src/api/describe.api.d.ts +1546 -109
- package/dist/src/api/files.api.d.ts +236 -3
- package/dist/src/api/files.api.js +27 -0
- package/dist/src/api/response.api.d.ts +269 -0
- package/dist/src/api/response.api.js +85 -0
- package/dist/src/api/segmentations.api.d.ts +896 -3
- package/dist/src/api/segmentations.api.js +13 -0
- package/dist/src/api/segments.api.d.ts +10 -28
- package/dist/src/client.d.ts +6 -0
- package/dist/src/client.js +6 -1
- package/dist/src/types.d.ts +42 -5
- package/package.json +1 -1
|
@@ -205,7 +205,7 @@ export declare class EnhancedFilesApi {
|
|
|
205
205
|
created_at: import("zod").ZodNumber;
|
|
206
206
|
file_id: import("zod").ZodString;
|
|
207
207
|
segmentation_config: import("zod").ZodObject<{
|
|
208
|
-
strategy: import("zod").ZodEnum<["uniform", "shot-detector", "manual"]>;
|
|
208
|
+
strategy: import("zod").ZodEnum<["uniform", "shot-detector", "manual", "narrative"]>;
|
|
209
209
|
uniform_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
210
210
|
window_seconds: import("zod").ZodNumber;
|
|
211
211
|
hop_seconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -266,6 +266,25 @@ export declare class EnhancedFilesApi {
|
|
|
266
266
|
end_time: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
267
267
|
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
268
268
|
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
269
|
+
narrative_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
270
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
271
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
272
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
273
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
274
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
275
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
276
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
277
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
278
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
279
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
280
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
281
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
282
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
283
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
284
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
285
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
286
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
287
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
269
288
|
keyframe_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
270
289
|
frames_per_segment: import("zod").ZodNumber;
|
|
271
290
|
max_width: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
@@ -279,7 +298,7 @@ export declare class EnhancedFilesApi {
|
|
|
279
298
|
start_time_seconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
280
299
|
end_time_seconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
281
300
|
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
282
|
-
strategy: import("zod").ZodEnum<["uniform", "shot-detector", "manual"]>;
|
|
301
|
+
strategy: import("zod").ZodEnum<["uniform", "shot-detector", "manual", "narrative"]>;
|
|
283
302
|
uniform_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
284
303
|
window_seconds: import("zod").ZodNumber;
|
|
285
304
|
hop_seconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -340,6 +359,25 @@ export declare class EnhancedFilesApi {
|
|
|
340
359
|
end_time: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
341
360
|
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
342
361
|
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
362
|
+
narrative_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
363
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
364
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
365
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
366
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
367
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
368
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
369
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
370
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
371
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
372
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
373
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
374
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
375
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
376
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
377
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
378
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
379
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
380
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
343
381
|
keyframe_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
344
382
|
frames_per_segment: import("zod").ZodNumber;
|
|
345
383
|
max_width: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
@@ -353,7 +391,7 @@ export declare class EnhancedFilesApi {
|
|
|
353
391
|
start_time_seconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
354
392
|
end_time_seconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
355
393
|
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
356
|
-
strategy: import("zod").ZodEnum<["uniform", "shot-detector", "manual"]>;
|
|
394
|
+
strategy: import("zod").ZodEnum<["uniform", "shot-detector", "manual", "narrative"]>;
|
|
357
395
|
uniform_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
358
396
|
window_seconds: import("zod").ZodNumber;
|
|
359
397
|
hop_seconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -414,6 +452,25 @@ export declare class EnhancedFilesApi {
|
|
|
414
452
|
end_time: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
415
453
|
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
416
454
|
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
455
|
+
narrative_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
456
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
457
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
458
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
459
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
460
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
461
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
462
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
463
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
464
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
465
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
466
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
467
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
468
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
469
|
+
strategy: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<["comprehensive", "balanced"]>>>;
|
|
470
|
+
number_of_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
471
|
+
min_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
472
|
+
max_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
473
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
417
474
|
keyframe_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
418
475
|
frames_per_segment: import("zod").ZodNumber;
|
|
419
476
|
max_width: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
@@ -436,6 +493,7 @@ export declare class EnhancedFilesApi {
|
|
|
436
493
|
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
437
494
|
total_segments: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
438
495
|
total_shots: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
496
|
+
total_chapters: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
439
497
|
data: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
440
498
|
object: import("zod").ZodLiteral<"list">;
|
|
441
499
|
segments: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -467,6 +525,22 @@ export declare class EnhancedFilesApi {
|
|
|
467
525
|
start_time: import("zod").ZodNumber;
|
|
468
526
|
end_time: import("zod").ZodNumber;
|
|
469
527
|
}, import("zod").ZodTypeAny, "passthrough">>, "many">>;
|
|
528
|
+
chapters: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
529
|
+
index: import("zod").ZodNumber;
|
|
530
|
+
start_time: import("zod").ZodNumber;
|
|
531
|
+
end_time: import("zod").ZodNumber;
|
|
532
|
+
description: import("zod").ZodString;
|
|
533
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
534
|
+
index: import("zod").ZodNumber;
|
|
535
|
+
start_time: import("zod").ZodNumber;
|
|
536
|
+
end_time: import("zod").ZodNumber;
|
|
537
|
+
description: import("zod").ZodString;
|
|
538
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
539
|
+
index: import("zod").ZodNumber;
|
|
540
|
+
start_time: import("zod").ZodNumber;
|
|
541
|
+
end_time: import("zod").ZodNumber;
|
|
542
|
+
description: import("zod").ZodString;
|
|
543
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">>;
|
|
470
544
|
total: import("zod").ZodNumber;
|
|
471
545
|
limit: import("zod").ZodNumber;
|
|
472
546
|
offset: import("zod").ZodNumber;
|
|
@@ -501,6 +575,22 @@ export declare class EnhancedFilesApi {
|
|
|
501
575
|
start_time: import("zod").ZodNumber;
|
|
502
576
|
end_time: import("zod").ZodNumber;
|
|
503
577
|
}, import("zod").ZodTypeAny, "passthrough">>, "many">>;
|
|
578
|
+
chapters: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
579
|
+
index: import("zod").ZodNumber;
|
|
580
|
+
start_time: import("zod").ZodNumber;
|
|
581
|
+
end_time: import("zod").ZodNumber;
|
|
582
|
+
description: import("zod").ZodString;
|
|
583
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
584
|
+
index: import("zod").ZodNumber;
|
|
585
|
+
start_time: import("zod").ZodNumber;
|
|
586
|
+
end_time: import("zod").ZodNumber;
|
|
587
|
+
description: import("zod").ZodString;
|
|
588
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
589
|
+
index: import("zod").ZodNumber;
|
|
590
|
+
start_time: import("zod").ZodNumber;
|
|
591
|
+
end_time: import("zod").ZodNumber;
|
|
592
|
+
description: import("zod").ZodString;
|
|
593
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">>;
|
|
504
594
|
total: import("zod").ZodNumber;
|
|
505
595
|
limit: import("zod").ZodNumber;
|
|
506
596
|
offset: import("zod").ZodNumber;
|
|
@@ -535,6 +625,22 @@ export declare class EnhancedFilesApi {
|
|
|
535
625
|
start_time: import("zod").ZodNumber;
|
|
536
626
|
end_time: import("zod").ZodNumber;
|
|
537
627
|
}, import("zod").ZodTypeAny, "passthrough">>, "many">>;
|
|
628
|
+
chapters: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
629
|
+
index: import("zod").ZodNumber;
|
|
630
|
+
start_time: import("zod").ZodNumber;
|
|
631
|
+
end_time: import("zod").ZodNumber;
|
|
632
|
+
description: import("zod").ZodString;
|
|
633
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
634
|
+
index: import("zod").ZodNumber;
|
|
635
|
+
start_time: import("zod").ZodNumber;
|
|
636
|
+
end_time: import("zod").ZodNumber;
|
|
637
|
+
description: import("zod").ZodString;
|
|
638
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
639
|
+
index: import("zod").ZodNumber;
|
|
640
|
+
start_time: import("zod").ZodNumber;
|
|
641
|
+
end_time: import("zod").ZodNumber;
|
|
642
|
+
description: import("zod").ZodString;
|
|
643
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">>;
|
|
538
644
|
total: import("zod").ZodNumber;
|
|
539
645
|
limit: import("zod").ZodNumber;
|
|
540
646
|
offset: import("zod").ZodNumber;
|
|
@@ -740,6 +846,133 @@ export declare class EnhancedFilesApi {
|
|
|
740
846
|
limit: number;
|
|
741
847
|
offset: number;
|
|
742
848
|
}>;
|
|
849
|
+
/**
|
|
850
|
+
* List all describe outputs for a specific file segment
|
|
851
|
+
* @param fileId - The ID of the file
|
|
852
|
+
* @param segmentId - The ID of the segment
|
|
853
|
+
* @param params - Optional parameters for filtering and pagination
|
|
854
|
+
* @returns List of describe outputs for the segment
|
|
855
|
+
*/
|
|
856
|
+
listFileSegmentDescribes(fileId: string, segmentId: string, params?: {
|
|
857
|
+
status?: string;
|
|
858
|
+
response_format?: 'json' | 'markdown';
|
|
859
|
+
include_data?: boolean;
|
|
860
|
+
limit?: number;
|
|
861
|
+
offset?: number;
|
|
862
|
+
}): Promise<{
|
|
863
|
+
object: "list";
|
|
864
|
+
data: Array<{
|
|
865
|
+
job_id: string;
|
|
866
|
+
segment_id: string;
|
|
867
|
+
status: "pending" | "processing" | "completed" | "failed" | "not_applicable";
|
|
868
|
+
describe_config: Partial<{
|
|
869
|
+
enable_summary: boolean;
|
|
870
|
+
enable_speech: boolean;
|
|
871
|
+
enable_visual_scene_description: boolean;
|
|
872
|
+
enable_scene_text: boolean;
|
|
873
|
+
enable_audio_description: boolean;
|
|
874
|
+
}>;
|
|
875
|
+
created_at: number;
|
|
876
|
+
completed_at?: number | undefined;
|
|
877
|
+
start_time: number;
|
|
878
|
+
end_time: number;
|
|
879
|
+
file_id: string;
|
|
880
|
+
segmentation_id?: string | undefined;
|
|
881
|
+
data?: (Partial<{
|
|
882
|
+
visual_scene_description: Array<{
|
|
883
|
+
text: string;
|
|
884
|
+
start_time: number;
|
|
885
|
+
end_time: number;
|
|
886
|
+
}>;
|
|
887
|
+
speech: Array<{
|
|
888
|
+
text: string;
|
|
889
|
+
start_time: number;
|
|
890
|
+
end_time: number;
|
|
891
|
+
speaker?: string | undefined;
|
|
892
|
+
}>;
|
|
893
|
+
scene_text: Array<{
|
|
894
|
+
text: string;
|
|
895
|
+
start_time: number;
|
|
896
|
+
end_time: number;
|
|
897
|
+
}>;
|
|
898
|
+
audio_description: Array<{
|
|
899
|
+
text: string;
|
|
900
|
+
start_time: number;
|
|
901
|
+
end_time: number;
|
|
902
|
+
}>;
|
|
903
|
+
title: string;
|
|
904
|
+
summary: string;
|
|
905
|
+
start_time: number;
|
|
906
|
+
end_time: number;
|
|
907
|
+
segment_id: string;
|
|
908
|
+
}> | {
|
|
909
|
+
content: string;
|
|
910
|
+
}) | undefined;
|
|
911
|
+
object: "segment_describe";
|
|
912
|
+
}>;
|
|
913
|
+
total: number;
|
|
914
|
+
limit: number;
|
|
915
|
+
offset: number;
|
|
916
|
+
}>;
|
|
917
|
+
/**
|
|
918
|
+
* Get a specific describe output for a file segment by job ID
|
|
919
|
+
* @param fileId - The ID of the file
|
|
920
|
+
* @param segmentId - The ID of the segment
|
|
921
|
+
* @param jobId - The ID of the describe job
|
|
922
|
+
* @param params - Optional parameters
|
|
923
|
+
* @returns The describe output for the segment
|
|
924
|
+
*/
|
|
925
|
+
getFileSegmentDescribe(fileId: string, segmentId: string, jobId: string, params?: {
|
|
926
|
+
response_format?: 'json' | 'markdown';
|
|
927
|
+
}): Promise<{
|
|
928
|
+
job_id: string;
|
|
929
|
+
segment_id: string;
|
|
930
|
+
status: "pending" | "processing" | "completed" | "failed" | "not_applicable";
|
|
931
|
+
describe_config: Partial<{
|
|
932
|
+
enable_summary: boolean;
|
|
933
|
+
enable_speech: boolean;
|
|
934
|
+
enable_visual_scene_description: boolean;
|
|
935
|
+
enable_scene_text: boolean;
|
|
936
|
+
enable_audio_description: boolean;
|
|
937
|
+
}>;
|
|
938
|
+
created_at: number;
|
|
939
|
+
completed_at?: number | undefined;
|
|
940
|
+
start_time: number;
|
|
941
|
+
end_time: number;
|
|
942
|
+
file_id: string;
|
|
943
|
+
segmentation_id?: string | undefined;
|
|
944
|
+
data?: (Partial<{
|
|
945
|
+
visual_scene_description: Array<{
|
|
946
|
+
text: string;
|
|
947
|
+
start_time: number;
|
|
948
|
+
end_time: number;
|
|
949
|
+
}>;
|
|
950
|
+
speech: Array<{
|
|
951
|
+
text: string;
|
|
952
|
+
start_time: number;
|
|
953
|
+
end_time: number;
|
|
954
|
+
speaker?: string | undefined;
|
|
955
|
+
}>;
|
|
956
|
+
scene_text: Array<{
|
|
957
|
+
text: string;
|
|
958
|
+
start_time: number;
|
|
959
|
+
end_time: number;
|
|
960
|
+
}>;
|
|
961
|
+
audio_description: Array<{
|
|
962
|
+
text: string;
|
|
963
|
+
start_time: number;
|
|
964
|
+
end_time: number;
|
|
965
|
+
}>;
|
|
966
|
+
title: string;
|
|
967
|
+
summary: string;
|
|
968
|
+
start_time: number;
|
|
969
|
+
end_time: number;
|
|
970
|
+
segment_id: string;
|
|
971
|
+
}> | {
|
|
972
|
+
content: string;
|
|
973
|
+
}) | undefined;
|
|
974
|
+
object: "segment_describe";
|
|
975
|
+
}>;
|
|
743
976
|
/**
|
|
744
977
|
* Waits for a file to finish processing by polling the getFile endpoint until the file
|
|
745
978
|
* reaches a terminal state (completed, failed, or not_applicable) or until maxAttempts is reached.
|
|
@@ -121,6 +121,33 @@ class EnhancedFilesApi {
|
|
|
121
121
|
queries: params,
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* List all describe outputs for a specific file segment
|
|
126
|
+
* @param fileId - The ID of the file
|
|
127
|
+
* @param segmentId - The ID of the segment
|
|
128
|
+
* @param params - Optional parameters for filtering and pagination
|
|
129
|
+
* @returns List of describe outputs for the segment
|
|
130
|
+
*/
|
|
131
|
+
async listFileSegmentDescribes(fileId, segmentId, params = {}) {
|
|
132
|
+
return this.api.listFileSegmentDescribes({
|
|
133
|
+
params: { file_id: fileId, segment_id: segmentId },
|
|
134
|
+
queries: params,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get a specific describe output for a file segment by job ID
|
|
139
|
+
* @param fileId - The ID of the file
|
|
140
|
+
* @param segmentId - The ID of the segment
|
|
141
|
+
* @param jobId - The ID of the describe job
|
|
142
|
+
* @param params - Optional parameters
|
|
143
|
+
* @returns The describe output for the segment
|
|
144
|
+
*/
|
|
145
|
+
async getFileSegmentDescribe(fileId, segmentId, jobId, params = {}) {
|
|
146
|
+
return this.api.getFileSegmentDescribe({
|
|
147
|
+
params: { file_id: fileId, segment_id: segmentId, job_id: jobId },
|
|
148
|
+
queries: params,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
124
151
|
/**
|
|
125
152
|
* Waits for a file to finish processing by polling the getFile endpoint until the file
|
|
126
153
|
* reaches a terminal state (completed, failed, or not_applicable) or until maxAttempts is reached.
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { ResponseApi } from '../../generated';
|
|
2
|
+
import { WaitForReadyOptions } from '../types';
|
|
3
|
+
type ResponseStatus = 'in_progress' | 'completed' | 'failed' | 'cancelled';
|
|
4
|
+
export interface CreateResponseParams {
|
|
5
|
+
/** The model to use for the response */
|
|
6
|
+
model: 'nimbus-001';
|
|
7
|
+
/** The input message(s) - can be a simple string or array of structured messages */
|
|
8
|
+
input: string | Array<{
|
|
9
|
+
type: 'message';
|
|
10
|
+
role: 'developer' | 'user' | 'assistant';
|
|
11
|
+
content: Array<{
|
|
12
|
+
type: 'input_text';
|
|
13
|
+
text: string;
|
|
14
|
+
}>;
|
|
15
|
+
}>;
|
|
16
|
+
/** Optional system instructions */
|
|
17
|
+
instructions?: string;
|
|
18
|
+
/** Temperature for response generation (0-2, default 0.7) */
|
|
19
|
+
temperature?: number;
|
|
20
|
+
/** Knowledge base configuration specifying collections to search */
|
|
21
|
+
knowledge_base: {
|
|
22
|
+
collections: string[];
|
|
23
|
+
filter?: {
|
|
24
|
+
file_ids?: string[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/** Include additional data in response annotations */
|
|
28
|
+
include?: Array<'cloudglue_citations.media_descriptions'>;
|
|
29
|
+
/** Run the response generation in background (async) */
|
|
30
|
+
background?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ListResponsesParams {
|
|
33
|
+
limit?: number;
|
|
34
|
+
offset?: number;
|
|
35
|
+
status?: ResponseStatus;
|
|
36
|
+
created_before?: string;
|
|
37
|
+
created_after?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare class EnhancedResponseApi {
|
|
40
|
+
private readonly api;
|
|
41
|
+
constructor(api: typeof ResponseApi);
|
|
42
|
+
/**
|
|
43
|
+
* Create a new response using the Response API.
|
|
44
|
+
* This provides an OpenAI Responses-compatible interface for chat completions with video collections.
|
|
45
|
+
*
|
|
46
|
+
* @param params - Response creation parameters
|
|
47
|
+
* @returns The created response
|
|
48
|
+
*/
|
|
49
|
+
createResponse(params: CreateResponseParams): Promise<Partial<{
|
|
50
|
+
id: string;
|
|
51
|
+
object: "response";
|
|
52
|
+
status: "in_progress" | "completed" | "failed" | "cancelled";
|
|
53
|
+
created_at: number;
|
|
54
|
+
model: string;
|
|
55
|
+
instructions: string | null;
|
|
56
|
+
output: Array<Partial<{
|
|
57
|
+
type: "message";
|
|
58
|
+
role: "assistant";
|
|
59
|
+
content: Array<Partial<{
|
|
60
|
+
type: "output_text";
|
|
61
|
+
text: string;
|
|
62
|
+
annotations: Array<Partial<{
|
|
63
|
+
type: "cloudglue_citation";
|
|
64
|
+
collection_id: string;
|
|
65
|
+
file_id: string;
|
|
66
|
+
segment_id: string;
|
|
67
|
+
start_time: number;
|
|
68
|
+
end_time: number;
|
|
69
|
+
context: string;
|
|
70
|
+
relevant_sources: Array<string>;
|
|
71
|
+
visual_scene_description: Array<string>;
|
|
72
|
+
scene_text: Array<string>;
|
|
73
|
+
speech: Array<string>;
|
|
74
|
+
audio_description: Array<string>;
|
|
75
|
+
}>>;
|
|
76
|
+
}>>;
|
|
77
|
+
}>> | null;
|
|
78
|
+
usage: Partial<{
|
|
79
|
+
input_tokens: number;
|
|
80
|
+
output_tokens: number;
|
|
81
|
+
total_tokens: number;
|
|
82
|
+
}>;
|
|
83
|
+
error: Partial<{
|
|
84
|
+
message: string;
|
|
85
|
+
type: string;
|
|
86
|
+
code: string;
|
|
87
|
+
}> | null;
|
|
88
|
+
}>>;
|
|
89
|
+
/**
|
|
90
|
+
* List all responses with pagination and filtering options.
|
|
91
|
+
*
|
|
92
|
+
* @param params - Optional pagination and filtering parameters
|
|
93
|
+
* @returns Paginated list of responses
|
|
94
|
+
*/
|
|
95
|
+
listResponses(params?: ListResponsesParams): Promise<Partial<{
|
|
96
|
+
object: "list";
|
|
97
|
+
data: Array<Partial<{
|
|
98
|
+
id: string;
|
|
99
|
+
object: "response";
|
|
100
|
+
status: "in_progress" | "completed" | "failed" | "cancelled";
|
|
101
|
+
created_at: number;
|
|
102
|
+
model: string;
|
|
103
|
+
instructions: string | null;
|
|
104
|
+
usage: Partial<{
|
|
105
|
+
input_tokens: number;
|
|
106
|
+
output_tokens: number;
|
|
107
|
+
total_tokens: number;
|
|
108
|
+
}>;
|
|
109
|
+
}>>;
|
|
110
|
+
total: number;
|
|
111
|
+
limit: number;
|
|
112
|
+
offset: number;
|
|
113
|
+
}>>;
|
|
114
|
+
/**
|
|
115
|
+
* Retrieve a specific response by its ID.
|
|
116
|
+
*
|
|
117
|
+
* @param responseId - The ID of the response to retrieve
|
|
118
|
+
* @returns The response object
|
|
119
|
+
*/
|
|
120
|
+
getResponse(responseId: string): Promise<Partial<{
|
|
121
|
+
id: string;
|
|
122
|
+
object: "response";
|
|
123
|
+
status: "in_progress" | "completed" | "failed" | "cancelled";
|
|
124
|
+
created_at: number;
|
|
125
|
+
model: string;
|
|
126
|
+
instructions: string | null;
|
|
127
|
+
output: Array<Partial<{
|
|
128
|
+
type: "message";
|
|
129
|
+
role: "assistant";
|
|
130
|
+
content: Array<Partial<{
|
|
131
|
+
type: "output_text";
|
|
132
|
+
text: string;
|
|
133
|
+
annotations: Array<Partial<{
|
|
134
|
+
type: "cloudglue_citation";
|
|
135
|
+
collection_id: string;
|
|
136
|
+
file_id: string;
|
|
137
|
+
segment_id: string;
|
|
138
|
+
start_time: number;
|
|
139
|
+
end_time: number;
|
|
140
|
+
context: string;
|
|
141
|
+
relevant_sources: Array<string>;
|
|
142
|
+
visual_scene_description: Array<string>;
|
|
143
|
+
scene_text: Array<string>;
|
|
144
|
+
speech: Array<string>;
|
|
145
|
+
audio_description: Array<string>;
|
|
146
|
+
}>>;
|
|
147
|
+
}>>;
|
|
148
|
+
}>> | null;
|
|
149
|
+
usage: Partial<{
|
|
150
|
+
input_tokens: number;
|
|
151
|
+
output_tokens: number;
|
|
152
|
+
total_tokens: number;
|
|
153
|
+
}>;
|
|
154
|
+
error: Partial<{
|
|
155
|
+
message: string;
|
|
156
|
+
type: string;
|
|
157
|
+
code: string;
|
|
158
|
+
}> | null;
|
|
159
|
+
}>>;
|
|
160
|
+
/**
|
|
161
|
+
* Delete a response by ID.
|
|
162
|
+
* This operation is idempotent - deleting a non-existent response returns success.
|
|
163
|
+
*
|
|
164
|
+
* @param responseId - The ID of the response to delete
|
|
165
|
+
* @returns Deletion confirmation
|
|
166
|
+
*/
|
|
167
|
+
deleteResponse(responseId: string): Promise<import("zod").objectOutputType<{
|
|
168
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
169
|
+
object: import("zod").ZodOptional<import("zod").ZodLiteral<"response">>;
|
|
170
|
+
deleted: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
|
|
171
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
172
|
+
/**
|
|
173
|
+
* Cancel a background response that is in progress.
|
|
174
|
+
* If the response is already completed, failed, or cancelled, this returns the response as-is.
|
|
175
|
+
*
|
|
176
|
+
* @param responseId - The ID of the response to cancel
|
|
177
|
+
* @returns The response object
|
|
178
|
+
*/
|
|
179
|
+
cancelResponse(responseId: string): Promise<Partial<{
|
|
180
|
+
id: string;
|
|
181
|
+
object: "response";
|
|
182
|
+
status: "in_progress" | "completed" | "failed" | "cancelled";
|
|
183
|
+
created_at: number;
|
|
184
|
+
model: string;
|
|
185
|
+
instructions: string | null;
|
|
186
|
+
output: Array<Partial<{
|
|
187
|
+
type: "message";
|
|
188
|
+
role: "assistant";
|
|
189
|
+
content: Array<Partial<{
|
|
190
|
+
type: "output_text";
|
|
191
|
+
text: string;
|
|
192
|
+
annotations: Array<Partial<{
|
|
193
|
+
type: "cloudglue_citation";
|
|
194
|
+
collection_id: string;
|
|
195
|
+
file_id: string;
|
|
196
|
+
segment_id: string;
|
|
197
|
+
start_time: number;
|
|
198
|
+
end_time: number;
|
|
199
|
+
context: string;
|
|
200
|
+
relevant_sources: Array<string>;
|
|
201
|
+
visual_scene_description: Array<string>;
|
|
202
|
+
scene_text: Array<string>;
|
|
203
|
+
speech: Array<string>;
|
|
204
|
+
audio_description: Array<string>;
|
|
205
|
+
}>>;
|
|
206
|
+
}>>;
|
|
207
|
+
}>> | null;
|
|
208
|
+
usage: Partial<{
|
|
209
|
+
input_tokens: number;
|
|
210
|
+
output_tokens: number;
|
|
211
|
+
total_tokens: number;
|
|
212
|
+
}>;
|
|
213
|
+
error: Partial<{
|
|
214
|
+
message: string;
|
|
215
|
+
type: string;
|
|
216
|
+
code: string;
|
|
217
|
+
}> | null;
|
|
218
|
+
}>>;
|
|
219
|
+
/**
|
|
220
|
+
* Waits for a background response to complete by polling until it reaches
|
|
221
|
+
* a terminal state (completed, failed, or cancelled) or until maxAttempts is reached.
|
|
222
|
+
*
|
|
223
|
+
* @param responseId - The ID of the response to wait for
|
|
224
|
+
* @param options - Optional configuration for polling behavior
|
|
225
|
+
* @returns The final response object
|
|
226
|
+
* @throws {CloudGlueError} If the response fails or maxAttempts is reached
|
|
227
|
+
*/
|
|
228
|
+
waitForReady(responseId: string, options?: WaitForReadyOptions): Promise<Partial<{
|
|
229
|
+
id: string;
|
|
230
|
+
object: "response";
|
|
231
|
+
status: "in_progress" | "completed" | "failed" | "cancelled";
|
|
232
|
+
created_at: number;
|
|
233
|
+
model: string;
|
|
234
|
+
instructions: string | null;
|
|
235
|
+
output: Array<Partial<{
|
|
236
|
+
type: "message";
|
|
237
|
+
role: "assistant";
|
|
238
|
+
content: Array<Partial<{
|
|
239
|
+
type: "output_text";
|
|
240
|
+
text: string;
|
|
241
|
+
annotations: Array<Partial<{
|
|
242
|
+
type: "cloudglue_citation";
|
|
243
|
+
collection_id: string;
|
|
244
|
+
file_id: string;
|
|
245
|
+
segment_id: string;
|
|
246
|
+
start_time: number;
|
|
247
|
+
end_time: number;
|
|
248
|
+
context: string;
|
|
249
|
+
relevant_sources: Array<string>;
|
|
250
|
+
visual_scene_description: Array<string>;
|
|
251
|
+
scene_text: Array<string>;
|
|
252
|
+
speech: Array<string>;
|
|
253
|
+
audio_description: Array<string>;
|
|
254
|
+
}>>;
|
|
255
|
+
}>>;
|
|
256
|
+
}>> | null;
|
|
257
|
+
usage: Partial<{
|
|
258
|
+
input_tokens: number;
|
|
259
|
+
output_tokens: number;
|
|
260
|
+
total_tokens: number;
|
|
261
|
+
}>;
|
|
262
|
+
error: Partial<{
|
|
263
|
+
message: string;
|
|
264
|
+
type: string;
|
|
265
|
+
code: string;
|
|
266
|
+
}> | null;
|
|
267
|
+
}>>;
|
|
268
|
+
}
|
|
269
|
+
export {};
|