@credal/sdk 0.1.13 → 0.1.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/dist/cjs/BaseClient.d.ts +7 -7
- package/dist/cjs/BaseClient.js +7 -3
- package/dist/cjs/Client.d.ts +1 -2
- package/dist/cjs/api/resources/copilots/client/Client.d.ts +21 -2
- package/dist/cjs/api/resources/copilots/client/Client.js +62 -134
- package/dist/cjs/api/resources/copilots/client/requests/ExportCopilotsRequest.d.ts +21 -0
- package/dist/cjs/api/resources/copilots/client/requests/ExportCopilotsRequest.js +3 -0
- package/dist/cjs/api/resources/copilots/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/copilots/types/ExportCopilotsResponse.d.ts +9 -0
- package/dist/cjs/api/resources/copilots/types/ExportCopilotsResponse.js +3 -0
- package/dist/cjs/api/resources/copilots/types/ExportedCopilot.d.ts +24 -0
- package/dist/cjs/api/resources/copilots/types/ExportedCopilot.js +3 -0
- package/dist/cjs/api/resources/copilots/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/copilots/types/index.js +2 -0
- package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +5 -60
- package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/documentCollections/client/Client.js +8 -105
- package/dist/cjs/api/resources/search/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/search/client/Client.js +2 -15
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/users/client/Client.js +2 -15
- package/dist/cjs/auth/BearerAuthProvider.d.ts +4 -2
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +1 -0
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
- package/dist/cjs/core/fetcher/Fetcher.js +2 -1
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/signals.d.ts +1 -1
- package/dist/cjs/core/runtime/runtime.js +11 -10
- package/dist/cjs/errors/CredalError.js +5 -1
- package/dist/cjs/errors/CredalTimeoutError.js +5 -1
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +7 -7
- package/dist/esm/BaseClient.mjs +7 -3
- package/dist/esm/Client.d.mts +1 -2
- package/dist/esm/api/resources/copilots/client/Client.d.mts +21 -2
- package/dist/esm/api/resources/copilots/client/Client.mjs +62 -134
- package/dist/esm/api/resources/copilots/client/requests/ExportCopilotsRequest.d.mts +21 -0
- package/dist/esm/api/resources/copilots/client/requests/ExportCopilotsRequest.mjs +2 -0
- package/dist/esm/api/resources/copilots/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/copilots/types/ExportCopilotsResponse.d.mts +9 -0
- package/dist/esm/api/resources/copilots/types/ExportCopilotsResponse.mjs +2 -0
- package/dist/esm/api/resources/copilots/types/ExportedCopilot.d.mts +24 -0
- package/dist/esm/api/resources/copilots/types/ExportedCopilot.mjs +2 -0
- package/dist/esm/api/resources/copilots/types/index.d.mts +2 -0
- package/dist/esm/api/resources/copilots/types/index.mjs +2 -0
- package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +5 -60
- package/dist/esm/api/resources/documentCollections/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +8 -105
- package/dist/esm/api/resources/search/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/search/client/Client.mjs +2 -15
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/users/client/Client.mjs +2 -15
- package/dist/esm/auth/BearerAuthProvider.d.mts +4 -2
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +1 -0
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +2 -1
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/signals.d.mts +1 -1
- package/dist/esm/core/runtime/runtime.mjs +11 -10
- package/dist/esm/errors/CredalError.mjs +5 -1
- package/dist/esm/errors/CredalTimeoutError.mjs +5 -1
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +5 -2
- package/reference.md +72 -0
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs
|
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import type * as Credal from "../../../index.mjs";
|
|
5
5
|
export declare namespace CopilotsClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -147,4 +146,24 @@ export declare class CopilotsClient {
|
|
|
147
146
|
*/
|
|
148
147
|
deleteCopilot(request: Credal.DeleteCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.DeleteCopilotResponse>;
|
|
149
148
|
private __deleteCopilot;
|
|
149
|
+
/**
|
|
150
|
+
* Export copilot configurations for backup or migration purposes.
|
|
151
|
+
*
|
|
152
|
+
* **IMPORTANT**: This endpoint requires:
|
|
153
|
+
* - Admin privileges
|
|
154
|
+
* - The 'ai-usage-analytics-log.export' scope on the API key
|
|
155
|
+
*
|
|
156
|
+
* Returns all deployed copilots with their full configuration including model settings, tools, and deployment details. Optional date filters can be applied to narrow down results.
|
|
157
|
+
*
|
|
158
|
+
* @param {Credal.ExportCopilotsRequest} request
|
|
159
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* await client.copilots.export({
|
|
163
|
+
* agentCreatedFrom: "2024-01-01T00:00:00Z",
|
|
164
|
+
* agentCreatedTo: "2024-12-31T23:59:59Z"
|
|
165
|
+
* })
|
|
166
|
+
*/
|
|
167
|
+
export(request?: Credal.ExportCopilotsRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.ExportCopilotsResponse>;
|
|
168
|
+
private __export;
|
|
150
169
|
}
|
|
@@ -12,6 +12,7 @@ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
15
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
16
17
|
export class CopilotsClient {
|
|
17
18
|
constructor(options = {}) {
|
|
@@ -65,21 +66,7 @@ export class CopilotsClient {
|
|
|
65
66
|
rawResponse: _response.rawResponse,
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
case "non-json":
|
|
70
|
-
throw new errors.CredalError({
|
|
71
|
-
statusCode: _response.error.statusCode,
|
|
72
|
-
body: _response.error.rawBody,
|
|
73
|
-
rawResponse: _response.rawResponse,
|
|
74
|
-
});
|
|
75
|
-
case "timeout":
|
|
76
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/createCopilot.");
|
|
77
|
-
case "unknown":
|
|
78
|
-
throw new errors.CredalError({
|
|
79
|
-
message: _response.error.errorMessage,
|
|
80
|
-
rawResponse: _response.rawResponse,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
69
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/createCopilot");
|
|
83
70
|
});
|
|
84
71
|
}
|
|
85
72
|
/**
|
|
@@ -126,21 +113,7 @@ export class CopilotsClient {
|
|
|
126
113
|
rawResponse: _response.rawResponse,
|
|
127
114
|
});
|
|
128
115
|
}
|
|
129
|
-
|
|
130
|
-
case "non-json":
|
|
131
|
-
throw new errors.CredalError({
|
|
132
|
-
statusCode: _response.error.statusCode,
|
|
133
|
-
body: _response.error.rawBody,
|
|
134
|
-
rawResponse: _response.rawResponse,
|
|
135
|
-
});
|
|
136
|
-
case "timeout":
|
|
137
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/createConversation.");
|
|
138
|
-
case "unknown":
|
|
139
|
-
throw new errors.CredalError({
|
|
140
|
-
message: _response.error.errorMessage,
|
|
141
|
-
rawResponse: _response.rawResponse,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
116
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/createConversation");
|
|
144
117
|
});
|
|
145
118
|
}
|
|
146
119
|
/**
|
|
@@ -191,21 +164,7 @@ export class CopilotsClient {
|
|
|
191
164
|
rawResponse: _response.rawResponse,
|
|
192
165
|
});
|
|
193
166
|
}
|
|
194
|
-
|
|
195
|
-
case "non-json":
|
|
196
|
-
throw new errors.CredalError({
|
|
197
|
-
statusCode: _response.error.statusCode,
|
|
198
|
-
body: _response.error.rawBody,
|
|
199
|
-
rawResponse: _response.rawResponse,
|
|
200
|
-
});
|
|
201
|
-
case "timeout":
|
|
202
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/provideMessageFeedback.");
|
|
203
|
-
case "unknown":
|
|
204
|
-
throw new errors.CredalError({
|
|
205
|
-
message: _response.error.errorMessage,
|
|
206
|
-
rawResponse: _response.rawResponse,
|
|
207
|
-
});
|
|
208
|
-
}
|
|
167
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/provideMessageFeedback");
|
|
209
168
|
});
|
|
210
169
|
}
|
|
211
170
|
/**
|
|
@@ -258,21 +217,7 @@ export class CopilotsClient {
|
|
|
258
217
|
rawResponse: _response.rawResponse,
|
|
259
218
|
});
|
|
260
219
|
}
|
|
261
|
-
|
|
262
|
-
case "non-json":
|
|
263
|
-
throw new errors.CredalError({
|
|
264
|
-
statusCode: _response.error.statusCode,
|
|
265
|
-
body: _response.error.rawBody,
|
|
266
|
-
rawResponse: _response.rawResponse,
|
|
267
|
-
});
|
|
268
|
-
case "timeout":
|
|
269
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/sendMessage.");
|
|
270
|
-
case "unknown":
|
|
271
|
-
throw new errors.CredalError({
|
|
272
|
-
message: _response.error.errorMessage,
|
|
273
|
-
rawResponse: _response.rawResponse,
|
|
274
|
-
});
|
|
275
|
-
}
|
|
220
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/sendMessage");
|
|
276
221
|
});
|
|
277
222
|
}
|
|
278
223
|
/**
|
|
@@ -322,21 +267,7 @@ export class CopilotsClient {
|
|
|
322
267
|
rawResponse: _response.rawResponse,
|
|
323
268
|
});
|
|
324
269
|
}
|
|
325
|
-
|
|
326
|
-
case "non-json":
|
|
327
|
-
throw new errors.CredalError({
|
|
328
|
-
statusCode: _response.error.statusCode,
|
|
329
|
-
body: _response.error.rawBody,
|
|
330
|
-
rawResponse: _response.rawResponse,
|
|
331
|
-
});
|
|
332
|
-
case "timeout":
|
|
333
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/streamMessage.");
|
|
334
|
-
case "unknown":
|
|
335
|
-
throw new errors.CredalError({
|
|
336
|
-
message: _response.error.errorMessage,
|
|
337
|
-
rawResponse: _response.rawResponse,
|
|
338
|
-
});
|
|
339
|
-
}
|
|
270
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/streamMessage");
|
|
340
271
|
});
|
|
341
272
|
}
|
|
342
273
|
/**
|
|
@@ -383,21 +314,7 @@ export class CopilotsClient {
|
|
|
383
314
|
rawResponse: _response.rawResponse,
|
|
384
315
|
});
|
|
385
316
|
}
|
|
386
|
-
|
|
387
|
-
case "non-json":
|
|
388
|
-
throw new errors.CredalError({
|
|
389
|
-
statusCode: _response.error.statusCode,
|
|
390
|
-
body: _response.error.rawBody,
|
|
391
|
-
rawResponse: _response.rawResponse,
|
|
392
|
-
});
|
|
393
|
-
case "timeout":
|
|
394
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/addCollectionToCopilot.");
|
|
395
|
-
case "unknown":
|
|
396
|
-
throw new errors.CredalError({
|
|
397
|
-
message: _response.error.errorMessage,
|
|
398
|
-
rawResponse: _response.rawResponse,
|
|
399
|
-
});
|
|
400
|
-
}
|
|
317
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/addCollectionToCopilot");
|
|
401
318
|
});
|
|
402
319
|
}
|
|
403
320
|
/**
|
|
@@ -444,21 +361,7 @@ export class CopilotsClient {
|
|
|
444
361
|
rawResponse: _response.rawResponse,
|
|
445
362
|
});
|
|
446
363
|
}
|
|
447
|
-
|
|
448
|
-
case "non-json":
|
|
449
|
-
throw new errors.CredalError({
|
|
450
|
-
statusCode: _response.error.statusCode,
|
|
451
|
-
body: _response.error.rawBody,
|
|
452
|
-
rawResponse: _response.rawResponse,
|
|
453
|
-
});
|
|
454
|
-
case "timeout":
|
|
455
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/removeCollectionFromCopilot.");
|
|
456
|
-
case "unknown":
|
|
457
|
-
throw new errors.CredalError({
|
|
458
|
-
message: _response.error.errorMessage,
|
|
459
|
-
rawResponse: _response.rawResponse,
|
|
460
|
-
});
|
|
461
|
-
}
|
|
364
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/removeCollectionFromCopilot");
|
|
462
365
|
});
|
|
463
366
|
}
|
|
464
367
|
/**
|
|
@@ -513,21 +416,7 @@ export class CopilotsClient {
|
|
|
513
416
|
rawResponse: _response.rawResponse,
|
|
514
417
|
});
|
|
515
418
|
}
|
|
516
|
-
|
|
517
|
-
case "non-json":
|
|
518
|
-
throw new errors.CredalError({
|
|
519
|
-
statusCode: _response.error.statusCode,
|
|
520
|
-
body: _response.error.rawBody,
|
|
521
|
-
rawResponse: _response.rawResponse,
|
|
522
|
-
});
|
|
523
|
-
case "timeout":
|
|
524
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/updateConfiguration.");
|
|
525
|
-
case "unknown":
|
|
526
|
-
throw new errors.CredalError({
|
|
527
|
-
message: _response.error.errorMessage,
|
|
528
|
-
rawResponse: _response.rawResponse,
|
|
529
|
-
});
|
|
530
|
-
}
|
|
419
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/updateConfiguration");
|
|
531
420
|
});
|
|
532
421
|
}
|
|
533
422
|
/**
|
|
@@ -571,21 +460,60 @@ export class CopilotsClient {
|
|
|
571
460
|
rawResponse: _response.rawResponse,
|
|
572
461
|
});
|
|
573
462
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
463
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/copilots/deleteCopilot");
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Export copilot configurations for backup or migration purposes.
|
|
468
|
+
*
|
|
469
|
+
* **IMPORTANT**: This endpoint requires:
|
|
470
|
+
* - Admin privileges
|
|
471
|
+
* - The 'ai-usage-analytics-log.export' scope on the API key
|
|
472
|
+
*
|
|
473
|
+
* Returns all deployed copilots with their full configuration including model settings, tools, and deployment details. Optional date filters can be applied to narrow down results.
|
|
474
|
+
*
|
|
475
|
+
* @param {Credal.ExportCopilotsRequest} request
|
|
476
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* await client.copilots.export({
|
|
480
|
+
* agentCreatedFrom: "2024-01-01T00:00:00Z",
|
|
481
|
+
* agentCreatedTo: "2024-12-31T23:59:59Z"
|
|
482
|
+
* })
|
|
483
|
+
*/
|
|
484
|
+
export(request = {}, requestOptions) {
|
|
485
|
+
return core.HttpResponsePromise.fromPromise(this.__export(request, requestOptions));
|
|
486
|
+
}
|
|
487
|
+
__export() {
|
|
488
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
489
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
490
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
491
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
492
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
493
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/copilots/export"),
|
|
494
|
+
method: "POST",
|
|
495
|
+
headers: _headers,
|
|
496
|
+
contentType: "application/json",
|
|
497
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
498
|
+
requestType: "json",
|
|
499
|
+
body: request,
|
|
500
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
501
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
502
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
503
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
504
|
+
logging: this._options.logging,
|
|
505
|
+
});
|
|
506
|
+
if (_response.ok) {
|
|
507
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
508
|
+
}
|
|
509
|
+
if (_response.error.reason === "status-code") {
|
|
510
|
+
throw new errors.CredalError({
|
|
511
|
+
statusCode: _response.error.statusCode,
|
|
512
|
+
body: _response.error.body,
|
|
513
|
+
rawResponse: _response.rawResponse,
|
|
514
|
+
});
|
|
588
515
|
}
|
|
516
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/copilots/export");
|
|
589
517
|
});
|
|
590
518
|
}
|
|
591
519
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* agentCreatedFrom: "2024-01-01T00:00:00Z",
|
|
5
|
+
* agentCreatedTo: "2024-12-31T23:59:59Z"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface ExportCopilotsRequest {
|
|
9
|
+
/** Filter copilots created on or after this datetime (ISO 8601 format). */
|
|
10
|
+
agentCreatedFrom?: string;
|
|
11
|
+
/** Filter copilots created before or on this datetime (ISO 8601 format). */
|
|
12
|
+
agentCreatedTo?: string;
|
|
13
|
+
/** Filter copilot versions created on or after this datetime (ISO 8601 format). */
|
|
14
|
+
versionCreatedFrom?: string;
|
|
15
|
+
/** Filter copilot versions created before or on this datetime (ISO 8601 format). */
|
|
16
|
+
versionCreatedTo?: string;
|
|
17
|
+
/** Maximum number of copilots to return. Must be a positive integer with a maximum value of 1000. Defaults to 100. */
|
|
18
|
+
limit?: number;
|
|
19
|
+
/** Cursor for pagination. Use the cursor returned in the previous response to fetch the next page of results. If not provided, returns the first page. */
|
|
20
|
+
cursor?: string;
|
|
21
|
+
}
|
|
@@ -2,6 +2,7 @@ export type { AddCollectionToCopilotRequest } from "./AddCollectionToCopilotRequ
|
|
|
2
2
|
export type { CreateConversationRequest } from "./CreateConversationRequest.mjs";
|
|
3
3
|
export type { CreateCopilotRequest } from "./CreateCopilotRequest.mjs";
|
|
4
4
|
export type { DeleteCopilotRequest } from "./DeleteCopilotRequest.mjs";
|
|
5
|
+
export type { ExportCopilotsRequest } from "./ExportCopilotsRequest.mjs";
|
|
5
6
|
export type { ProvideMessageFeedbackRequest } from "./ProvideMessageFeedbackRequest.mjs";
|
|
6
7
|
export type { RemoveCollectionFromCopilotRequest } from "./RemoveCollectionFromCopilotRequest.mjs";
|
|
7
8
|
export type { SendMessageRequest } from "./SendMessageRequest.mjs";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as Credal from "../../../index.mjs";
|
|
2
|
+
export interface ExportCopilotsResponse {
|
|
3
|
+
/** List of exported copilots matching the query filters. */
|
|
4
|
+
data: Credal.ExportedCopilot[];
|
|
5
|
+
/** Indicates whether there are more results available for pagination. */
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
/** Cursor to use for fetching the next page of results. This is a UUID string. If null or not present, there are no more results. */
|
|
8
|
+
nextCursor?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ExportedCopilot {
|
|
2
|
+
/** The unique identifier of the copilot. */
|
|
3
|
+
id: string;
|
|
4
|
+
/** The name of the deployed copilot version. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** The description of the deployed copilot version. */
|
|
7
|
+
description: string;
|
|
8
|
+
/** Model configuration including provider, model name, temperature, and other settings. */
|
|
9
|
+
modelConfiguration?: unknown;
|
|
10
|
+
/** AI endpoint configuration including base URL and authentication details. */
|
|
11
|
+
aiEndpointConfiguration?: unknown;
|
|
12
|
+
/** List of tool configurations available to the copilot. */
|
|
13
|
+
toolConfigurations?: unknown;
|
|
14
|
+
/** Input variable configurations for the copilot. */
|
|
15
|
+
inputs?: unknown;
|
|
16
|
+
/** Deployment settings and configuration. */
|
|
17
|
+
deploymentConfiguration?: unknown;
|
|
18
|
+
/** ISO 8601 timestamp when the copilot was originally created. */
|
|
19
|
+
agentCreatedDatetime: string;
|
|
20
|
+
/** ISO 8601 timestamp when the deployed version was created. */
|
|
21
|
+
versionCreatedDatetime: string;
|
|
22
|
+
/** Indicates if the copilot is currently deployed (always true for export results). */
|
|
23
|
+
isDeployed: boolean;
|
|
24
|
+
}
|
|
@@ -12,6 +12,8 @@ export * from "./DeleteCopilotResponse.mjs";
|
|
|
12
12
|
export * from "./EndOfMessageChunk.mjs";
|
|
13
13
|
export * from "./ErrorChunk.mjs";
|
|
14
14
|
export * from "./ErrorChunkData.mjs";
|
|
15
|
+
export * from "./ExportCopilotsResponse.mjs";
|
|
16
|
+
export * from "./ExportedCopilot.mjs";
|
|
15
17
|
export * from "./FeedbackEnum.mjs";
|
|
16
18
|
export * from "./Filter.mjs";
|
|
17
19
|
export * from "./FinalChunk.mjs";
|
|
@@ -12,6 +12,8 @@ export * from "./DeleteCopilotResponse.mjs";
|
|
|
12
12
|
export * from "./EndOfMessageChunk.mjs";
|
|
13
13
|
export * from "./ErrorChunk.mjs";
|
|
14
14
|
export * from "./ErrorChunkData.mjs";
|
|
15
|
+
export * from "./ExportCopilotsResponse.mjs";
|
|
16
|
+
export * from "./ExportedCopilot.mjs";
|
|
15
17
|
export * from "./FeedbackEnum.mjs";
|
|
16
18
|
export * from "./Filter.mjs";
|
|
17
19
|
export * from "./FinalChunk.mjs";
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs
|
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import type * as Credal from "../../../index.mjs";
|
|
5
5
|
export declare namespace DocumentCatalogClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -12,6 +12,7 @@ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
|
12
12
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
15
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
16
17
|
export class DocumentCatalogClient {
|
|
17
18
|
constructor(options = {}) {
|
|
@@ -62,21 +63,7 @@ export class DocumentCatalogClient {
|
|
|
62
63
|
rawResponse: _response.rawResponse,
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
case "non-json":
|
|
67
|
-
throw new errors.CredalError({
|
|
68
|
-
statusCode: _response.error.statusCode,
|
|
69
|
-
body: _response.error.rawBody,
|
|
70
|
-
rawResponse: _response.rawResponse,
|
|
71
|
-
});
|
|
72
|
-
case "timeout":
|
|
73
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/catalog/uploadDocumentContents.");
|
|
74
|
-
case "unknown":
|
|
75
|
-
throw new errors.CredalError({
|
|
76
|
-
message: _response.error.errorMessage,
|
|
77
|
-
rawResponse: _response.rawResponse,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
66
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/catalog/uploadDocumentContents");
|
|
80
67
|
});
|
|
81
68
|
}
|
|
82
69
|
/**
|
|
@@ -149,21 +136,7 @@ export class DocumentCatalogClient {
|
|
|
149
136
|
rawResponse: _response.rawResponse,
|
|
150
137
|
});
|
|
151
138
|
}
|
|
152
|
-
|
|
153
|
-
case "non-json":
|
|
154
|
-
throw new errors.CredalError({
|
|
155
|
-
statusCode: _response.error.statusCode,
|
|
156
|
-
body: _response.error.rawBody,
|
|
157
|
-
rawResponse: _response.rawResponse,
|
|
158
|
-
});
|
|
159
|
-
case "timeout":
|
|
160
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/catalog/uploadFile.");
|
|
161
|
-
case "unknown":
|
|
162
|
-
throw new errors.CredalError({
|
|
163
|
-
message: _response.error.errorMessage,
|
|
164
|
-
rawResponse: _response.rawResponse,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
139
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/catalog/uploadFile");
|
|
167
140
|
});
|
|
168
141
|
}
|
|
169
142
|
/**
|
|
@@ -210,21 +183,7 @@ export class DocumentCatalogClient {
|
|
|
210
183
|
rawResponse: _response.rawResponse,
|
|
211
184
|
});
|
|
212
185
|
}
|
|
213
|
-
|
|
214
|
-
case "non-json":
|
|
215
|
-
throw new errors.CredalError({
|
|
216
|
-
statusCode: _response.error.statusCode,
|
|
217
|
-
body: _response.error.rawBody,
|
|
218
|
-
rawResponse: _response.rawResponse,
|
|
219
|
-
});
|
|
220
|
-
case "timeout":
|
|
221
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/catalog/syncSourceByUrl.");
|
|
222
|
-
case "unknown":
|
|
223
|
-
throw new errors.CredalError({
|
|
224
|
-
message: _response.error.errorMessage,
|
|
225
|
-
rawResponse: _response.rawResponse,
|
|
226
|
-
});
|
|
227
|
-
}
|
|
186
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/catalog/syncSourceByUrl");
|
|
228
187
|
});
|
|
229
188
|
}
|
|
230
189
|
/**
|
|
@@ -291,21 +250,7 @@ export class DocumentCatalogClient {
|
|
|
291
250
|
rawResponse: _response.rawResponse,
|
|
292
251
|
});
|
|
293
252
|
}
|
|
294
|
-
|
|
295
|
-
case "non-json":
|
|
296
|
-
throw new errors.CredalError({
|
|
297
|
-
statusCode: _response.error.statusCode,
|
|
298
|
-
body: _response.error.rawBody,
|
|
299
|
-
rawResponse: _response.rawResponse,
|
|
300
|
-
});
|
|
301
|
-
case "timeout":
|
|
302
|
-
throw new errors.CredalTimeoutError("Timeout exceeded when calling PATCH /v0/catalog/metadata.");
|
|
303
|
-
case "unknown":
|
|
304
|
-
throw new errors.CredalError({
|
|
305
|
-
message: _response.error.errorMessage,
|
|
306
|
-
rawResponse: _response.rawResponse,
|
|
307
|
-
});
|
|
308
|
-
}
|
|
253
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/catalog/metadata");
|
|
309
254
|
});
|
|
310
255
|
}
|
|
311
256
|
}
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs
|
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import type * as Credal from "../../../index.mjs";
|
|
5
5
|
export declare namespace DocumentCollectionsClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|