@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
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResponseApi = exports.schemas = void 0;
|
|
4
|
+
exports.createApiClient = createApiClient;
|
|
5
|
+
const core_1 = require("@zodios/core");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const ResponseInputContent = zod_1.z
|
|
8
|
+
.object({ type: zod_1.z.literal('input_text'), text: zod_1.z.string() })
|
|
9
|
+
.strict()
|
|
10
|
+
.passthrough();
|
|
11
|
+
const ResponseInputMessage = zod_1.z
|
|
12
|
+
.object({
|
|
13
|
+
type: zod_1.z.literal('message'),
|
|
14
|
+
role: zod_1.z.enum(['developer', 'user', 'assistant']),
|
|
15
|
+
content: zod_1.z.array(ResponseInputContent),
|
|
16
|
+
})
|
|
17
|
+
.strict()
|
|
18
|
+
.passthrough();
|
|
19
|
+
const ResponseKnowledgeBase = zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
collections: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
22
|
+
filter: zod_1.z
|
|
23
|
+
.object({ file_ids: zod_1.z.array(zod_1.z.string().uuid()) })
|
|
24
|
+
.partial()
|
|
25
|
+
.strict()
|
|
26
|
+
.passthrough()
|
|
27
|
+
.optional(),
|
|
28
|
+
})
|
|
29
|
+
.strict()
|
|
30
|
+
.passthrough();
|
|
31
|
+
const CreateResponseRequest = zod_1.z
|
|
32
|
+
.object({
|
|
33
|
+
model: zod_1.z.literal('nimbus-001'),
|
|
34
|
+
input: zod_1.z.union([zod_1.z.string(), zod_1.z.array(ResponseInputMessage)]),
|
|
35
|
+
instructions: zod_1.z.string().optional(),
|
|
36
|
+
temperature: zod_1.z.number().gte(0).lte(2).optional().default(0.7),
|
|
37
|
+
knowledge_base: ResponseKnowledgeBase,
|
|
38
|
+
include: zod_1.z
|
|
39
|
+
.array(zod_1.z.literal('cloudglue_citations.media_descriptions'))
|
|
40
|
+
.optional(),
|
|
41
|
+
background: zod_1.z.boolean().optional().default(false),
|
|
42
|
+
})
|
|
43
|
+
.strict()
|
|
44
|
+
.passthrough();
|
|
45
|
+
const ResponseAnnotation = zod_1.z
|
|
46
|
+
.object({
|
|
47
|
+
type: zod_1.z.literal('cloudglue_citation'),
|
|
48
|
+
collection_id: zod_1.z.string().uuid(),
|
|
49
|
+
file_id: zod_1.z.string().uuid(),
|
|
50
|
+
segment_id: zod_1.z.string().uuid(),
|
|
51
|
+
start_time: zod_1.z.number(),
|
|
52
|
+
end_time: zod_1.z.number(),
|
|
53
|
+
context: zod_1.z.string(),
|
|
54
|
+
relevant_sources: zod_1.z.array(zod_1.z.string()),
|
|
55
|
+
visual_scene_description: zod_1.z.array(zod_1.z.string()),
|
|
56
|
+
scene_text: zod_1.z.array(zod_1.z.string()),
|
|
57
|
+
speech: zod_1.z.array(zod_1.z.string()),
|
|
58
|
+
audio_description: zod_1.z.array(zod_1.z.string()),
|
|
59
|
+
})
|
|
60
|
+
.partial()
|
|
61
|
+
.strict()
|
|
62
|
+
.passthrough();
|
|
63
|
+
const ResponseOutputContent = zod_1.z
|
|
64
|
+
.object({
|
|
65
|
+
type: zod_1.z.literal('output_text'),
|
|
66
|
+
text: zod_1.z.string(),
|
|
67
|
+
annotations: zod_1.z.array(ResponseAnnotation),
|
|
68
|
+
})
|
|
69
|
+
.partial()
|
|
70
|
+
.strict()
|
|
71
|
+
.passthrough();
|
|
72
|
+
const ResponseOutputMessage = zod_1.z
|
|
73
|
+
.object({
|
|
74
|
+
type: zod_1.z.literal('message'),
|
|
75
|
+
role: zod_1.z.literal('assistant'),
|
|
76
|
+
content: zod_1.z.array(ResponseOutputContent),
|
|
77
|
+
})
|
|
78
|
+
.partial()
|
|
79
|
+
.strict()
|
|
80
|
+
.passthrough();
|
|
81
|
+
const ResponseUsage = zod_1.z
|
|
82
|
+
.object({
|
|
83
|
+
input_tokens: zod_1.z.number().int(),
|
|
84
|
+
output_tokens: zod_1.z.number().int(),
|
|
85
|
+
total_tokens: zod_1.z.number().int(),
|
|
86
|
+
})
|
|
87
|
+
.partial()
|
|
88
|
+
.strict()
|
|
89
|
+
.passthrough();
|
|
90
|
+
const ResponseError = zod_1.z
|
|
91
|
+
.object({ message: zod_1.z.string(), type: zod_1.z.string(), code: zod_1.z.string() })
|
|
92
|
+
.partial()
|
|
93
|
+
.strict()
|
|
94
|
+
.passthrough();
|
|
95
|
+
const Response = zod_1.z
|
|
96
|
+
.object({
|
|
97
|
+
id: zod_1.z.string().uuid(),
|
|
98
|
+
object: zod_1.z.literal('response'),
|
|
99
|
+
status: zod_1.z.enum(['in_progress', 'completed', 'failed', 'cancelled']),
|
|
100
|
+
created_at: zod_1.z.number().int(),
|
|
101
|
+
model: zod_1.z.string(),
|
|
102
|
+
instructions: zod_1.z.string().nullable(),
|
|
103
|
+
output: zod_1.z.array(ResponseOutputMessage).nullable(),
|
|
104
|
+
usage: ResponseUsage,
|
|
105
|
+
error: ResponseError.nullable(),
|
|
106
|
+
})
|
|
107
|
+
.partial()
|
|
108
|
+
.strict()
|
|
109
|
+
.passthrough();
|
|
110
|
+
const ResponseListItem = zod_1.z
|
|
111
|
+
.object({
|
|
112
|
+
id: zod_1.z.string().uuid(),
|
|
113
|
+
object: zod_1.z.literal('response'),
|
|
114
|
+
status: zod_1.z.enum(['in_progress', 'completed', 'failed', 'cancelled']),
|
|
115
|
+
created_at: zod_1.z.number().int(),
|
|
116
|
+
model: zod_1.z.string(),
|
|
117
|
+
instructions: zod_1.z.string().nullable(),
|
|
118
|
+
usage: ResponseUsage,
|
|
119
|
+
})
|
|
120
|
+
.partial()
|
|
121
|
+
.strict()
|
|
122
|
+
.passthrough();
|
|
123
|
+
const ResponseList = zod_1.z
|
|
124
|
+
.object({
|
|
125
|
+
object: zod_1.z.literal('list'),
|
|
126
|
+
data: zod_1.z.array(ResponseListItem),
|
|
127
|
+
total: zod_1.z.number().int(),
|
|
128
|
+
limit: zod_1.z.number().int(),
|
|
129
|
+
offset: zod_1.z.number().int(),
|
|
130
|
+
})
|
|
131
|
+
.partial()
|
|
132
|
+
.strict()
|
|
133
|
+
.passthrough();
|
|
134
|
+
const DeleteResponseResult = zod_1.z
|
|
135
|
+
.object({
|
|
136
|
+
id: zod_1.z.string().uuid(),
|
|
137
|
+
object: zod_1.z.literal('response'),
|
|
138
|
+
deleted: zod_1.z.literal(true),
|
|
139
|
+
})
|
|
140
|
+
.partial()
|
|
141
|
+
.strict()
|
|
142
|
+
.passthrough();
|
|
143
|
+
exports.schemas = {
|
|
144
|
+
ResponseInputContent,
|
|
145
|
+
ResponseInputMessage,
|
|
146
|
+
ResponseKnowledgeBase,
|
|
147
|
+
CreateResponseRequest,
|
|
148
|
+
ResponseAnnotation,
|
|
149
|
+
ResponseOutputContent,
|
|
150
|
+
ResponseOutputMessage,
|
|
151
|
+
ResponseUsage,
|
|
152
|
+
ResponseError,
|
|
153
|
+
Response,
|
|
154
|
+
ResponseListItem,
|
|
155
|
+
ResponseList,
|
|
156
|
+
DeleteResponseResult,
|
|
157
|
+
};
|
|
158
|
+
const endpoints = (0, core_1.makeApi)([
|
|
159
|
+
{
|
|
160
|
+
method: 'post',
|
|
161
|
+
path: '/responses',
|
|
162
|
+
alias: 'createResponse',
|
|
163
|
+
description: `Create a new response using the Response API. This endpoint provides an OpenAI Responses-compatible interface for chat completions with video collections.
|
|
164
|
+
|
|
165
|
+
The response can be processed synchronously (default) or asynchronously using the `background` parameter.`,
|
|
166
|
+
requestFormat: 'json',
|
|
167
|
+
parameters: [
|
|
168
|
+
{
|
|
169
|
+
name: 'body',
|
|
170
|
+
description: `Response creation parameters`,
|
|
171
|
+
type: 'Body',
|
|
172
|
+
schema: CreateResponseRequest,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
response: Response,
|
|
176
|
+
errors: [
|
|
177
|
+
{
|
|
178
|
+
status: 400,
|
|
179
|
+
description: `Invalid request parameters`,
|
|
180
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
status: 404,
|
|
184
|
+
description: `Collection not found`,
|
|
185
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
status: 500,
|
|
189
|
+
description: `An unexpected error occurred on the server`,
|
|
190
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
method: 'get',
|
|
196
|
+
path: '/responses',
|
|
197
|
+
alias: 'listResponses',
|
|
198
|
+
description: `List all responses with pagination and filtering options.`,
|
|
199
|
+
requestFormat: 'json',
|
|
200
|
+
parameters: [
|
|
201
|
+
{
|
|
202
|
+
name: 'limit',
|
|
203
|
+
type: 'Query',
|
|
204
|
+
schema: zod_1.z.number().int().gte(1).lte(100).optional().default(50),
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'offset',
|
|
208
|
+
type: 'Query',
|
|
209
|
+
schema: zod_1.z.number().int().gte(0).optional().default(0),
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'status',
|
|
213
|
+
type: 'Query',
|
|
214
|
+
schema: zod_1.z
|
|
215
|
+
.enum(['in_progress', 'completed', 'failed', 'cancelled'])
|
|
216
|
+
.optional(),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'created_before',
|
|
220
|
+
type: 'Query',
|
|
221
|
+
schema: zod_1.z.string().optional(),
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'created_after',
|
|
225
|
+
type: 'Query',
|
|
226
|
+
schema: zod_1.z.string().optional(),
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
response: ResponseList,
|
|
230
|
+
errors: [
|
|
231
|
+
{
|
|
232
|
+
status: 500,
|
|
233
|
+
description: `An unexpected error occurred on the server`,
|
|
234
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
method: 'get',
|
|
240
|
+
path: '/responses/:id',
|
|
241
|
+
alias: 'getResponse',
|
|
242
|
+
description: `Retrieve a specific response by its ID.`,
|
|
243
|
+
requestFormat: 'json',
|
|
244
|
+
parameters: [
|
|
245
|
+
{
|
|
246
|
+
name: 'id',
|
|
247
|
+
type: 'Path',
|
|
248
|
+
schema: zod_1.z.string().uuid(),
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
response: Response,
|
|
252
|
+
errors: [
|
|
253
|
+
{
|
|
254
|
+
status: 404,
|
|
255
|
+
description: `Response not found`,
|
|
256
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
status: 500,
|
|
260
|
+
description: `An unexpected error occurred on the server`,
|
|
261
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
method: 'delete',
|
|
267
|
+
path: '/responses/:id',
|
|
268
|
+
alias: 'deleteResponse',
|
|
269
|
+
description: `Delete a response by ID. This operation is idempotent - deleting a non-existent response returns success.`,
|
|
270
|
+
requestFormat: 'json',
|
|
271
|
+
parameters: [
|
|
272
|
+
{
|
|
273
|
+
name: 'id',
|
|
274
|
+
type: 'Path',
|
|
275
|
+
schema: zod_1.z.string().uuid(),
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
response: DeleteResponseResult,
|
|
279
|
+
errors: [
|
|
280
|
+
{
|
|
281
|
+
status: 500,
|
|
282
|
+
description: `An unexpected error occurred on the server`,
|
|
283
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
method: 'post',
|
|
289
|
+
path: '/responses/:id/cancel',
|
|
290
|
+
alias: 'cancelResponse',
|
|
291
|
+
description: `Cancel a background response that is in progress. If the response is already completed, failed, or cancelled, this returns the response as-is.`,
|
|
292
|
+
requestFormat: 'json',
|
|
293
|
+
parameters: [
|
|
294
|
+
{
|
|
295
|
+
name: 'id',
|
|
296
|
+
type: 'Path',
|
|
297
|
+
schema: zod_1.z.string().uuid(),
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
response: Response,
|
|
301
|
+
errors: [
|
|
302
|
+
{
|
|
303
|
+
status: 404,
|
|
304
|
+
description: `Response not found`,
|
|
305
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
status: 500,
|
|
309
|
+
description: `An unexpected error occurred on the server`,
|
|
310
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
]);
|
|
315
|
+
exports.ResponseApi = new core_1.Zodios('https://api.cloudglue.dev/v1', endpoints);
|
|
316
|
+
function createApiClient(baseUrl, options) {
|
|
317
|
+
return new core_1.Zodios(baseUrl, endpoints, options);
|
|
318
|
+
}
|
package/dist/generated/Search.js
CHANGED
|
@@ -27,7 +27,7 @@ const SearchRequest = zod_1.z
|
|
|
27
27
|
threshold: zod_1.z.number(),
|
|
28
28
|
group_by_key: zod_1.z.literal('file'),
|
|
29
29
|
sort_by: zod_1.z.enum(['score', 'item_count']).default('score'),
|
|
30
|
-
search_modalities: SearchModalities,
|
|
30
|
+
search_modalities: SearchModalities.max(5),
|
|
31
31
|
label_filters: zod_1.z.array(zod_1.z.string()),
|
|
32
32
|
})
|
|
33
33
|
.partial()
|
|
@@ -44,7 +44,7 @@ const SearchResponseList = zod_1.z
|
|
|
44
44
|
scope: zod_1.z.enum(['file', 'segment', 'face']),
|
|
45
45
|
group_by_key: zod_1.z.literal('file').optional(),
|
|
46
46
|
group_count: zod_1.z.number().int().optional(),
|
|
47
|
-
search_modalities: SearchModalities.optional(),
|
|
47
|
+
search_modalities: SearchModalities.max(5).optional(),
|
|
48
48
|
total: zod_1.z.number().int(),
|
|
49
49
|
limit: zod_1.z.number().int(),
|
|
50
50
|
})
|
|
@@ -189,7 +189,7 @@ const SearchResponse = zod_1.z
|
|
|
189
189
|
scope: zod_1.z.enum(['file', 'segment', 'face']),
|
|
190
190
|
group_by_key: zod_1.z.literal('file').optional(),
|
|
191
191
|
group_count: zod_1.z.number().int().optional(),
|
|
192
|
-
search_modalities: SearchModalities.optional(),
|
|
192
|
+
search_modalities: SearchModalities.max(5).optional(),
|
|
193
193
|
results: zod_1.z.array(zod_1.z.union([
|
|
194
194
|
FileSearchResult,
|
|
195
195
|
SegmentSearchResult,
|