@easyedu/js-lsm-api 1.103.0 → 1.104.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.
Files changed (98) hide show
  1. package/.openapi-generator/FILES +28 -0
  2. package/README.md +22 -2
  3. package/dist/apis/ChatApi.d.ts +98 -0
  4. package/dist/apis/ChatApi.js +255 -0
  5. package/dist/esm/apis/ChatApi.d.ts +98 -0
  6. package/dist/esm/apis/ChatApi.js +255 -0
  7. package/dist/esm/models/AdminChatMessage.d.ts +51 -0
  8. package/dist/esm/models/AdminChatMessage.js +54 -0
  9. package/dist/esm/models/AdminConversationDetail.d.ts +90 -0
  10. package/dist/esm/models/AdminConversationDetail.js +81 -0
  11. package/dist/esm/models/AdminConversationList.d.ts +57 -0
  12. package/dist/esm/models/AdminConversationList.js +60 -0
  13. package/dist/esm/models/AdminConversationSummary.d.ts +83 -0
  14. package/dist/esm/models/AdminConversationSummary.js +76 -0
  15. package/dist/esm/models/ChatDailyUsage.d.ts +39 -0
  16. package/dist/esm/models/ChatDailyUsage.js +48 -0
  17. package/dist/esm/models/ChatModelUsage.d.ts +68 -0
  18. package/dist/esm/models/ChatModelUsage.js +67 -0
  19. package/dist/esm/models/ChatQuota.d.ts +56 -0
  20. package/dist/esm/models/ChatQuota.js +59 -0
  21. package/dist/esm/models/ChatQuotaExceeded.d.ts +56 -0
  22. package/dist/esm/models/ChatQuotaExceeded.js +59 -0
  23. package/dist/esm/models/ChatTurnUsage.d.ts +82 -0
  24. package/dist/esm/models/ChatTurnUsage.js +78 -0
  25. package/dist/esm/models/ChatUsageTotals.d.ts +68 -0
  26. package/dist/esm/models/ChatUsageTotals.js +67 -0
  27. package/dist/esm/models/ChatUserIdentity.d.ts +50 -0
  28. package/dist/esm/models/ChatUserIdentity.js +55 -0
  29. package/dist/esm/models/GetChatSettings.d.ts +51 -0
  30. package/dist/esm/models/GetChatSettings.js +57 -0
  31. package/dist/esm/models/GetChatUsage.d.ts +59 -0
  32. package/dist/esm/models/GetChatUsage.js +62 -0
  33. package/dist/esm/models/PutChatSettings.d.ts +32 -0
  34. package/dist/esm/models/PutChatSettings.js +43 -0
  35. package/dist/esm/models/index.d.ts +14 -0
  36. package/dist/esm/models/index.js +14 -0
  37. package/dist/models/AdminChatMessage.d.ts +51 -0
  38. package/dist/models/AdminChatMessage.js +61 -0
  39. package/dist/models/AdminConversationDetail.d.ts +90 -0
  40. package/dist/models/AdminConversationDetail.js +88 -0
  41. package/dist/models/AdminConversationList.d.ts +57 -0
  42. package/dist/models/AdminConversationList.js +67 -0
  43. package/dist/models/AdminConversationSummary.d.ts +83 -0
  44. package/dist/models/AdminConversationSummary.js +83 -0
  45. package/dist/models/ChatDailyUsage.d.ts +39 -0
  46. package/dist/models/ChatDailyUsage.js +55 -0
  47. package/dist/models/ChatModelUsage.d.ts +68 -0
  48. package/dist/models/ChatModelUsage.js +74 -0
  49. package/dist/models/ChatQuota.d.ts +56 -0
  50. package/dist/models/ChatQuota.js +66 -0
  51. package/dist/models/ChatQuotaExceeded.d.ts +56 -0
  52. package/dist/models/ChatQuotaExceeded.js +66 -0
  53. package/dist/models/ChatTurnUsage.d.ts +82 -0
  54. package/dist/models/ChatTurnUsage.js +86 -0
  55. package/dist/models/ChatUsageTotals.d.ts +68 -0
  56. package/dist/models/ChatUsageTotals.js +74 -0
  57. package/dist/models/ChatUserIdentity.d.ts +50 -0
  58. package/dist/models/ChatUserIdentity.js +62 -0
  59. package/dist/models/GetChatSettings.d.ts +51 -0
  60. package/dist/models/GetChatSettings.js +65 -0
  61. package/dist/models/GetChatUsage.d.ts +59 -0
  62. package/dist/models/GetChatUsage.js +69 -0
  63. package/dist/models/PutChatSettings.d.ts +32 -0
  64. package/dist/models/PutChatSettings.js +50 -0
  65. package/dist/models/index.d.ts +14 -0
  66. package/dist/models/index.js +14 -0
  67. package/docs/AdminChatMessage.md +40 -0
  68. package/docs/AdminConversationDetail.md +52 -0
  69. package/docs/AdminConversationList.md +42 -0
  70. package/docs/AdminConversationSummary.md +50 -0
  71. package/docs/ChatApi.md +422 -0
  72. package/docs/ChatDailyUsage.md +36 -0
  73. package/docs/ChatModelUsage.md +46 -0
  74. package/docs/ChatQuota.md +42 -0
  75. package/docs/ChatQuotaExceeded.md +42 -0
  76. package/docs/ChatTurnUsage.md +48 -0
  77. package/docs/ChatUsageTotals.md +46 -0
  78. package/docs/ChatUserIdentity.md +40 -0
  79. package/docs/GetChatSettings.md +38 -0
  80. package/docs/GetChatUsage.md +42 -0
  81. package/docs/PutChatSettings.md +34 -0
  82. package/package.json +1 -1
  83. package/src/apis/ChatApi.ts +339 -0
  84. package/src/models/AdminChatMessage.ts +100 -0
  85. package/src/models/AdminConversationDetail.ts +175 -0
  86. package/src/models/AdminConversationList.ts +110 -0
  87. package/src/models/AdminConversationSummary.ts +159 -0
  88. package/src/models/ChatDailyUsage.ts +83 -0
  89. package/src/models/ChatModelUsage.ts +120 -0
  90. package/src/models/ChatQuota.ts +102 -0
  91. package/src/models/ChatQuotaExceeded.ts +102 -0
  92. package/src/models/ChatTurnUsage.ts +140 -0
  93. package/src/models/ChatUsageTotals.ts +120 -0
  94. package/src/models/ChatUserIdentity.ts +93 -0
  95. package/src/models/GetChatSettings.ts +94 -0
  96. package/src/models/GetChatUsage.ts +124 -0
  97. package/src/models/PutChatSettings.ts +66 -0
  98. package/src/models/index.ts +14 -0
@@ -0,0 +1,40 @@
1
+
2
+ # ChatUserIdentity
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `firstName` | string
11
+ `lastName` | string
12
+ `email` | string
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { ChatUserIdentity } from '@easyedu/js-lsm-api'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "id": null,
22
+ "firstName": null,
23
+ "lastName": null,
24
+ "email": null,
25
+ } satisfies ChatUserIdentity
26
+
27
+ console.log(example)
28
+
29
+ // Convert the instance to a JSON string
30
+ const exampleJSON: string = JSON.stringify(example)
31
+ console.log(exampleJSON)
32
+
33
+ // Parse the JSON string back to an object
34
+ const exampleParsed = JSON.parse(exampleJSON) as ChatUserIdentity
35
+ console.log(exampleParsed)
36
+ ```
37
+
38
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
39
+
40
+
@@ -0,0 +1,38 @@
1
+
2
+ # GetChatSettings
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `learnerDailyMessageLimit` | number
10
+ `resetPolicy` | string
11
+ `updatedAt` | number
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { GetChatSettings } from '@easyedu/js-lsm-api'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "learnerDailyMessageLimit": null,
21
+ "resetPolicy": null,
22
+ "updatedAt": null,
23
+ } satisfies GetChatSettings
24
+
25
+ console.log(example)
26
+
27
+ // Convert the instance to a JSON string
28
+ const exampleJSON: string = JSON.stringify(example)
29
+ console.log(exampleJSON)
30
+
31
+ // Parse the JSON string back to an object
32
+ const exampleParsed = JSON.parse(exampleJSON) as GetChatSettings
33
+ console.log(exampleParsed)
34
+ ```
35
+
36
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
37
+
38
+
@@ -0,0 +1,42 @@
1
+
2
+ # GetChatUsage
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `from` | number
10
+ `to` | number
11
+ `totals` | [ChatUsageTotals](ChatUsageTotals.md)
12
+ `daily` | [Array<ChatDailyUsage>](ChatDailyUsage.md)
13
+ `modelUsage` | [Array<ChatModelUsage>](ChatModelUsage.md)
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { GetChatUsage } from '@easyedu/js-lsm-api'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "from": null,
23
+ "to": null,
24
+ "totals": null,
25
+ "daily": null,
26
+ "modelUsage": null,
27
+ } satisfies GetChatUsage
28
+
29
+ console.log(example)
30
+
31
+ // Convert the instance to a JSON string
32
+ const exampleJSON: string = JSON.stringify(example)
33
+ console.log(exampleJSON)
34
+
35
+ // Parse the JSON string back to an object
36
+ const exampleParsed = JSON.parse(exampleJSON) as GetChatUsage
37
+ console.log(exampleParsed)
38
+ ```
39
+
40
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
41
+
42
+
@@ -0,0 +1,34 @@
1
+
2
+ # PutChatSettings
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `learnerDailyMessageLimit` | number
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { PutChatSettings } from '@easyedu/js-lsm-api'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ "learnerDailyMessageLimit": null,
19
+ } satisfies PutChatSettings
20
+
21
+ console.log(example)
22
+
23
+ // Convert the instance to a JSON string
24
+ const exampleJSON: string = JSON.stringify(example)
25
+ console.log(exampleJSON)
26
+
27
+ // Parse the JSON string back to an object
28
+ const exampleParsed = JSON.parse(exampleJSON) as PutChatSettings
29
+ console.log(exampleParsed)
30
+ ```
31
+
32
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
33
+
34
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyedu/js-lsm-api",
3
- "version": "1.103.0",
3
+ "version": "1.104.0",
4
4
  "description": "OpenAPI client for @easyedu/js-lsm-api",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -13,11 +13,41 @@
13
13
  */
14
14
 
15
15
  import * as runtime from '../runtime';
16
+ import {
17
+ type AdminConversationDetail,
18
+ AdminConversationDetailFromJSON,
19
+ AdminConversationDetailToJSON,
20
+ } from '../models/AdminConversationDetail';
21
+ import {
22
+ type AdminConversationList,
23
+ AdminConversationListFromJSON,
24
+ AdminConversationListToJSON,
25
+ } from '../models/AdminConversationList';
26
+ import {
27
+ type ChatQuota,
28
+ ChatQuotaFromJSON,
29
+ ChatQuotaToJSON,
30
+ } from '../models/ChatQuota';
31
+ import {
32
+ type ChatQuotaExceeded,
33
+ ChatQuotaExceededFromJSON,
34
+ ChatQuotaExceededToJSON,
35
+ } from '../models/ChatQuotaExceeded';
16
36
  import {
17
37
  type GetChatMessage,
18
38
  GetChatMessageFromJSON,
19
39
  GetChatMessageToJSON,
20
40
  } from '../models/GetChatMessage';
41
+ import {
42
+ type GetChatSettings,
43
+ GetChatSettingsFromJSON,
44
+ GetChatSettingsToJSON,
45
+ } from '../models/GetChatSettings';
46
+ import {
47
+ type GetChatUsage,
48
+ GetChatUsageFromJSON,
49
+ GetChatUsageToJSON,
50
+ } from '../models/GetChatUsage';
21
51
  import {
22
52
  type GetConversationList,
23
53
  GetConversationListFromJSON,
@@ -43,11 +73,36 @@ import {
43
73
  PostMessageResponseFromJSON,
44
74
  PostMessageResponseToJSON,
45
75
  } from '../models/PostMessageResponse';
76
+ import {
77
+ type PutChatSettings,
78
+ PutChatSettingsFromJSON,
79
+ PutChatSettingsToJSON,
80
+ } from '../models/PutChatSettings';
46
81
 
47
82
  export interface DeleteConversationRequest {
48
83
  conversationId: string;
49
84
  }
50
85
 
86
+ export interface GetChatAdminConversationRequest {
87
+ conversationId: string;
88
+ }
89
+
90
+ export interface GetChatAdminConversationsRequest {
91
+ page?: number;
92
+ pageSize?: number;
93
+ userId?: string;
94
+ model?: string;
95
+ createdFrom?: number;
96
+ createdTo?: number;
97
+ }
98
+
99
+ export interface GetChatAdminUsageRequest {
100
+ userId?: string;
101
+ model?: string;
102
+ from?: number;
103
+ to?: number;
104
+ }
105
+
51
106
  export interface GetConversationMessagesRequest {
52
107
  conversationId: string;
53
108
  }
@@ -66,6 +121,10 @@ export interface PostMessageRequest {
66
121
  postMessage: PostMessage;
67
122
  }
68
123
 
124
+ export interface PutChatAdminSettingsRequest {
125
+ putChatSettings: PutChatSettings;
126
+ }
127
+
69
128
  /**
70
129
  *
71
130
  */
@@ -115,6 +174,239 @@ export class ChatApi extends runtime.BaseAPI {
115
174
  await this.deleteConversationRaw(requestParameters, initOverrides);
116
175
  }
117
176
 
177
+ /**
178
+ * Creates request options for getChatAdminConversation without sending the request
179
+ */
180
+ async getChatAdminConversationRequestOpts(requestParameters: GetChatAdminConversationRequest): Promise<runtime.RequestOpts> {
181
+ if (requestParameters['conversationId'] == null) {
182
+ throw new runtime.RequiredError(
183
+ 'conversationId',
184
+ 'Required parameter "conversationId" was null or undefined when calling getChatAdminConversation().'
185
+ );
186
+ }
187
+
188
+ const queryParameters: any = {};
189
+
190
+ const headerParameters: runtime.HTTPHeaders = {};
191
+
192
+
193
+ let urlPath = `/chat/admin/conversations/{conversationId}`;
194
+ urlPath = urlPath.replace('{conversationId}', encodeURIComponent(String(requestParameters['conversationId'])));
195
+
196
+ return {
197
+ path: urlPath,
198
+ method: 'GET',
199
+ headers: headerParameters,
200
+ query: queryParameters,
201
+ };
202
+ }
203
+
204
+ /**
205
+ * Get a conversation transcript from the selected portal
206
+ */
207
+ async getChatAdminConversationRaw(requestParameters: GetChatAdminConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminConversationDetail>> {
208
+ const requestOptions = await this.getChatAdminConversationRequestOpts(requestParameters);
209
+ const response = await this.request(requestOptions, initOverrides);
210
+
211
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminConversationDetailFromJSON(jsonValue));
212
+ }
213
+
214
+ /**
215
+ * Get a conversation transcript from the selected portal
216
+ */
217
+ async getChatAdminConversation(requestParameters: GetChatAdminConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminConversationDetail> {
218
+ const response = await this.getChatAdminConversationRaw(requestParameters, initOverrides);
219
+ return await response.value();
220
+ }
221
+
222
+ /**
223
+ * Creates request options for getChatAdminConversations without sending the request
224
+ */
225
+ async getChatAdminConversationsRequestOpts(requestParameters: GetChatAdminConversationsRequest): Promise<runtime.RequestOpts> {
226
+ const queryParameters: any = {};
227
+
228
+ if (requestParameters['page'] != null) {
229
+ queryParameters['page'] = requestParameters['page'];
230
+ }
231
+
232
+ if (requestParameters['pageSize'] != null) {
233
+ queryParameters['pageSize'] = requestParameters['pageSize'];
234
+ }
235
+
236
+ if (requestParameters['userId'] != null) {
237
+ queryParameters['userId'] = requestParameters['userId'];
238
+ }
239
+
240
+ if (requestParameters['model'] != null) {
241
+ queryParameters['model'] = requestParameters['model'];
242
+ }
243
+
244
+ if (requestParameters['createdFrom'] != null) {
245
+ queryParameters['createdFrom'] = requestParameters['createdFrom'];
246
+ }
247
+
248
+ if (requestParameters['createdTo'] != null) {
249
+ queryParameters['createdTo'] = requestParameters['createdTo'];
250
+ }
251
+
252
+ const headerParameters: runtime.HTTPHeaders = {};
253
+
254
+
255
+ let urlPath = `/chat/admin/conversations`;
256
+
257
+ return {
258
+ path: urlPath,
259
+ method: 'GET',
260
+ headers: headerParameters,
261
+ query: queryParameters,
262
+ };
263
+ }
264
+
265
+ /**
266
+ * List conversations in the selected portal
267
+ */
268
+ async getChatAdminConversationsRaw(requestParameters: GetChatAdminConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminConversationList>> {
269
+ const requestOptions = await this.getChatAdminConversationsRequestOpts(requestParameters);
270
+ const response = await this.request(requestOptions, initOverrides);
271
+
272
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminConversationListFromJSON(jsonValue));
273
+ }
274
+
275
+ /**
276
+ * List conversations in the selected portal
277
+ */
278
+ async getChatAdminConversations(requestParameters: GetChatAdminConversationsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminConversationList> {
279
+ const response = await this.getChatAdminConversationsRaw(requestParameters, initOverrides);
280
+ return await response.value();
281
+ }
282
+
283
+ /**
284
+ * Creates request options for getChatAdminSettings without sending the request
285
+ */
286
+ async getChatAdminSettingsRequestOpts(): Promise<runtime.RequestOpts> {
287
+ const queryParameters: any = {};
288
+
289
+ const headerParameters: runtime.HTTPHeaders = {};
290
+
291
+
292
+ let urlPath = `/chat/admin/settings`;
293
+
294
+ return {
295
+ path: urlPath,
296
+ method: 'GET',
297
+ headers: headerParameters,
298
+ query: queryParameters,
299
+ };
300
+ }
301
+
302
+ /**
303
+ * Get chatbot settings for the selected portal
304
+ */
305
+ async getChatAdminSettingsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetChatSettings>> {
306
+ const requestOptions = await this.getChatAdminSettingsRequestOpts();
307
+ const response = await this.request(requestOptions, initOverrides);
308
+
309
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetChatSettingsFromJSON(jsonValue));
310
+ }
311
+
312
+ /**
313
+ * Get chatbot settings for the selected portal
314
+ */
315
+ async getChatAdminSettings(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetChatSettings> {
316
+ const response = await this.getChatAdminSettingsRaw(initOverrides);
317
+ return await response.value();
318
+ }
319
+
320
+ /**
321
+ * Creates request options for getChatAdminUsage without sending the request
322
+ */
323
+ async getChatAdminUsageRequestOpts(requestParameters: GetChatAdminUsageRequest): Promise<runtime.RequestOpts> {
324
+ const queryParameters: any = {};
325
+
326
+ if (requestParameters['userId'] != null) {
327
+ queryParameters['userId'] = requestParameters['userId'];
328
+ }
329
+
330
+ if (requestParameters['model'] != null) {
331
+ queryParameters['model'] = requestParameters['model'];
332
+ }
333
+
334
+ if (requestParameters['from'] != null) {
335
+ queryParameters['from'] = requestParameters['from'];
336
+ }
337
+
338
+ if (requestParameters['to'] != null) {
339
+ queryParameters['to'] = requestParameters['to'];
340
+ }
341
+
342
+ const headerParameters: runtime.HTTPHeaders = {};
343
+
344
+
345
+ let urlPath = `/chat/admin/usage`;
346
+
347
+ return {
348
+ path: urlPath,
349
+ method: 'GET',
350
+ headers: headerParameters,
351
+ query: queryParameters,
352
+ };
353
+ }
354
+
355
+ /**
356
+ * Get chatbot usage analytics for the selected portal
357
+ */
358
+ async getChatAdminUsageRaw(requestParameters: GetChatAdminUsageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetChatUsage>> {
359
+ const requestOptions = await this.getChatAdminUsageRequestOpts(requestParameters);
360
+ const response = await this.request(requestOptions, initOverrides);
361
+
362
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetChatUsageFromJSON(jsonValue));
363
+ }
364
+
365
+ /**
366
+ * Get chatbot usage analytics for the selected portal
367
+ */
368
+ async getChatAdminUsage(requestParameters: GetChatAdminUsageRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetChatUsage> {
369
+ const response = await this.getChatAdminUsageRaw(requestParameters, initOverrides);
370
+ return await response.value();
371
+ }
372
+
373
+ /**
374
+ * Creates request options for getChatQuota without sending the request
375
+ */
376
+ async getChatQuotaRequestOpts(): Promise<runtime.RequestOpts> {
377
+ const queryParameters: any = {};
378
+
379
+ const headerParameters: runtime.HTTPHeaders = {};
380
+
381
+
382
+ let urlPath = `/chat/quota`;
383
+
384
+ return {
385
+ path: urlPath,
386
+ method: 'GET',
387
+ headers: headerParameters,
388
+ query: queryParameters,
389
+ };
390
+ }
391
+
392
+ /**
393
+ * Get the current user\'s chat quota
394
+ */
395
+ async getChatQuotaRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatQuota>> {
396
+ const requestOptions = await this.getChatQuotaRequestOpts();
397
+ const response = await this.request(requestOptions, initOverrides);
398
+
399
+ return new runtime.JSONApiResponse(response, (jsonValue) => ChatQuotaFromJSON(jsonValue));
400
+ }
401
+
402
+ /**
403
+ * Get the current user\'s chat quota
404
+ */
405
+ async getChatQuota(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatQuota> {
406
+ const response = await this.getChatQuotaRaw(initOverrides);
407
+ return await response.value();
408
+ }
409
+
118
410
  /**
119
411
  * Creates request options for getConversationMessages without sending the request
120
412
  */
@@ -307,4 +599,51 @@ export class ChatApi extends runtime.BaseAPI {
307
599
  return await response.value();
308
600
  }
309
601
 
602
+ /**
603
+ * Creates request options for putChatAdminSettings without sending the request
604
+ */
605
+ async putChatAdminSettingsRequestOpts(requestParameters: PutChatAdminSettingsRequest): Promise<runtime.RequestOpts> {
606
+ if (requestParameters['putChatSettings'] == null) {
607
+ throw new runtime.RequiredError(
608
+ 'putChatSettings',
609
+ 'Required parameter "putChatSettings" was null or undefined when calling putChatAdminSettings().'
610
+ );
611
+ }
612
+
613
+ const queryParameters: any = {};
614
+
615
+ const headerParameters: runtime.HTTPHeaders = {};
616
+
617
+ headerParameters['Content-Type'] = 'application/json';
618
+
619
+
620
+ let urlPath = `/chat/admin/settings`;
621
+
622
+ return {
623
+ path: urlPath,
624
+ method: 'PUT',
625
+ headers: headerParameters,
626
+ query: queryParameters,
627
+ body: PutChatSettingsToJSON(requestParameters['putChatSettings']),
628
+ };
629
+ }
630
+
631
+ /**
632
+ * Update chatbot settings for the selected portal
633
+ */
634
+ async putChatAdminSettingsRaw(requestParameters: PutChatAdminSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetChatSettings>> {
635
+ const requestOptions = await this.putChatAdminSettingsRequestOpts(requestParameters);
636
+ const response = await this.request(requestOptions, initOverrides);
637
+
638
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetChatSettingsFromJSON(jsonValue));
639
+ }
640
+
641
+ /**
642
+ * Update chatbot settings for the selected portal
643
+ */
644
+ async putChatAdminSettings(requestParameters: PutChatAdminSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetChatSettings> {
645
+ const response = await this.putChatAdminSettingsRaw(requestParameters, initOverrides);
646
+ return await response.value();
647
+ }
648
+
310
649
  }
@@ -0,0 +1,100 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * LMS API
5
+ * LMS API
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ChatTurnUsage } from './ChatTurnUsage';
17
+ import {
18
+ ChatTurnUsageFromJSON,
19
+ ChatTurnUsageFromJSONTyped,
20
+ ChatTurnUsageToJSON,
21
+ ChatTurnUsageToJSONTyped,
22
+ } from './ChatTurnUsage';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface AdminChatMessage
28
+ */
29
+ export interface AdminChatMessage {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof AdminChatMessage
34
+ */
35
+ role: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AdminChatMessage
40
+ */
41
+ content: string;
42
+ /**
43
+ *
44
+ * @type {number}
45
+ * @memberof AdminChatMessage
46
+ */
47
+ createdAt: number;
48
+ /**
49
+ *
50
+ * @type {ChatTurnUsage}
51
+ * @memberof AdminChatMessage
52
+ */
53
+ usage?: ChatTurnUsage | null;
54
+ }
55
+
56
+ /**
57
+ * Check if a given object implements the AdminChatMessage interface.
58
+ */
59
+ export function instanceOfAdminChatMessage(value: object): value is AdminChatMessage {
60
+ if (!('role' in value) || value['role'] === undefined) return false;
61
+ if (!('content' in value) || value['content'] === undefined) return false;
62
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
63
+ return true;
64
+ }
65
+
66
+ export function AdminChatMessageFromJSON(json: any): AdminChatMessage {
67
+ return AdminChatMessageFromJSONTyped(json, false);
68
+ }
69
+
70
+ export function AdminChatMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminChatMessage {
71
+ if (json == null) {
72
+ return json;
73
+ }
74
+ return {
75
+
76
+ 'role': json['role'],
77
+ 'content': json['content'],
78
+ 'createdAt': json['created_at'],
79
+ 'usage': json['usage'] == null ? undefined : ChatTurnUsageFromJSON(json['usage']),
80
+ };
81
+ }
82
+
83
+ export function AdminChatMessageToJSON(json: any): AdminChatMessage {
84
+ return AdminChatMessageToJSONTyped(json, false);
85
+ }
86
+
87
+ export function AdminChatMessageToJSONTyped(value?: AdminChatMessage | null, ignoreDiscriminator: boolean = false): any {
88
+ if (value == null) {
89
+ return value;
90
+ }
91
+
92
+ return {
93
+
94
+ 'role': value['role'],
95
+ 'content': value['content'],
96
+ 'created_at': value['createdAt'],
97
+ 'usage': ChatTurnUsageToJSON(value['usage']),
98
+ };
99
+ }
100
+