@vendasta/ai-assistants 0.2.0 → 0.4.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.
@@ -183,13 +183,19 @@ function enumStringToValue$7(enumRef, value) {
183
183
  }
184
184
  return enumRef[value];
185
185
  }
186
- class Connection {
186
+ class Assistant {
187
187
  static fromProto(proto) {
188
- let m = new Connection();
188
+ let m = new Assistant();
189
189
  m = Object.assign(m, proto);
190
190
  if (proto.namespace) {
191
191
  m.namespace = Namespace.fromProto(proto.namespace);
192
192
  }
193
+ if (proto.type) {
194
+ m.type = enumStringToValue$7(AssistantType, proto.type);
195
+ }
196
+ if (proto.config) {
197
+ m.config = Config.fromProto(proto.config);
198
+ }
193
199
  return m;
194
200
  }
195
201
  constructor(kwargs) {
@@ -209,24 +215,21 @@ class Connection {
209
215
  if (typeof this.name !== 'undefined') {
210
216
  toReturn['name'] = this.name;
211
217
  }
212
- if (typeof this.configurationUrl !== 'undefined') {
213
- toReturn['configurationUrl'] = this.configurationUrl;
214
- }
215
- if (typeof this.connectionType !== 'undefined') {
216
- toReturn['connectionType'] = this.connectionType;
218
+ if (typeof this.type !== 'undefined') {
219
+ toReturn['type'] = this.type;
217
220
  }
218
- if (typeof this.connectionTypeName !== 'undefined') {
219
- toReturn['connectionTypeName'] = this.connectionTypeName;
221
+ if (typeof this.avatarUrl !== 'undefined') {
222
+ toReturn['avatarUrl'] = this.avatarUrl;
220
223
  }
221
- if (typeof this.iconUrl !== 'undefined') {
222
- toReturn['iconUrl'] = this.iconUrl;
224
+ if (typeof this.config !== 'undefined' && this.config !== null) {
225
+ toReturn['config'] = 'toApiJson' in this.config ? this.config.toApiJson() : this.config;
223
226
  }
224
227
  return toReturn;
225
228
  }
226
229
  }
227
- class ConnectionKey {
230
+ class AssistantKey {
228
231
  static fromProto(proto) {
229
- let m = new ConnectionKey();
232
+ let m = new AssistantKey();
230
233
  m = Object.assign(m, proto);
231
234
  if (proto.namespace) {
232
235
  m.namespace = Namespace.fromProto(proto.namespace);
@@ -247,8 +250,51 @@ class ConnectionKey {
247
250
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
248
251
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
249
252
  }
250
- if (typeof this.connectionType !== 'undefined') {
251
- toReturn['connectionType'] = this.connectionType;
253
+ return toReturn;
254
+ }
255
+ }
256
+ class Config {
257
+ static fromProto(proto) {
258
+ let m = new Config();
259
+ m = Object.assign(m, proto);
260
+ if (proto.inboxConfig) {
261
+ m.inboxConfig = ConfigInboxConfig.fromProto(proto.inboxConfig);
262
+ }
263
+ return m;
264
+ }
265
+ constructor(kwargs) {
266
+ if (!kwargs) {
267
+ return;
268
+ }
269
+ Object.assign(this, kwargs);
270
+ }
271
+ toApiJson() {
272
+ const toReturn = {};
273
+ if (typeof this.inboxConfig !== 'undefined' && this.inboxConfig !== null) {
274
+ toReturn['inboxConfig'] = 'toApiJson' in this.inboxConfig ? this.inboxConfig.toApiJson() : this.inboxConfig;
275
+ }
276
+ return toReturn;
277
+ }
278
+ }
279
+ class ConfigInboxConfig {
280
+ static fromProto(proto) {
281
+ let m = new ConfigInboxConfig();
282
+ m = Object.assign(m, proto);
283
+ return m;
284
+ }
285
+ constructor(kwargs) {
286
+ if (!kwargs) {
287
+ return;
288
+ }
289
+ Object.assign(this, kwargs);
290
+ }
291
+ toApiJson() {
292
+ const toReturn = {};
293
+ if (typeof this.leadCaptureEnabled !== 'undefined') {
294
+ toReturn['leadCaptureEnabled'] = this.leadCaptureEnabled;
295
+ }
296
+ if (typeof this.additionalInstructions !== 'undefined') {
297
+ toReturn['additionalInstructions'] = this.additionalInstructions;
252
298
  }
253
299
  return toReturn;
254
300
  }
@@ -260,18 +306,15 @@ function enumStringToValue$6(enumRef, value) {
260
306
  }
261
307
  return enumRef[value];
262
308
  }
263
- class Assistant {
309
+ class Connection {
264
310
  static fromProto(proto) {
265
- let m = new Assistant();
311
+ let m = new Connection();
266
312
  m = Object.assign(m, proto);
267
313
  if (proto.namespace) {
268
314
  m.namespace = Namespace.fromProto(proto.namespace);
269
315
  }
270
- if (proto.type) {
271
- m.type = enumStringToValue$6(AssistantType, proto.type);
272
- }
273
- if (proto.config) {
274
- m.config = Config.fromProto(proto.config);
316
+ if (proto.assistantKeys) {
317
+ m.assistantKeys = proto.assistantKeys.map(AssistantKey.fromProto);
275
318
  }
276
319
  return m;
277
320
  }
@@ -292,45 +335,31 @@ class Assistant {
292
335
  if (typeof this.name !== 'undefined') {
293
336
  toReturn['name'] = this.name;
294
337
  }
295
- if (typeof this.type !== 'undefined') {
296
- toReturn['type'] = this.type;
297
- }
298
- if (typeof this.avatarUrl !== 'undefined') {
299
- toReturn['avatarUrl'] = this.avatarUrl;
338
+ if (typeof this.configurationUrl !== 'undefined') {
339
+ toReturn['configurationUrl'] = this.configurationUrl;
300
340
  }
301
- if (typeof this.config !== 'undefined' && this.config !== null) {
302
- toReturn['config'] = 'toApiJson' in this.config ? this.config.toApiJson() : this.config;
341
+ if (typeof this.assistantKeys !== 'undefined' && this.assistantKeys !== null) {
342
+ toReturn['assistantKeys'] = 'toApiJson' in this.assistantKeys ? this.assistantKeys.toApiJson() : this.assistantKeys;
303
343
  }
304
- return toReturn;
305
- }
306
- }
307
- class Config {
308
- static fromProto(proto) {
309
- let m = new Config();
310
- m = Object.assign(m, proto);
311
- if (proto.inboxConfig) {
312
- m.inboxConfig = ConfigInboxConfig.fromProto(proto.inboxConfig);
344
+ if (typeof this.connectionType !== 'undefined') {
345
+ toReturn['connectionType'] = this.connectionType;
313
346
  }
314
- return m;
315
- }
316
- constructor(kwargs) {
317
- if (!kwargs) {
318
- return;
347
+ if (typeof this.connectionTypeName !== 'undefined') {
348
+ toReturn['connectionTypeName'] = this.connectionTypeName;
319
349
  }
320
- Object.assign(this, kwargs);
321
- }
322
- toApiJson() {
323
- const toReturn = {};
324
- if (typeof this.inboxConfig !== 'undefined' && this.inboxConfig !== null) {
325
- toReturn['inboxConfig'] = 'toApiJson' in this.inboxConfig ? this.inboxConfig.toApiJson() : this.inboxConfig;
350
+ if (typeof this.iconUrl !== 'undefined') {
351
+ toReturn['iconUrl'] = this.iconUrl;
326
352
  }
327
353
  return toReturn;
328
354
  }
329
355
  }
330
- class ConfigInboxConfig {
356
+ class ConnectionKey {
331
357
  static fromProto(proto) {
332
- let m = new ConfigInboxConfig();
358
+ let m = new ConnectionKey();
333
359
  m = Object.assign(m, proto);
360
+ if (proto.namespace) {
361
+ m.namespace = Namespace.fromProto(proto.namespace);
362
+ }
334
363
  return m;
335
364
  }
336
365
  constructor(kwargs) {
@@ -341,11 +370,14 @@ class ConfigInboxConfig {
341
370
  }
342
371
  toApiJson() {
343
372
  const toReturn = {};
344
- if (typeof this.leadCaptureEnabled !== 'undefined') {
345
- toReturn['leadCaptureEnabled'] = this.leadCaptureEnabled;
373
+ if (typeof this.id !== 'undefined') {
374
+ toReturn['id'] = this.id;
346
375
  }
347
- if (typeof this.additionalInstructions !== 'undefined') {
348
- toReturn['additionalInstructions'] = this.additionalInstructions;
376
+ if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
377
+ toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
378
+ }
379
+ if (typeof this.connectionType !== 'undefined') {
380
+ toReturn['connectionType'] = this.connectionType;
349
381
  }
350
382
  return toReturn;
351
383
  }
@@ -841,6 +873,29 @@ class ListAssistantRequestFilters {
841
873
  return toReturn;
842
874
  }
843
875
  }
876
+ class ListAllAssistantsAssociatedToConnectionRequestFilters {
877
+ static fromProto(proto) {
878
+ let m = new ListAllAssistantsAssociatedToConnectionRequestFilters();
879
+ m = Object.assign(m, proto);
880
+ if (proto.type) {
881
+ m.type = enumStringToValue(AssistantType, proto.type);
882
+ }
883
+ return m;
884
+ }
885
+ constructor(kwargs) {
886
+ if (!kwargs) {
887
+ return;
888
+ }
889
+ Object.assign(this, kwargs);
890
+ }
891
+ toApiJson() {
892
+ const toReturn = {};
893
+ if (typeof this.type !== 'undefined') {
894
+ toReturn['type'] = this.type;
895
+ }
896
+ return toReturn;
897
+ }
898
+ }
844
899
  class ListConnectionsRequestFilters {
845
900
  static fromProto(proto) {
846
901
  let m = new ListConnectionsRequestFilters();
@@ -1087,6 +1142,104 @@ class GetConnectionResponse {
1087
1142
  return toReturn;
1088
1143
  }
1089
1144
  }
1145
+ class GetDeployedPromptVersionRequest {
1146
+ static fromProto(proto) {
1147
+ let m = new GetDeployedPromptVersionRequest();
1148
+ m = Object.assign(m, proto);
1149
+ return m;
1150
+ }
1151
+ constructor(kwargs) {
1152
+ if (!kwargs) {
1153
+ return;
1154
+ }
1155
+ Object.assign(this, kwargs);
1156
+ }
1157
+ toApiJson() {
1158
+ const toReturn = {};
1159
+ if (typeof this.id !== 'undefined') {
1160
+ toReturn['id'] = this.id;
1161
+ }
1162
+ return toReturn;
1163
+ }
1164
+ }
1165
+ class GetDeployedPromptVersionResponse {
1166
+ static fromProto(proto) {
1167
+ let m = new GetDeployedPromptVersionResponse();
1168
+ m = Object.assign(m, proto);
1169
+ if (proto.prompt) {
1170
+ m.prompt = Prompt.fromProto(proto.prompt);
1171
+ }
1172
+ if (proto.deployedPromptVersion) {
1173
+ m.deployedPromptVersion = PromptVersion.fromProto(proto.deployedPromptVersion);
1174
+ }
1175
+ return m;
1176
+ }
1177
+ constructor(kwargs) {
1178
+ if (!kwargs) {
1179
+ return;
1180
+ }
1181
+ Object.assign(this, kwargs);
1182
+ }
1183
+ toApiJson() {
1184
+ const toReturn = {};
1185
+ if (typeof this.prompt !== 'undefined' && this.prompt !== null) {
1186
+ toReturn['prompt'] = 'toApiJson' in this.prompt ? this.prompt.toApiJson() : this.prompt;
1187
+ }
1188
+ if (typeof this.deployedPromptVersion !== 'undefined' && this.deployedPromptVersion !== null) {
1189
+ toReturn['deployedPromptVersion'] = 'toApiJson' in this.deployedPromptVersion ? this.deployedPromptVersion.toApiJson() : this.deployedPromptVersion;
1190
+ }
1191
+ return toReturn;
1192
+ }
1193
+ }
1194
+ class GetMultiDeployedPromptVersionRequest {
1195
+ static fromProto(proto) {
1196
+ let m = new GetMultiDeployedPromptVersionRequest();
1197
+ m = Object.assign(m, proto);
1198
+ return m;
1199
+ }
1200
+ constructor(kwargs) {
1201
+ if (!kwargs) {
1202
+ return;
1203
+ }
1204
+ Object.assign(this, kwargs);
1205
+ }
1206
+ toApiJson() {
1207
+ const toReturn = {};
1208
+ if (typeof this.ids !== 'undefined') {
1209
+ toReturn['ids'] = this.ids;
1210
+ }
1211
+ return toReturn;
1212
+ }
1213
+ }
1214
+ class GetMultiDeployedPromptVersionResponse {
1215
+ static fromProto(proto) {
1216
+ let m = new GetMultiDeployedPromptVersionResponse();
1217
+ m = Object.assign(m, proto);
1218
+ if (proto.prompts) {
1219
+ m.prompts = proto.prompts.map(Prompt.fromProto);
1220
+ }
1221
+ if (proto.deployedPromptVersions) {
1222
+ m.deployedPromptVersions = proto.deployedPromptVersions.map(PromptVersion.fromProto);
1223
+ }
1224
+ return m;
1225
+ }
1226
+ constructor(kwargs) {
1227
+ if (!kwargs) {
1228
+ return;
1229
+ }
1230
+ Object.assign(this, kwargs);
1231
+ }
1232
+ toApiJson() {
1233
+ const toReturn = {};
1234
+ if (typeof this.prompts !== 'undefined' && this.prompts !== null) {
1235
+ toReturn['prompts'] = 'toApiJson' in this.prompts ? this.prompts.toApiJson() : this.prompts;
1236
+ }
1237
+ if (typeof this.deployedPromptVersions !== 'undefined' && this.deployedPromptVersions !== null) {
1238
+ toReturn['deployedPromptVersions'] = 'toApiJson' in this.deployedPromptVersions ? this.deployedPromptVersions.toApiJson() : this.deployedPromptVersions;
1239
+ }
1240
+ return toReturn;
1241
+ }
1242
+ }
1090
1243
  class GetPromptRequest {
1091
1244
  static fromProto(proto) {
1092
1245
  let m = new GetPromptRequest();
@@ -1176,6 +1329,58 @@ class GetPromptVersionResponse {
1176
1329
  return toReturn;
1177
1330
  }
1178
1331
  }
1332
+ class ListAllAssistantsAssociatedToConnectionRequest {
1333
+ static fromProto(proto) {
1334
+ let m = new ListAllAssistantsAssociatedToConnectionRequest();
1335
+ m = Object.assign(m, proto);
1336
+ if (proto.connectionKey) {
1337
+ m.connectionKey = ConnectionKey.fromProto(proto.connectionKey);
1338
+ }
1339
+ if (proto.filters) {
1340
+ m.filters = ListAllAssistantsAssociatedToConnectionRequestFilters.fromProto(proto.filters);
1341
+ }
1342
+ return m;
1343
+ }
1344
+ constructor(kwargs) {
1345
+ if (!kwargs) {
1346
+ return;
1347
+ }
1348
+ Object.assign(this, kwargs);
1349
+ }
1350
+ toApiJson() {
1351
+ const toReturn = {};
1352
+ if (typeof this.connectionKey !== 'undefined' && this.connectionKey !== null) {
1353
+ toReturn['connectionKey'] = 'toApiJson' in this.connectionKey ? this.connectionKey.toApiJson() : this.connectionKey;
1354
+ }
1355
+ if (typeof this.filters !== 'undefined' && this.filters !== null) {
1356
+ toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
1357
+ }
1358
+ return toReturn;
1359
+ }
1360
+ }
1361
+ class ListAllAssistantsAssociatedToConnectionResponse {
1362
+ static fromProto(proto) {
1363
+ let m = new ListAllAssistantsAssociatedToConnectionResponse();
1364
+ m = Object.assign(m, proto);
1365
+ if (proto.assistants) {
1366
+ m.assistants = proto.assistants.map(Assistant.fromProto);
1367
+ }
1368
+ return m;
1369
+ }
1370
+ constructor(kwargs) {
1371
+ if (!kwargs) {
1372
+ return;
1373
+ }
1374
+ Object.assign(this, kwargs);
1375
+ }
1376
+ toApiJson() {
1377
+ const toReturn = {};
1378
+ if (typeof this.assistants !== 'undefined' && this.assistants !== null) {
1379
+ toReturn['assistants'] = 'toApiJson' in this.assistants ? this.assistants.toApiJson() : this.assistants;
1380
+ }
1381
+ return toReturn;
1382
+ }
1383
+ }
1179
1384
  class ListAssistantRequest {
1180
1385
  static fromProto(proto) {
1181
1386
  let m = new ListAssistantRequest();
@@ -1570,6 +1775,11 @@ class AssistantApiService {
1570
1775
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/ListAssistant", request.toApiJson(), this.apiOptions())
1571
1776
  .pipe(map(resp => ListAssistantResponse.fromProto(resp)));
1572
1777
  }
1778
+ listAllAssistantsAssociatedToConnection(r) {
1779
+ const request = (r.toApiJson) ? r : new ListAllAssistantsAssociatedToConnectionRequest(r);
1780
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/ListAllAssistantsAssociatedToConnection", request.toApiJson(), this.apiOptions())
1781
+ .pipe(map(resp => ListAllAssistantsAssociatedToConnectionResponse.fromProto(resp)));
1782
+ }
1573
1783
  generateChatAnswer(r) {
1574
1784
  const request = (r.toApiJson) ? r : new GenerateChatAnswerRequest(r);
1575
1785
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/GenerateChatAnswer", request.toApiJson(), this.apiOptions())
@@ -1668,6 +1878,16 @@ class PromptApiService {
1668
1878
  return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/GetVersion", request.toApiJson(), this.apiOptions())
1669
1879
  .pipe(map(resp => GetPromptVersionResponse.fromProto(resp)));
1670
1880
  }
1881
+ getDeployedVersion(r) {
1882
+ const request = (r.toApiJson) ? r : new GetDeployedPromptVersionRequest(r);
1883
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/GetDeployedVersion", request.toApiJson(), this.apiOptions())
1884
+ .pipe(map(resp => GetDeployedPromptVersionResponse.fromProto(resp)));
1885
+ }
1886
+ getMultiDeployedVersion(r) {
1887
+ const request = (r.toApiJson) ? r : new GetMultiDeployedPromptVersionRequest(r);
1888
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/GetMultiDeployedVersion", request.toApiJson(), this.apiOptions())
1889
+ .pipe(map(resp => GetMultiDeployedPromptVersionResponse.fromProto(resp)));
1890
+ }
1671
1891
  update(r) {
1672
1892
  const request = (r.toApiJson) ? r : new UpdatePromptRequest(r);
1673
1893
  return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/Update", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
@@ -1709,5 +1929,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1709
1929
  * Generated bundle index. Do not edit.
1710
1930
  */
1711
1931
 
1712
- export { Access, Assistant, AssistantApiService, AssistantType, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, Connection, ConnectionApiService, ConnectionKey, CreatePromptRequest, DeleteAssistantRequest, DeleteConnectionRequest, DeletePromptRequest, DeployPromptRequest, GenerateChatAnswerRequest, GenerateChatAnswerRequestOptions, GenerateChatAnswerResponse, GetAssistantRequest, GetAssistantResponse, GetChatAnswerFunctionExecutionJobRequest, GetChatAnswerFunctionExecutionJobResponse, GetConnectionRequest, GetConnectionResponse, GetPromptRequest, GetPromptResponse, GetPromptVersionRequest, GetPromptVersionResponse, HostService, KeyValuePair, ListAssistantRequest, ListAssistantRequestFilters, ListAssistantResponse, ListConnectionsRequest, ListConnectionsRequestFilters, ListConnectionsResponse, ListPromptRequest, ListPromptResponse, ListPromptVersionsRequest, ListPromptVersionsResponse, Namespace, NamespaceAccountGroupNamespace, NamespacePartnerNamespace, NamespaceSystemNamespace, PagedRequestOptions, PagedResponseMetadata, Prompt, PromptApiService, PromptVersion, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantResponse, UpsertConnectionRequest };
1932
+ export { Access, Assistant, AssistantApiService, AssistantKey, AssistantType, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, Connection, ConnectionApiService, ConnectionKey, CreatePromptRequest, DeleteAssistantRequest, DeleteConnectionRequest, DeletePromptRequest, DeployPromptRequest, GenerateChatAnswerRequest, GenerateChatAnswerRequestOptions, GenerateChatAnswerResponse, GetAssistantRequest, GetAssistantResponse, GetChatAnswerFunctionExecutionJobRequest, GetChatAnswerFunctionExecutionJobResponse, GetConnectionRequest, GetConnectionResponse, GetDeployedPromptVersionRequest, GetDeployedPromptVersionResponse, GetMultiDeployedPromptVersionRequest, GetMultiDeployedPromptVersionResponse, GetPromptRequest, GetPromptResponse, GetPromptVersionRequest, GetPromptVersionResponse, HostService, KeyValuePair, ListAllAssistantsAssociatedToConnectionRequest, ListAllAssistantsAssociatedToConnectionRequestFilters, ListAllAssistantsAssociatedToConnectionResponse, ListAssistantRequest, ListAssistantRequestFilters, ListAssistantResponse, ListConnectionsRequest, ListConnectionsRequestFilters, ListConnectionsResponse, ListPromptRequest, ListPromptResponse, ListPromptVersionsRequest, ListPromptVersionsResponse, Namespace, NamespaceAccountGroupNamespace, NamespacePartnerNamespace, NamespaceSystemNamespace, PagedRequestOptions, PagedResponseMetadata, Prompt, PromptApiService, PromptVersion, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantResponse, UpsertConnectionRequest };
1713
1933
  //# sourceMappingURL=vendasta-ai-assistants.mjs.map