@algolia/agent-studio 0.1.0-beta.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.
@@ -0,0 +1,1341 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/agentStudioClient.ts
21
+ var agentStudioClient_exports = {};
22
+ __export(agentStudioClient_exports, {
23
+ apiClientVersion: () => apiClientVersion,
24
+ createAgentStudioClient: () => createAgentStudioClient
25
+ });
26
+ module.exports = __toCommonJS(agentStudioClient_exports);
27
+ var import_client_common = require("@algolia/client-common");
28
+ var apiClientVersion = "0.1.0-beta.0";
29
+ function getDefaultHosts(appId) {
30
+ return [
31
+ {
32
+ url: `${appId}-dsn.algolia.net`,
33
+ accept: "read",
34
+ protocol: "https"
35
+ },
36
+ {
37
+ url: `${appId}.algolia.net`,
38
+ accept: "write",
39
+ protocol: "https"
40
+ }
41
+ ].concat(
42
+ (0, import_client_common.shuffle)([
43
+ {
44
+ url: `${appId}-1.algolianet.com`,
45
+ accept: "readWrite",
46
+ protocol: "https"
47
+ },
48
+ {
49
+ url: `${appId}-2.algolianet.com`,
50
+ accept: "readWrite",
51
+ protocol: "https"
52
+ },
53
+ {
54
+ url: `${appId}-3.algolianet.com`,
55
+ accept: "readWrite",
56
+ protocol: "https"
57
+ }
58
+ ])
59
+ );
60
+ }
61
+ function createAgentStudioClient({
62
+ appId: appIdOption,
63
+ apiKey: apiKeyOption,
64
+ authMode,
65
+ algoliaAgents,
66
+ ...options
67
+ }) {
68
+ const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
69
+ const transporter = (0, import_client_common.createTransporter)({
70
+ hosts: getDefaultHosts(appIdOption),
71
+ ...options,
72
+ algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
73
+ algoliaAgents,
74
+ client: "AgentStudio",
75
+ version: apiClientVersion
76
+ }),
77
+ baseHeaders: {
78
+ "content-type": "text/plain",
79
+ ...auth.headers(),
80
+ ...options.baseHeaders
81
+ },
82
+ baseQueryParameters: {
83
+ ...auth.queryParameters(),
84
+ ...options.baseQueryParameters
85
+ }
86
+ });
87
+ return {
88
+ transporter,
89
+ /**
90
+ * The `appId` currently in use.
91
+ */
92
+ appId: appIdOption,
93
+ /**
94
+ * The `apiKey` currently in use.
95
+ */
96
+ apiKey: apiKeyOption,
97
+ /**
98
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
99
+ */
100
+ clearCache() {
101
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
102
+ },
103
+ /**
104
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
105
+ */
106
+ get _ua() {
107
+ return transporter.algoliaAgent.value;
108
+ },
109
+ /**
110
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
111
+ *
112
+ * @param segment - The algolia agent (user-agent) segment to add.
113
+ * @param version - The version of the agent.
114
+ */
115
+ addAlgoliaAgent(segment, version) {
116
+ transporter.algoliaAgent.add({ segment, version });
117
+ },
118
+ /**
119
+ * Helper method to switch the API key used to authenticate the requests.
120
+ *
121
+ * @param params - Method params.
122
+ * @param params.apiKey - The new API Key to use.
123
+ */
124
+ setClientApiKey({ apiKey }) {
125
+ if (!authMode || authMode === "WithinHeaders") {
126
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
127
+ } else {
128
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
129
+ }
130
+ },
131
+ /**
132
+ * Add multiple allowed domain patterns. Duplicates are skipped.
133
+ *
134
+ * Required API Key ACLs:
135
+ * - editSettings
136
+ * @param bulkCreateAllowedDomains - The bulkCreateAllowedDomains object.
137
+ * @param bulkCreateAllowedDomains.agentId - The agentId.
138
+ * @param bulkCreateAllowedDomains.allowedDomainBulkInsert - The allowedDomainBulkInsert object.
139
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
140
+ */
141
+ bulkCreateAllowedDomains({ agentId, allowedDomainBulkInsert }, requestOptions) {
142
+ (0, import_client_common.validateRequired)("agentId", "bulkCreateAllowedDomains", agentId);
143
+ (0, import_client_common.validateRequired)("allowedDomainBulkInsert", "bulkCreateAllowedDomains", allowedDomainBulkInsert);
144
+ (0, import_client_common.validateRequired)("allowedDomainBulkInsert.domains", "bulkCreateAllowedDomains", allowedDomainBulkInsert.domains);
145
+ const requestPath = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".replace(
146
+ "{agentId}",
147
+ encodeURIComponent(agentId)
148
+ );
149
+ const headers = {};
150
+ const queryParameters = {};
151
+ const request = {
152
+ method: "POST",
153
+ path: requestPath,
154
+ queryParameters,
155
+ headers,
156
+ data: allowedDomainBulkInsert
157
+ };
158
+ return transporter.request(request, requestOptions);
159
+ },
160
+ /**
161
+ * Delete allowed domains by id list.
162
+ *
163
+ * Required API Key ACLs:
164
+ * - editSettings
165
+ * @param bulkDeleteAllowedDomains - The bulkDeleteAllowedDomains object.
166
+ * @param bulkDeleteAllowedDomains.agentId - The agentId.
167
+ * @param bulkDeleteAllowedDomains.allowedDomainBulkDelete - The allowedDomainBulkDelete object.
168
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
169
+ */
170
+ bulkDeleteAllowedDomains({ agentId, allowedDomainBulkDelete }, requestOptions) {
171
+ (0, import_client_common.validateRequired)("agentId", "bulkDeleteAllowedDomains", agentId);
172
+ (0, import_client_common.validateRequired)("allowedDomainBulkDelete", "bulkDeleteAllowedDomains", allowedDomainBulkDelete);
173
+ (0, import_client_common.validateRequired)(
174
+ "allowedDomainBulkDelete.domainIds",
175
+ "bulkDeleteAllowedDomains",
176
+ allowedDomainBulkDelete.domainIds
177
+ );
178
+ const requestPath = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".replace(
179
+ "{agentId}",
180
+ encodeURIComponent(agentId)
181
+ );
182
+ const headers = {};
183
+ const queryParameters = {};
184
+ const request = {
185
+ method: "DELETE",
186
+ path: requestPath,
187
+ queryParameters,
188
+ headers,
189
+ data: allowedDomainBulkDelete
190
+ };
191
+ return transporter.request(request, requestOptions);
192
+ },
193
+ /**
194
+ * Create a new agent.
195
+ *
196
+ * Required API Key ACLs:
197
+ * - editSettings
198
+ * @param agentConfigCreate - The agentConfigCreate object.
199
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
200
+ */
201
+ createAgent(agentConfigCreate, requestOptions) {
202
+ (0, import_client_common.validateRequired)("agentConfigCreate", "createAgent", agentConfigCreate);
203
+ (0, import_client_common.validateRequired)("agentConfigCreate.name", "createAgent", agentConfigCreate.name);
204
+ (0, import_client_common.validateRequired)("agentConfigCreate.instructions", "createAgent", agentConfigCreate.instructions);
205
+ const requestPath = "/agent-studio/1/agents";
206
+ const headers = {};
207
+ const queryParameters = {};
208
+ const request = {
209
+ method: "POST",
210
+ path: requestPath,
211
+ queryParameters,
212
+ headers,
213
+ data: agentConfigCreate
214
+ };
215
+ return transporter.request(request, requestOptions);
216
+ },
217
+ /**
218
+ * Add a single allowed domain pattern (e.g. https://app.example.com or *.example.com).
219
+ *
220
+ * Required API Key ACLs:
221
+ * - editSettings
222
+ * @param createAgentAllowedDomain - The createAgentAllowedDomain object.
223
+ * @param createAgentAllowedDomain.agentId - The agentId.
224
+ * @param createAgentAllowedDomain.allowedDomainCreate - The allowedDomainCreate object.
225
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
226
+ */
227
+ createAgentAllowedDomain({ agentId, allowedDomainCreate }, requestOptions) {
228
+ (0, import_client_common.validateRequired)("agentId", "createAgentAllowedDomain", agentId);
229
+ (0, import_client_common.validateRequired)("allowedDomainCreate", "createAgentAllowedDomain", allowedDomainCreate);
230
+ (0, import_client_common.validateRequired)("allowedDomainCreate.domain", "createAgentAllowedDomain", allowedDomainCreate.domain);
231
+ const requestPath = "/agent-studio/1/agents/{agentId}/allowed-domains".replace(
232
+ "{agentId}",
233
+ encodeURIComponent(agentId)
234
+ );
235
+ const headers = {};
236
+ const queryParameters = {};
237
+ const request = {
238
+ method: "POST",
239
+ path: requestPath,
240
+ queryParameters,
241
+ headers,
242
+ data: allowedDomainCreate
243
+ };
244
+ return transporter.request(request, requestOptions);
245
+ },
246
+ /**
247
+ * Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result.
248
+ *
249
+ * Required API Key ACLs:
250
+ * - search
251
+ * @param createAgentCompletion - The createAgentCompletion object.
252
+ * @param createAgentCompletion.agentId - The agentId.
253
+ * @param createAgentCompletion.compatibilityMode - Compatibility mode for the completion API.
254
+ * @param createAgentCompletion.agentCompletionRequest - The agentCompletionRequest object.
255
+ * @param createAgentCompletion.stream - Whether to stream the response or not.
256
+ * @param createAgentCompletion.cache - Use cached responses if available.
257
+ * @param createAgentCompletion.memory - Set to false to disable memory (enabled by default).
258
+ * @param createAgentCompletion.analytics - Set to false to skip analytics for this completion (default: true). Disables Agent Studio BigQuery analytics, Algolia search analytics, click analytics, and query-suggestions training. Useful for offline-eval workflows.
259
+ * @param createAgentCompletion.xAlgoliaSecureUserToken - The X-Algolia-Secure-User-Token.
260
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
261
+ */
262
+ createAgentCompletion({
263
+ agentId,
264
+ compatibilityMode,
265
+ agentCompletionRequest,
266
+ stream,
267
+ cache,
268
+ memory,
269
+ analytics,
270
+ xAlgoliaSecureUserToken
271
+ }, requestOptions) {
272
+ (0, import_client_common.validateRequired)("agentId", "createAgentCompletion", agentId);
273
+ (0, import_client_common.validateRequired)("compatibilityMode", "createAgentCompletion", compatibilityMode);
274
+ (0, import_client_common.validateRequired)("agentCompletionRequest", "createAgentCompletion", agentCompletionRequest);
275
+ const requestPath = "/agent-studio/1/agents/{agentId}/completions".replace(
276
+ "{agentId}",
277
+ encodeURIComponent(agentId)
278
+ );
279
+ const headers = {};
280
+ const queryParameters = {};
281
+ if (compatibilityMode !== void 0) {
282
+ queryParameters["compatibilityMode"] = compatibilityMode.toString();
283
+ }
284
+ if (stream !== void 0) {
285
+ queryParameters["stream"] = stream.toString();
286
+ }
287
+ if (cache !== void 0) {
288
+ queryParameters["cache"] = cache.toString();
289
+ }
290
+ if (memory !== void 0) {
291
+ queryParameters["memory"] = memory.toString();
292
+ }
293
+ if (analytics !== void 0) {
294
+ queryParameters["analytics"] = analytics.toString();
295
+ }
296
+ if (xAlgoliaSecureUserToken !== void 0) {
297
+ headers["X-Algolia-Secure-User-Token"] = xAlgoliaSecureUserToken.toString();
298
+ }
299
+ const request = {
300
+ method: "POST",
301
+ path: requestPath,
302
+ queryParameters,
303
+ headers,
304
+ data: agentCompletionRequest
305
+ };
306
+ return transporter.request(request, requestOptions);
307
+ },
308
+ /**
309
+ * Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result. (raw streaming version).
310
+ *
311
+ * Yields raw {@link ServerSentEvent} objects. Each event's `data` field contains a JSON-encoded `{ [key: string]: any; }` string.
312
+ *
313
+ * @see createAgentCompletionStream for the parsed variant.
314
+ * @see createAgentCompletion for the non-streaming version.
315
+ */
316
+ createAgentCompletionStreamRaw({
317
+ agentId,
318
+ compatibilityMode,
319
+ agentCompletionRequest,
320
+ stream,
321
+ cache,
322
+ memory,
323
+ analytics,
324
+ xAlgoliaSecureUserToken
325
+ }, requestOptions) {
326
+ (0, import_client_common.validateRequired)("agentId", "createAgentCompletionStreamRaw", agentId);
327
+ (0, import_client_common.validateRequired)("compatibilityMode", "createAgentCompletionStreamRaw", compatibilityMode);
328
+ (0, import_client_common.validateRequired)("agentCompletionRequest", "createAgentCompletionStreamRaw", agentCompletionRequest);
329
+ const requestPath = "/agent-studio/1/agents/{agentId}/completions".replace(
330
+ "{agentId}",
331
+ encodeURIComponent(agentId)
332
+ );
333
+ const headers = {};
334
+ const queryParameters = {};
335
+ if (compatibilityMode !== void 0) {
336
+ queryParameters["compatibilityMode"] = compatibilityMode.toString();
337
+ }
338
+ if (stream !== void 0) {
339
+ queryParameters["stream"] = stream.toString();
340
+ }
341
+ if (cache !== void 0) {
342
+ queryParameters["cache"] = cache.toString();
343
+ }
344
+ if (memory !== void 0) {
345
+ queryParameters["memory"] = memory.toString();
346
+ }
347
+ if (analytics !== void 0) {
348
+ queryParameters["analytics"] = analytics.toString();
349
+ }
350
+ if (xAlgoliaSecureUserToken !== void 0) {
351
+ headers["X-Algolia-Secure-User-Token"] = xAlgoliaSecureUserToken.toString();
352
+ }
353
+ const request = {
354
+ method: "POST",
355
+ path: requestPath,
356
+ queryParameters,
357
+ headers,
358
+ data: agentCompletionRequest
359
+ };
360
+ return transporter.requestStream(request, requestOptions);
361
+ },
362
+ /**
363
+ * Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result. (streaming version).
364
+ *
365
+ * Yields {@link StreamEvent} objects wrapping parsed `{ [key: string]: any; }` payloads.
366
+ *
367
+ * @see createAgentCompletionStreamRaw for the raw variant.
368
+ * @see createAgentCompletion for the non-streaming version.
369
+ */
370
+ async *createAgentCompletionStream({
371
+ agentId,
372
+ compatibilityMode,
373
+ agentCompletionRequest,
374
+ stream,
375
+ cache,
376
+ memory,
377
+ analytics,
378
+ xAlgoliaSecureUserToken
379
+ }, requestOptions) {
380
+ for await (const event of this.createAgentCompletionStreamRaw(
381
+ {
382
+ agentId,
383
+ compatibilityMode,
384
+ agentCompletionRequest,
385
+ stream,
386
+ cache,
387
+ memory,
388
+ analytics,
389
+ xAlgoliaSecureUserToken
390
+ },
391
+ requestOptions
392
+ )) {
393
+ try {
394
+ const data = JSON.parse(event.data);
395
+ yield { data, raw: event };
396
+ } catch (e) {
397
+ yield { data: null, raw: event, error: e };
398
+ }
399
+ }
400
+ },
401
+ /**
402
+ * Create new feedback entry.
403
+ *
404
+ * Required API Key ACLs:
405
+ * - search
406
+ * @param feedbackCreationRequest - The feedbackCreationRequest object.
407
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
408
+ */
409
+ createFeedback(feedbackCreationRequest, requestOptions) {
410
+ (0, import_client_common.validateRequired)("feedbackCreationRequest", "createFeedback", feedbackCreationRequest);
411
+ (0, import_client_common.validateRequired)("feedbackCreationRequest.messageId", "createFeedback", feedbackCreationRequest.messageId);
412
+ (0, import_client_common.validateRequired)("feedbackCreationRequest.agentId", "createFeedback", feedbackCreationRequest.agentId);
413
+ (0, import_client_common.validateRequired)("feedbackCreationRequest.vote", "createFeedback", feedbackCreationRequest.vote);
414
+ const requestPath = "/agent-studio/1/feedback";
415
+ const headers = {};
416
+ const queryParameters = {};
417
+ const request = {
418
+ method: "POST",
419
+ path: requestPath,
420
+ queryParameters,
421
+ headers,
422
+ data: feedbackCreationRequest
423
+ };
424
+ return transporter.request(request, requestOptions);
425
+ },
426
+ /**
427
+ * Create Provider.
428
+ *
429
+ * Required API Key ACLs:
430
+ * - editSettings
431
+ * @param providerAuthenticationCreate - The providerAuthenticationCreate object.
432
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
433
+ */
434
+ createProvider(providerAuthenticationCreate, requestOptions) {
435
+ (0, import_client_common.validateRequired)("providerAuthenticationCreate", "createProvider", providerAuthenticationCreate);
436
+ (0, import_client_common.validateRequired)("providerAuthenticationCreate.name", "createProvider", providerAuthenticationCreate.name);
437
+ (0, import_client_common.validateRequired)(
438
+ "providerAuthenticationCreate.providerName",
439
+ "createProvider",
440
+ providerAuthenticationCreate.providerName
441
+ );
442
+ (0, import_client_common.validateRequired)("providerAuthenticationCreate.input", "createProvider", providerAuthenticationCreate.input);
443
+ const requestPath = "/agent-studio/1/providers";
444
+ const headers = {};
445
+ const queryParameters = {};
446
+ const request = {
447
+ method: "POST",
448
+ path: requestPath,
449
+ queryParameters,
450
+ headers,
451
+ data: providerAuthenticationCreate
452
+ };
453
+ return transporter.request(request, requestOptions);
454
+ },
455
+ /**
456
+ * Create Secret Key.
457
+ *
458
+ * Required API Key ACLs:
459
+ * - admin
460
+ * @param secretKeyCreate - The secretKeyCreate object.
461
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
462
+ */
463
+ createSecretKey(secretKeyCreate, requestOptions) {
464
+ (0, import_client_common.validateRequired)("secretKeyCreate", "createSecretKey", secretKeyCreate);
465
+ (0, import_client_common.validateRequired)("secretKeyCreate.name", "createSecretKey", secretKeyCreate.name);
466
+ const requestPath = "/agent-studio/1/secret-keys";
467
+ const headers = {};
468
+ const queryParameters = {};
469
+ const request = {
470
+ method: "POST",
471
+ path: requestPath,
472
+ queryParameters,
473
+ headers,
474
+ data: secretKeyCreate
475
+ };
476
+ return transporter.request(request, requestOptions);
477
+ },
478
+ /**
479
+ * This method lets you send requests to the Algolia REST API.
480
+ * @param customDelete - The customDelete object.
481
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
482
+ * @param customDelete.parameters - Query parameters to apply to the current query.
483
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
484
+ */
485
+ customDelete({ path, parameters }, requestOptions) {
486
+ (0, import_client_common.validateRequired)("path", "customDelete", path);
487
+ const requestPath = "/agent-studio/{path}".replace("{path}", path);
488
+ const headers = {};
489
+ const queryParameters = parameters ? parameters : {};
490
+ const request = {
491
+ method: "DELETE",
492
+ path: requestPath,
493
+ queryParameters,
494
+ headers
495
+ };
496
+ return transporter.request(request, requestOptions);
497
+ },
498
+ /**
499
+ * This method lets you send requests to the Algolia REST API.
500
+ * @param customGet - The customGet object.
501
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
502
+ * @param customGet.parameters - Query parameters to apply to the current query.
503
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
504
+ */
505
+ customGet({ path, parameters }, requestOptions) {
506
+ (0, import_client_common.validateRequired)("path", "customGet", path);
507
+ const requestPath = "/agent-studio/{path}".replace("{path}", path);
508
+ const headers = {};
509
+ const queryParameters = parameters ? parameters : {};
510
+ const request = {
511
+ method: "GET",
512
+ path: requestPath,
513
+ queryParameters,
514
+ headers
515
+ };
516
+ return transporter.request(request, requestOptions);
517
+ },
518
+ /**
519
+ * This method lets you send requests to the Algolia REST API.
520
+ * @param customPost - The customPost object.
521
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
522
+ * @param customPost.parameters - Query parameters to apply to the current query.
523
+ * @param customPost.body - Parameters to send with the custom request.
524
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
525
+ */
526
+ customPost({ path, parameters, body }, requestOptions) {
527
+ (0, import_client_common.validateRequired)("path", "customPost", path);
528
+ const requestPath = "/agent-studio/{path}".replace("{path}", path);
529
+ const headers = {};
530
+ const queryParameters = parameters ? parameters : {};
531
+ const request = {
532
+ method: "POST",
533
+ path: requestPath,
534
+ queryParameters,
535
+ headers,
536
+ data: body ? body : {}
537
+ };
538
+ return transporter.request(request, requestOptions);
539
+ },
540
+ /**
541
+ * This method lets you send requests to the Algolia REST API.
542
+ * @param customPut - The customPut object.
543
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
544
+ * @param customPut.parameters - Query parameters to apply to the current query.
545
+ * @param customPut.body - Parameters to send with the custom request.
546
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
547
+ */
548
+ customPut({ path, parameters, body }, requestOptions) {
549
+ (0, import_client_common.validateRequired)("path", "customPut", path);
550
+ const requestPath = "/agent-studio/{path}".replace("{path}", path);
551
+ const headers = {};
552
+ const queryParameters = parameters ? parameters : {};
553
+ const request = {
554
+ method: "PUT",
555
+ path: requestPath,
556
+ queryParameters,
557
+ headers,
558
+ data: body ? body : {}
559
+ };
560
+ return transporter.request(request, requestOptions);
561
+ },
562
+ /**
563
+ * Delete the specified agent.
564
+ *
565
+ * Required API Key ACLs:
566
+ * - editSettings
567
+ * @param deleteAgent - The deleteAgent object.
568
+ * @param deleteAgent.agentId - The agentId.
569
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
570
+ */
571
+ deleteAgent({ agentId }, requestOptions) {
572
+ (0, import_client_common.validateRequired)("agentId", "deleteAgent", agentId);
573
+ const requestPath = "/agent-studio/1/agents/{agentId}".replace("{agentId}", encodeURIComponent(agentId));
574
+ const headers = {};
575
+ const queryParameters = {};
576
+ const request = {
577
+ method: "DELETE",
578
+ path: requestPath,
579
+ queryParameters,
580
+ headers
581
+ };
582
+ return transporter.request(request, requestOptions);
583
+ },
584
+ /**
585
+ * Deletes the conversations matching the given filers.
586
+ *
587
+ * Required API Key ACLs:
588
+ * - logs
589
+ * @param deleteAgentConversations - The deleteAgentConversations object.
590
+ * @param deleteAgentConversations.agentId - The agentId.
591
+ * @param deleteAgentConversations.startDate - Filter conversations created after this date (format: YYYY-MM-DD).
592
+ * @param deleteAgentConversations.endDate - Filter conversations created before this date (format: YYYY-MM-DD).
593
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
594
+ */
595
+ deleteAgentConversations({ agentId, startDate, endDate }, requestOptions) {
596
+ (0, import_client_common.validateRequired)("agentId", "deleteAgentConversations", agentId);
597
+ const requestPath = "/agent-studio/1/agents/{agentId}/conversations".replace(
598
+ "{agentId}",
599
+ encodeURIComponent(agentId)
600
+ );
601
+ const headers = {};
602
+ const queryParameters = {};
603
+ if (startDate !== void 0) {
604
+ queryParameters["startDate"] = startDate.toString();
605
+ }
606
+ if (endDate !== void 0) {
607
+ queryParameters["endDate"] = endDate.toString();
608
+ }
609
+ const request = {
610
+ method: "DELETE",
611
+ path: requestPath,
612
+ queryParameters,
613
+ headers
614
+ };
615
+ return transporter.request(request, requestOptions);
616
+ },
617
+ /**
618
+ * Remove an allowed domain by id.
619
+ *
620
+ * Required API Key ACLs:
621
+ * - editSettings
622
+ * @param deleteAllowedDomain - The deleteAllowedDomain object.
623
+ * @param deleteAllowedDomain.domainId - The domainId.
624
+ * @param deleteAllowedDomain.agentId - The agentId.
625
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
626
+ */
627
+ deleteAllowedDomain({ domainId, agentId }, requestOptions) {
628
+ (0, import_client_common.validateRequired)("domainId", "deleteAllowedDomain", domainId);
629
+ (0, import_client_common.validateRequired)("agentId", "deleteAllowedDomain", agentId);
630
+ const requestPath = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}".replace("{domainId}", encodeURIComponent(domainId)).replace("{agentId}", encodeURIComponent(agentId));
631
+ const headers = {};
632
+ const queryParameters = {};
633
+ const request = {
634
+ method: "DELETE",
635
+ path: requestPath,
636
+ queryParameters,
637
+ headers
638
+ };
639
+ return transporter.request(request, requestOptions);
640
+ },
641
+ /**
642
+ * Deletes the conversation with the given ID.
643
+ *
644
+ * Required API Key ACLs:
645
+ * - logs
646
+ * @param deleteConversation - The deleteConversation object.
647
+ * @param deleteConversation.conversationId - The conversationId.
648
+ * @param deleteConversation.agentId - The agentId.
649
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
650
+ */
651
+ deleteConversation({ conversationId, agentId }, requestOptions) {
652
+ (0, import_client_common.validateRequired)("conversationId", "deleteConversation", conversationId);
653
+ (0, import_client_common.validateRequired)("agentId", "deleteConversation", agentId);
654
+ const requestPath = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}".replace("{conversationId}", encodeURIComponent(conversationId)).replace("{agentId}", encodeURIComponent(agentId));
655
+ const headers = {};
656
+ const queryParameters = {};
657
+ const request = {
658
+ method: "DELETE",
659
+ path: requestPath,
660
+ queryParameters,
661
+ headers
662
+ };
663
+ return transporter.request(request, requestOptions);
664
+ },
665
+ /**
666
+ * Delete Provider.
667
+ *
668
+ * Required API Key ACLs:
669
+ * - editSettings
670
+ * @param deleteProvider - The deleteProvider object.
671
+ * @param deleteProvider.providerId - The providerId.
672
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
673
+ */
674
+ deleteProvider({ providerId }, requestOptions) {
675
+ (0, import_client_common.validateRequired)("providerId", "deleteProvider", providerId);
676
+ const requestPath = "/agent-studio/1/providers/{providerId}".replace(
677
+ "{providerId}",
678
+ encodeURIComponent(providerId)
679
+ );
680
+ const headers = {};
681
+ const queryParameters = {};
682
+ const request = {
683
+ method: "DELETE",
684
+ path: requestPath,
685
+ queryParameters,
686
+ headers
687
+ };
688
+ return transporter.request(request, requestOptions);
689
+ },
690
+ /**
691
+ * Delete Secret Key.
692
+ *
693
+ * Required API Key ACLs:
694
+ * - admin
695
+ * @param deleteSecretKey - The deleteSecretKey object.
696
+ * @param deleteSecretKey.secretKeyId - The secretKeyId.
697
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
698
+ */
699
+ deleteSecretKey({ secretKeyId }, requestOptions) {
700
+ (0, import_client_common.validateRequired)("secretKeyId", "deleteSecretKey", secretKeyId);
701
+ const requestPath = "/agent-studio/1/secret-keys/{secretKeyId}".replace(
702
+ "{secretKeyId}",
703
+ encodeURIComponent(secretKeyId)
704
+ );
705
+ const headers = {};
706
+ const queryParameters = {};
707
+ const request = {
708
+ method: "DELETE",
709
+ path: requestPath,
710
+ queryParameters,
711
+ headers
712
+ };
713
+ return transporter.request(request, requestOptions);
714
+ },
715
+ /**
716
+ * Permanently deletes all messages for the given user token. Does not delete conversations.
717
+ *
718
+ * Required API Key ACLs:
719
+ * - logs
720
+ * @param deleteUserData - The deleteUserData object.
721
+ * @param deleteUserData.userToken - The userToken.
722
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
723
+ */
724
+ deleteUserData({ userToken }, requestOptions) {
725
+ (0, import_client_common.validateRequired)("userToken", "deleteUserData", userToken);
726
+ const requestPath = "/agent-studio/1/user-data/{userToken}".replace("{userToken}", encodeURIComponent(userToken));
727
+ const headers = {};
728
+ const queryParameters = {};
729
+ const request = {
730
+ method: "DELETE",
731
+ path: requestPath,
732
+ queryParameters,
733
+ headers
734
+ };
735
+ return transporter.request(request, requestOptions);
736
+ },
737
+ /**
738
+ * Exports all conversations based on the passed filters.
739
+ *
740
+ * Required API Key ACLs:
741
+ * - logs
742
+ * @param exportConversations - The exportConversations object.
743
+ * @param exportConversations.agentId - The agentId.
744
+ * @param exportConversations.startDate - Filter conversations created after this date (format: YYYY-MM-DD).
745
+ * @param exportConversations.endDate - Filter conversations created before this date (format: YYYY-MM-DD).
746
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
747
+ */
748
+ exportConversations({ agentId, startDate, endDate }, requestOptions) {
749
+ (0, import_client_common.validateRequired)("agentId", "exportConversations", agentId);
750
+ const requestPath = "/agent-studio/1/agents/{agentId}/conversations/export".replace(
751
+ "{agentId}",
752
+ encodeURIComponent(agentId)
753
+ );
754
+ const headers = {};
755
+ const queryParameters = {};
756
+ if (startDate !== void 0) {
757
+ queryParameters["startDate"] = startDate.toString();
758
+ }
759
+ if (endDate !== void 0) {
760
+ queryParameters["endDate"] = endDate.toString();
761
+ }
762
+ const request = {
763
+ method: "GET",
764
+ path: requestPath,
765
+ queryParameters,
766
+ headers
767
+ };
768
+ return transporter.request(request, requestOptions);
769
+ },
770
+ /**
771
+ * Retrieve details of the specified agent.
772
+ *
773
+ * Required API Key ACLs:
774
+ * - settings
775
+ * @param getAgent - The getAgent object.
776
+ * @param getAgent.agentId - The agentId.
777
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
778
+ */
779
+ getAgent({ agentId }, requestOptions) {
780
+ (0, import_client_common.validateRequired)("agentId", "getAgent", agentId);
781
+ const requestPath = "/agent-studio/1/agents/{agentId}".replace("{agentId}", encodeURIComponent(agentId));
782
+ const headers = {};
783
+ const queryParameters = {};
784
+ const request = {
785
+ method: "GET",
786
+ path: requestPath,
787
+ queryParameters,
788
+ headers
789
+ };
790
+ return transporter.request(request, requestOptions);
791
+ },
792
+ /**
793
+ * Get a single allowed domain by id.
794
+ *
795
+ * Required API Key ACLs:
796
+ * - settings
797
+ * @param getAllowedDomain - The getAllowedDomain object.
798
+ * @param getAllowedDomain.domainId - The domainId.
799
+ * @param getAllowedDomain.agentId - The agentId.
800
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
801
+ */
802
+ getAllowedDomain({ domainId, agentId }, requestOptions) {
803
+ (0, import_client_common.validateRequired)("domainId", "getAllowedDomain", domainId);
804
+ (0, import_client_common.validateRequired)("agentId", "getAllowedDomain", agentId);
805
+ const requestPath = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}".replace("{domainId}", encodeURIComponent(domainId)).replace("{agentId}", encodeURIComponent(agentId));
806
+ const headers = {};
807
+ const queryParameters = {};
808
+ const request = {
809
+ method: "GET",
810
+ path: requestPath,
811
+ queryParameters,
812
+ headers
813
+ };
814
+ return transporter.request(request, requestOptions);
815
+ },
816
+ /**
817
+ * Get Configuration.
818
+ *
819
+ * Required API Key ACLs:
820
+ * - logs
821
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
822
+ */
823
+ getConfiguration(requestOptions) {
824
+ const requestPath = "/agent-studio/1/configuration";
825
+ const headers = {};
826
+ const queryParameters = {};
827
+ const request = {
828
+ method: "GET",
829
+ path: requestPath,
830
+ queryParameters,
831
+ headers
832
+ };
833
+ return transporter.request(request, requestOptions);
834
+ },
835
+ /**
836
+ * Retrieves the conversation and its messages for the given ID.
837
+ *
838
+ * Required API Key ACLs:
839
+ * - logs
840
+ * @param getConversation - The getConversation object.
841
+ * @param getConversation.conversationId - The conversationId.
842
+ * @param getConversation.agentId - The agentId.
843
+ * @param getConversation.includeFeedback - Include feedback for the conversation.
844
+ * @param getConversation.xAlgoliaSecureUserToken - The X-Algolia-Secure-User-Token.
845
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
846
+ */
847
+ getConversation({ conversationId, agentId, includeFeedback, xAlgoliaSecureUserToken }, requestOptions) {
848
+ (0, import_client_common.validateRequired)("conversationId", "getConversation", conversationId);
849
+ (0, import_client_common.validateRequired)("agentId", "getConversation", agentId);
850
+ const requestPath = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}".replace("{conversationId}", encodeURIComponent(conversationId)).replace("{agentId}", encodeURIComponent(agentId));
851
+ const headers = {};
852
+ const queryParameters = {};
853
+ if (includeFeedback !== void 0) {
854
+ queryParameters["includeFeedback"] = includeFeedback.toString();
855
+ }
856
+ if (xAlgoliaSecureUserToken !== void 0) {
857
+ headers["X-Algolia-Secure-User-Token"] = xAlgoliaSecureUserToken.toString();
858
+ }
859
+ const request = {
860
+ method: "GET",
861
+ path: requestPath,
862
+ queryParameters,
863
+ headers
864
+ };
865
+ return transporter.request(request, requestOptions);
866
+ },
867
+ /**
868
+ * Get Provider.
869
+ *
870
+ * Required API Key ACLs:
871
+ * - settings
872
+ * @param getProvider - The getProvider object.
873
+ * @param getProvider.providerId - The providerId.
874
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
875
+ */
876
+ getProvider({ providerId }, requestOptions) {
877
+ (0, import_client_common.validateRequired)("providerId", "getProvider", providerId);
878
+ const requestPath = "/agent-studio/1/providers/{providerId}".replace(
879
+ "{providerId}",
880
+ encodeURIComponent(providerId)
881
+ );
882
+ const headers = {};
883
+ const queryParameters = {};
884
+ const request = {
885
+ method: "GET",
886
+ path: requestPath,
887
+ queryParameters,
888
+ headers
889
+ };
890
+ return transporter.request(request, requestOptions);
891
+ },
892
+ /**
893
+ * Get Secret Key.
894
+ *
895
+ * Required API Key ACLs:
896
+ * - settings
897
+ * @param getSecretKey - The getSecretKey object.
898
+ * @param getSecretKey.secretKeyId - The secretKeyId.
899
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
900
+ */
901
+ getSecretKey({ secretKeyId }, requestOptions) {
902
+ (0, import_client_common.validateRequired)("secretKeyId", "getSecretKey", secretKeyId);
903
+ const requestPath = "/agent-studio/1/secret-keys/{secretKeyId}".replace(
904
+ "{secretKeyId}",
905
+ encodeURIComponent(secretKeyId)
906
+ );
907
+ const headers = {};
908
+ const queryParameters = {};
909
+ const request = {
910
+ method: "GET",
911
+ path: requestPath,
912
+ queryParameters,
913
+ headers
914
+ };
915
+ return transporter.request(request, requestOptions);
916
+ },
917
+ /**
918
+ * Retrieves all memories, conversations and their messages for the given user token.
919
+ *
920
+ * Required API Key ACLs:
921
+ * - logs
922
+ * @param getUserData - The getUserData object.
923
+ * @param getUserData.userToken - The userToken.
924
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
925
+ */
926
+ getUserData({ userToken }, requestOptions) {
927
+ (0, import_client_common.validateRequired)("userToken", "getUserData", userToken);
928
+ const requestPath = "/agent-studio/1/user-data/{userToken}".replace("{userToken}", encodeURIComponent(userToken));
929
+ const headers = {};
930
+ const queryParameters = {};
931
+ const request = {
932
+ method: "GET",
933
+ path: requestPath,
934
+ queryParameters,
935
+ headers
936
+ };
937
+ return transporter.request(request, requestOptions);
938
+ },
939
+ /**
940
+ * Invalidate cached completions for this agent. Filter with `before` (exclusive).
941
+ *
942
+ * Required API Key ACLs:
943
+ * - editSettings
944
+ * @param invalidateAgentCache - The invalidateAgentCache object.
945
+ * @param invalidateAgentCache.agentId - The agentId.
946
+ * @param invalidateAgentCache.before - Delete entries strictly before this date (exclusive, YYYY-MM-DD).
947
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
948
+ */
949
+ invalidateAgentCache({ agentId, before }, requestOptions) {
950
+ (0, import_client_common.validateRequired)("agentId", "invalidateAgentCache", agentId);
951
+ const requestPath = "/agent-studio/1/agents/{agentId}/cache".replace("{agentId}", encodeURIComponent(agentId));
952
+ const headers = {};
953
+ const queryParameters = {};
954
+ if (before !== void 0) {
955
+ queryParameters["before"] = before.toString();
956
+ }
957
+ const request = {
958
+ method: "DELETE",
959
+ path: requestPath,
960
+ queryParameters,
961
+ headers
962
+ };
963
+ return transporter.request(request, requestOptions);
964
+ },
965
+ /**
966
+ * List all allowed domain patterns for this agent.
967
+ *
968
+ * Required API Key ACLs:
969
+ * - settings
970
+ * @param listAgentAllowedDomains - The listAgentAllowedDomains object.
971
+ * @param listAgentAllowedDomains.agentId - The agentId.
972
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
973
+ */
974
+ listAgentAllowedDomains({ agentId }, requestOptions) {
975
+ (0, import_client_common.validateRequired)("agentId", "listAgentAllowedDomains", agentId);
976
+ const requestPath = "/agent-studio/1/agents/{agentId}/allowed-domains".replace(
977
+ "{agentId}",
978
+ encodeURIComponent(agentId)
979
+ );
980
+ const headers = {};
981
+ const queryParameters = {};
982
+ const request = {
983
+ method: "GET",
984
+ path: requestPath,
985
+ queryParameters,
986
+ headers
987
+ };
988
+ return transporter.request(request, requestOptions);
989
+ },
990
+ /**
991
+ * Retrieves the conversations for the given agent ID.
992
+ *
993
+ * Required API Key ACLs:
994
+ * - logs
995
+ * @param listAgentConversations - The listAgentConversations object.
996
+ * @param listAgentConversations.agentId - The agentId.
997
+ * @param listAgentConversations.startDate - Filter conversations created after this date (format: YYYY-MM-DD).
998
+ * @param listAgentConversations.endDate - Filter conversations created before this date (format: YYYY-MM-DD).
999
+ * @param listAgentConversations.includeFeedback - Include feedback per conversation.
1000
+ * @param listAgentConversations.feedbackVote - Filter by feedback value (requires includeFeedback=true).
1001
+ * @param listAgentConversations.page - Page number.
1002
+ * @param listAgentConversations.limit - Items per page.
1003
+ * @param listAgentConversations.xAlgoliaSecureUserToken - The X-Algolia-Secure-User-Token.
1004
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1005
+ */
1006
+ listAgentConversations({
1007
+ agentId,
1008
+ startDate,
1009
+ endDate,
1010
+ includeFeedback,
1011
+ feedbackVote,
1012
+ page,
1013
+ limit,
1014
+ xAlgoliaSecureUserToken
1015
+ }, requestOptions) {
1016
+ (0, import_client_common.validateRequired)("agentId", "listAgentConversations", agentId);
1017
+ const requestPath = "/agent-studio/1/agents/{agentId}/conversations".replace(
1018
+ "{agentId}",
1019
+ encodeURIComponent(agentId)
1020
+ );
1021
+ const headers = {};
1022
+ const queryParameters = {};
1023
+ if (startDate !== void 0) {
1024
+ queryParameters["startDate"] = startDate.toString();
1025
+ }
1026
+ if (endDate !== void 0) {
1027
+ queryParameters["endDate"] = endDate.toString();
1028
+ }
1029
+ if (includeFeedback !== void 0) {
1030
+ queryParameters["includeFeedback"] = includeFeedback.toString();
1031
+ }
1032
+ if (feedbackVote !== void 0) {
1033
+ queryParameters["feedbackVote"] = feedbackVote.toString();
1034
+ }
1035
+ if (page !== void 0) {
1036
+ queryParameters["page"] = page.toString();
1037
+ }
1038
+ if (limit !== void 0) {
1039
+ queryParameters["limit"] = limit.toString();
1040
+ }
1041
+ if (xAlgoliaSecureUserToken !== void 0) {
1042
+ headers["X-Algolia-Secure-User-Token"] = xAlgoliaSecureUserToken.toString();
1043
+ }
1044
+ const request = {
1045
+ method: "GET",
1046
+ path: requestPath,
1047
+ queryParameters,
1048
+ headers
1049
+ };
1050
+ return transporter.request(request, requestOptions);
1051
+ },
1052
+ /**
1053
+ * List all agents with pagination and filtering.
1054
+ *
1055
+ * Required API Key ACLs:
1056
+ * - settings
1057
+ * @param listAgents - The listAgents object.
1058
+ * @param listAgents.page - Page number.
1059
+ * @param listAgents.limit - Items per page.
1060
+ * @param listAgents.providerId - Filter by provider id.
1061
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1062
+ */
1063
+ listAgents({ page, limit, providerId } = {}, requestOptions = void 0) {
1064
+ const requestPath = "/agent-studio/1/agents";
1065
+ const headers = {};
1066
+ const queryParameters = {};
1067
+ if (page !== void 0) {
1068
+ queryParameters["page"] = page.toString();
1069
+ }
1070
+ if (limit !== void 0) {
1071
+ queryParameters["limit"] = limit.toString();
1072
+ }
1073
+ if (providerId !== void 0) {
1074
+ queryParameters["providerId"] = providerId.toString();
1075
+ }
1076
+ const request = {
1077
+ method: "GET",
1078
+ path: requestPath,
1079
+ queryParameters,
1080
+ headers
1081
+ };
1082
+ return transporter.request(request, requestOptions);
1083
+ },
1084
+ /**
1085
+ * Get Provider Models.
1086
+ *
1087
+ * Required API Key ACLs:
1088
+ * - settings
1089
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1090
+ */
1091
+ listModels(requestOptions) {
1092
+ const requestPath = "/agent-studio/1/providers/models";
1093
+ const headers = {};
1094
+ const queryParameters = {};
1095
+ const request = {
1096
+ method: "GET",
1097
+ path: requestPath,
1098
+ queryParameters,
1099
+ headers
1100
+ };
1101
+ return transporter.request(request, requestOptions);
1102
+ },
1103
+ /**
1104
+ * Get available models for a specific provider.
1105
+ *
1106
+ * Required API Key ACLs:
1107
+ * - settings
1108
+ * @param listProviderModels - The listProviderModels object.
1109
+ * @param listProviderModels.providerId - The providerId.
1110
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1111
+ */
1112
+ listProviderModels({ providerId }, requestOptions) {
1113
+ (0, import_client_common.validateRequired)("providerId", "listProviderModels", providerId);
1114
+ const requestPath = "/agent-studio/1/providers/{providerId}/models".replace(
1115
+ "{providerId}",
1116
+ encodeURIComponent(providerId)
1117
+ );
1118
+ const headers = {};
1119
+ const queryParameters = {};
1120
+ const request = {
1121
+ method: "GET",
1122
+ path: requestPath,
1123
+ queryParameters,
1124
+ headers
1125
+ };
1126
+ return transporter.request(request, requestOptions);
1127
+ },
1128
+ /**
1129
+ * List Providers.
1130
+ *
1131
+ * Required API Key ACLs:
1132
+ * - settings
1133
+ * @param listProviders - The listProviders object.
1134
+ * @param listProviders.page - Page number.
1135
+ * @param listProviders.limit - Items per page.
1136
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1137
+ */
1138
+ listProviders({ page, limit } = {}, requestOptions = void 0) {
1139
+ const requestPath = "/agent-studio/1/providers";
1140
+ const headers = {};
1141
+ const queryParameters = {};
1142
+ if (page !== void 0) {
1143
+ queryParameters["page"] = page.toString();
1144
+ }
1145
+ if (limit !== void 0) {
1146
+ queryParameters["limit"] = limit.toString();
1147
+ }
1148
+ const request = {
1149
+ method: "GET",
1150
+ path: requestPath,
1151
+ queryParameters,
1152
+ headers
1153
+ };
1154
+ return transporter.request(request, requestOptions);
1155
+ },
1156
+ /**
1157
+ * List Secret Keys.
1158
+ *
1159
+ * Required API Key ACLs:
1160
+ * - settings
1161
+ * @param listSecretKeys - The listSecretKeys object.
1162
+ * @param listSecretKeys.page - Page number.
1163
+ * @param listSecretKeys.limit - Items per page.
1164
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1165
+ */
1166
+ listSecretKeys({ page, limit } = {}, requestOptions = void 0) {
1167
+ const requestPath = "/agent-studio/1/secret-keys";
1168
+ const headers = {};
1169
+ const queryParameters = {};
1170
+ if (page !== void 0) {
1171
+ queryParameters["page"] = page.toString();
1172
+ }
1173
+ if (limit !== void 0) {
1174
+ queryParameters["limit"] = limit.toString();
1175
+ }
1176
+ const request = {
1177
+ method: "GET",
1178
+ path: requestPath,
1179
+ queryParameters,
1180
+ headers
1181
+ };
1182
+ return transporter.request(request, requestOptions);
1183
+ },
1184
+ /**
1185
+ * Publish the specified agent.
1186
+ *
1187
+ * Required API Key ACLs:
1188
+ * - editSettings
1189
+ * @param publishAgent - The publishAgent object.
1190
+ * @param publishAgent.agentId - The agentId.
1191
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1192
+ */
1193
+ publishAgent({ agentId }, requestOptions) {
1194
+ (0, import_client_common.validateRequired)("agentId", "publishAgent", agentId);
1195
+ const requestPath = "/agent-studio/1/agents/{agentId}/publish".replace("{agentId}", encodeURIComponent(agentId));
1196
+ const headers = {};
1197
+ const queryParameters = {};
1198
+ const request = {
1199
+ method: "POST",
1200
+ path: requestPath,
1201
+ queryParameters,
1202
+ headers
1203
+ };
1204
+ return transporter.request(request, requestOptions);
1205
+ },
1206
+ /**
1207
+ * Unpublish the specified agent.
1208
+ *
1209
+ * Required API Key ACLs:
1210
+ * - editSettings
1211
+ * @param unpublishAgent - The unpublishAgent object.
1212
+ * @param unpublishAgent.agentId - The agentId.
1213
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1214
+ */
1215
+ unpublishAgent({ agentId }, requestOptions) {
1216
+ (0, import_client_common.validateRequired)("agentId", "unpublishAgent", agentId);
1217
+ const requestPath = "/agent-studio/1/agents/{agentId}/unpublish".replace(
1218
+ "{agentId}",
1219
+ encodeURIComponent(agentId)
1220
+ );
1221
+ const headers = {};
1222
+ const queryParameters = {};
1223
+ const request = {
1224
+ method: "POST",
1225
+ path: requestPath,
1226
+ queryParameters,
1227
+ headers
1228
+ };
1229
+ return transporter.request(request, requestOptions);
1230
+ },
1231
+ /**
1232
+ * Update the specified agent.
1233
+ *
1234
+ * Required API Key ACLs:
1235
+ * - editSettings
1236
+ * @param updateAgent - The updateAgent object.
1237
+ * @param updateAgent.agentId - The agentId.
1238
+ * @param updateAgent.agentConfigUpdate - The agentConfigUpdate object.
1239
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1240
+ */
1241
+ updateAgent({ agentId, agentConfigUpdate }, requestOptions) {
1242
+ (0, import_client_common.validateRequired)("agentId", "updateAgent", agentId);
1243
+ (0, import_client_common.validateRequired)("agentConfigUpdate", "updateAgent", agentConfigUpdate);
1244
+ const requestPath = "/agent-studio/1/agents/{agentId}".replace("{agentId}", encodeURIComponent(agentId));
1245
+ const headers = {};
1246
+ const queryParameters = {};
1247
+ const request = {
1248
+ method: "PATCH",
1249
+ path: requestPath,
1250
+ queryParameters,
1251
+ headers,
1252
+ data: agentConfigUpdate
1253
+ };
1254
+ return transporter.request(request, requestOptions);
1255
+ },
1256
+ /**
1257
+ * Patch Configuration.
1258
+ *
1259
+ * Required API Key ACLs:
1260
+ * - logs
1261
+ * @param applicationConfigPatch - The applicationConfigPatch object.
1262
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1263
+ */
1264
+ updateConfiguration(applicationConfigPatch, requestOptions) {
1265
+ (0, import_client_common.validateRequired)("applicationConfigPatch", "updateConfiguration", applicationConfigPatch);
1266
+ const requestPath = "/agent-studio/1/configuration";
1267
+ const headers = {};
1268
+ const queryParameters = {};
1269
+ const request = {
1270
+ method: "PATCH",
1271
+ path: requestPath,
1272
+ queryParameters,
1273
+ headers,
1274
+ data: applicationConfigPatch
1275
+ };
1276
+ return transporter.request(request, requestOptions);
1277
+ },
1278
+ /**
1279
+ * Update Provider.
1280
+ *
1281
+ * Required API Key ACLs:
1282
+ * - editSettings
1283
+ * @param updateProvider - The updateProvider object.
1284
+ * @param updateProvider.providerId - The providerId.
1285
+ * @param updateProvider.providerAuthenticationPatch - The providerAuthenticationPatch object.
1286
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1287
+ */
1288
+ updateProvider({ providerId, providerAuthenticationPatch }, requestOptions) {
1289
+ (0, import_client_common.validateRequired)("providerId", "updateProvider", providerId);
1290
+ (0, import_client_common.validateRequired)("providerAuthenticationPatch", "updateProvider", providerAuthenticationPatch);
1291
+ const requestPath = "/agent-studio/1/providers/{providerId}".replace(
1292
+ "{providerId}",
1293
+ encodeURIComponent(providerId)
1294
+ );
1295
+ const headers = {};
1296
+ const queryParameters = {};
1297
+ const request = {
1298
+ method: "PATCH",
1299
+ path: requestPath,
1300
+ queryParameters,
1301
+ headers,
1302
+ data: providerAuthenticationPatch
1303
+ };
1304
+ return transporter.request(request, requestOptions);
1305
+ },
1306
+ /**
1307
+ * Patch Secret Key.
1308
+ *
1309
+ * Required API Key ACLs:
1310
+ * - admin
1311
+ * @param updateSecretKey - The updateSecretKey object.
1312
+ * @param updateSecretKey.secretKeyId - The secretKeyId.
1313
+ * @param updateSecretKey.secretKeyPatch - The secretKeyPatch object.
1314
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1315
+ */
1316
+ updateSecretKey({ secretKeyId, secretKeyPatch }, requestOptions) {
1317
+ (0, import_client_common.validateRequired)("secretKeyId", "updateSecretKey", secretKeyId);
1318
+ (0, import_client_common.validateRequired)("secretKeyPatch", "updateSecretKey", secretKeyPatch);
1319
+ const requestPath = "/agent-studio/1/secret-keys/{secretKeyId}".replace(
1320
+ "{secretKeyId}",
1321
+ encodeURIComponent(secretKeyId)
1322
+ );
1323
+ const headers = {};
1324
+ const queryParameters = {};
1325
+ const request = {
1326
+ method: "PATCH",
1327
+ path: requestPath,
1328
+ queryParameters,
1329
+ headers,
1330
+ data: secretKeyPatch
1331
+ };
1332
+ return transporter.request(request, requestOptions);
1333
+ }
1334
+ };
1335
+ }
1336
+ // Annotate the CommonJS export names for ESM import in node:
1337
+ 0 && (module.exports = {
1338
+ apiClientVersion,
1339
+ createAgentStudioClient
1340
+ });
1341
+ //# sourceMappingURL=agentStudioClient.cjs.map