@vendasta/ai-assistants 0.3.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.
@@ -182,13 +182,19 @@ function enumStringToValue$7(enumRef, value) {
182
182
  }
183
183
  return enumRef[value];
184
184
  }
185
- class Connection {
185
+ class Assistant {
186
186
  static fromProto(proto) {
187
- let m = new Connection();
187
+ let m = new Assistant();
188
188
  m = Object.assign(m, proto);
189
189
  if (proto.namespace) {
190
190
  m.namespace = Namespace.fromProto(proto.namespace);
191
191
  }
192
+ if (proto.type) {
193
+ m.type = enumStringToValue$7(AssistantType, proto.type);
194
+ }
195
+ if (proto.config) {
196
+ m.config = Config.fromProto(proto.config);
197
+ }
192
198
  return m;
193
199
  }
194
200
  constructor(kwargs) {
@@ -208,24 +214,21 @@ class Connection {
208
214
  if (typeof this.name !== 'undefined') {
209
215
  toReturn['name'] = this.name;
210
216
  }
211
- if (typeof this.configurationUrl !== 'undefined') {
212
- toReturn['configurationUrl'] = this.configurationUrl;
213
- }
214
- if (typeof this.connectionType !== 'undefined') {
215
- toReturn['connectionType'] = this.connectionType;
217
+ if (typeof this.type !== 'undefined') {
218
+ toReturn['type'] = this.type;
216
219
  }
217
- if (typeof this.connectionTypeName !== 'undefined') {
218
- toReturn['connectionTypeName'] = this.connectionTypeName;
220
+ if (typeof this.avatarUrl !== 'undefined') {
221
+ toReturn['avatarUrl'] = this.avatarUrl;
219
222
  }
220
- if (typeof this.iconUrl !== 'undefined') {
221
- toReturn['iconUrl'] = this.iconUrl;
223
+ if (typeof this.config !== 'undefined' && this.config !== null) {
224
+ toReturn['config'] = 'toApiJson' in this.config ? this.config.toApiJson() : this.config;
222
225
  }
223
226
  return toReturn;
224
227
  }
225
228
  }
226
- class ConnectionKey {
229
+ class AssistantKey {
227
230
  static fromProto(proto) {
228
- let m = new ConnectionKey();
231
+ let m = new AssistantKey();
229
232
  m = Object.assign(m, proto);
230
233
  if (proto.namespace) {
231
234
  m.namespace = Namespace.fromProto(proto.namespace);
@@ -246,8 +249,51 @@ class ConnectionKey {
246
249
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
247
250
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
248
251
  }
249
- if (typeof this.connectionType !== 'undefined') {
250
- toReturn['connectionType'] = this.connectionType;
252
+ return toReturn;
253
+ }
254
+ }
255
+ class Config {
256
+ static fromProto(proto) {
257
+ let m = new Config();
258
+ m = Object.assign(m, proto);
259
+ if (proto.inboxConfig) {
260
+ m.inboxConfig = ConfigInboxConfig.fromProto(proto.inboxConfig);
261
+ }
262
+ return m;
263
+ }
264
+ constructor(kwargs) {
265
+ if (!kwargs) {
266
+ return;
267
+ }
268
+ Object.assign(this, kwargs);
269
+ }
270
+ toApiJson() {
271
+ const toReturn = {};
272
+ if (typeof this.inboxConfig !== 'undefined' && this.inboxConfig !== null) {
273
+ toReturn['inboxConfig'] = 'toApiJson' in this.inboxConfig ? this.inboxConfig.toApiJson() : this.inboxConfig;
274
+ }
275
+ return toReturn;
276
+ }
277
+ }
278
+ class ConfigInboxConfig {
279
+ static fromProto(proto) {
280
+ let m = new ConfigInboxConfig();
281
+ m = Object.assign(m, proto);
282
+ return m;
283
+ }
284
+ constructor(kwargs) {
285
+ if (!kwargs) {
286
+ return;
287
+ }
288
+ Object.assign(this, kwargs);
289
+ }
290
+ toApiJson() {
291
+ const toReturn = {};
292
+ if (typeof this.leadCaptureEnabled !== 'undefined') {
293
+ toReturn['leadCaptureEnabled'] = this.leadCaptureEnabled;
294
+ }
295
+ if (typeof this.additionalInstructions !== 'undefined') {
296
+ toReturn['additionalInstructions'] = this.additionalInstructions;
251
297
  }
252
298
  return toReturn;
253
299
  }
@@ -259,18 +305,15 @@ function enumStringToValue$6(enumRef, value) {
259
305
  }
260
306
  return enumRef[value];
261
307
  }
262
- class Assistant {
308
+ class Connection {
263
309
  static fromProto(proto) {
264
- let m = new Assistant();
310
+ let m = new Connection();
265
311
  m = Object.assign(m, proto);
266
312
  if (proto.namespace) {
267
313
  m.namespace = Namespace.fromProto(proto.namespace);
268
314
  }
269
- if (proto.type) {
270
- m.type = enumStringToValue$6(AssistantType, proto.type);
271
- }
272
- if (proto.config) {
273
- m.config = Config.fromProto(proto.config);
315
+ if (proto.assistantKeys) {
316
+ m.assistantKeys = proto.assistantKeys.map(AssistantKey.fromProto);
274
317
  }
275
318
  return m;
276
319
  }
@@ -291,45 +334,31 @@ class Assistant {
291
334
  if (typeof this.name !== 'undefined') {
292
335
  toReturn['name'] = this.name;
293
336
  }
294
- if (typeof this.type !== 'undefined') {
295
- toReturn['type'] = this.type;
296
- }
297
- if (typeof this.avatarUrl !== 'undefined') {
298
- toReturn['avatarUrl'] = this.avatarUrl;
337
+ if (typeof this.configurationUrl !== 'undefined') {
338
+ toReturn['configurationUrl'] = this.configurationUrl;
299
339
  }
300
- if (typeof this.config !== 'undefined' && this.config !== null) {
301
- toReturn['config'] = 'toApiJson' in this.config ? this.config.toApiJson() : this.config;
340
+ if (typeof this.assistantKeys !== 'undefined' && this.assistantKeys !== null) {
341
+ toReturn['assistantKeys'] = 'toApiJson' in this.assistantKeys ? this.assistantKeys.toApiJson() : this.assistantKeys;
302
342
  }
303
- return toReturn;
304
- }
305
- }
306
- class Config {
307
- static fromProto(proto) {
308
- let m = new Config();
309
- m = Object.assign(m, proto);
310
- if (proto.inboxConfig) {
311
- m.inboxConfig = ConfigInboxConfig.fromProto(proto.inboxConfig);
343
+ if (typeof this.connectionType !== 'undefined') {
344
+ toReturn['connectionType'] = this.connectionType;
312
345
  }
313
- return m;
314
- }
315
- constructor(kwargs) {
316
- if (!kwargs) {
317
- return;
346
+ if (typeof this.connectionTypeName !== 'undefined') {
347
+ toReturn['connectionTypeName'] = this.connectionTypeName;
318
348
  }
319
- Object.assign(this, kwargs);
320
- }
321
- toApiJson() {
322
- const toReturn = {};
323
- if (typeof this.inboxConfig !== 'undefined' && this.inboxConfig !== null) {
324
- toReturn['inboxConfig'] = 'toApiJson' in this.inboxConfig ? this.inboxConfig.toApiJson() : this.inboxConfig;
349
+ if (typeof this.iconUrl !== 'undefined') {
350
+ toReturn['iconUrl'] = this.iconUrl;
325
351
  }
326
352
  return toReturn;
327
353
  }
328
354
  }
329
- class ConfigInboxConfig {
355
+ class ConnectionKey {
330
356
  static fromProto(proto) {
331
- let m = new ConfigInboxConfig();
357
+ let m = new ConnectionKey();
332
358
  m = Object.assign(m, proto);
359
+ if (proto.namespace) {
360
+ m.namespace = Namespace.fromProto(proto.namespace);
361
+ }
333
362
  return m;
334
363
  }
335
364
  constructor(kwargs) {
@@ -340,11 +369,14 @@ class ConfigInboxConfig {
340
369
  }
341
370
  toApiJson() {
342
371
  const toReturn = {};
343
- if (typeof this.leadCaptureEnabled !== 'undefined') {
344
- toReturn['leadCaptureEnabled'] = this.leadCaptureEnabled;
372
+ if (typeof this.id !== 'undefined') {
373
+ toReturn['id'] = this.id;
345
374
  }
346
- if (typeof this.additionalInstructions !== 'undefined') {
347
- toReturn['additionalInstructions'] = this.additionalInstructions;
375
+ if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
376
+ toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
377
+ }
378
+ if (typeof this.connectionType !== 'undefined') {
379
+ toReturn['connectionType'] = this.connectionType;
348
380
  }
349
381
  return toReturn;
350
382
  }
@@ -840,6 +872,29 @@ class ListAssistantRequestFilters {
840
872
  return toReturn;
841
873
  }
842
874
  }
875
+ class ListAllAssistantsAssociatedToConnectionRequestFilters {
876
+ static fromProto(proto) {
877
+ let m = new ListAllAssistantsAssociatedToConnectionRequestFilters();
878
+ m = Object.assign(m, proto);
879
+ if (proto.type) {
880
+ m.type = enumStringToValue(AssistantType, proto.type);
881
+ }
882
+ return m;
883
+ }
884
+ constructor(kwargs) {
885
+ if (!kwargs) {
886
+ return;
887
+ }
888
+ Object.assign(this, kwargs);
889
+ }
890
+ toApiJson() {
891
+ const toReturn = {};
892
+ if (typeof this.type !== 'undefined') {
893
+ toReturn['type'] = this.type;
894
+ }
895
+ return toReturn;
896
+ }
897
+ }
843
898
  class ListConnectionsRequestFilters {
844
899
  static fromProto(proto) {
845
900
  let m = new ListConnectionsRequestFilters();
@@ -1135,6 +1190,55 @@ class GetDeployedPromptVersionResponse {
1135
1190
  return toReturn;
1136
1191
  }
1137
1192
  }
1193
+ class GetMultiDeployedPromptVersionRequest {
1194
+ static fromProto(proto) {
1195
+ let m = new GetMultiDeployedPromptVersionRequest();
1196
+ m = Object.assign(m, proto);
1197
+ return m;
1198
+ }
1199
+ constructor(kwargs) {
1200
+ if (!kwargs) {
1201
+ return;
1202
+ }
1203
+ Object.assign(this, kwargs);
1204
+ }
1205
+ toApiJson() {
1206
+ const toReturn = {};
1207
+ if (typeof this.ids !== 'undefined') {
1208
+ toReturn['ids'] = this.ids;
1209
+ }
1210
+ return toReturn;
1211
+ }
1212
+ }
1213
+ class GetMultiDeployedPromptVersionResponse {
1214
+ static fromProto(proto) {
1215
+ let m = new GetMultiDeployedPromptVersionResponse();
1216
+ m = Object.assign(m, proto);
1217
+ if (proto.prompts) {
1218
+ m.prompts = proto.prompts.map(Prompt.fromProto);
1219
+ }
1220
+ if (proto.deployedPromptVersions) {
1221
+ m.deployedPromptVersions = proto.deployedPromptVersions.map(PromptVersion.fromProto);
1222
+ }
1223
+ return m;
1224
+ }
1225
+ constructor(kwargs) {
1226
+ if (!kwargs) {
1227
+ return;
1228
+ }
1229
+ Object.assign(this, kwargs);
1230
+ }
1231
+ toApiJson() {
1232
+ const toReturn = {};
1233
+ if (typeof this.prompts !== 'undefined' && this.prompts !== null) {
1234
+ toReturn['prompts'] = 'toApiJson' in this.prompts ? this.prompts.toApiJson() : this.prompts;
1235
+ }
1236
+ if (typeof this.deployedPromptVersions !== 'undefined' && this.deployedPromptVersions !== null) {
1237
+ toReturn['deployedPromptVersions'] = 'toApiJson' in this.deployedPromptVersions ? this.deployedPromptVersions.toApiJson() : this.deployedPromptVersions;
1238
+ }
1239
+ return toReturn;
1240
+ }
1241
+ }
1138
1242
  class GetPromptRequest {
1139
1243
  static fromProto(proto) {
1140
1244
  let m = new GetPromptRequest();
@@ -1224,6 +1328,58 @@ class GetPromptVersionResponse {
1224
1328
  return toReturn;
1225
1329
  }
1226
1330
  }
1331
+ class ListAllAssistantsAssociatedToConnectionRequest {
1332
+ static fromProto(proto) {
1333
+ let m = new ListAllAssistantsAssociatedToConnectionRequest();
1334
+ m = Object.assign(m, proto);
1335
+ if (proto.connectionKey) {
1336
+ m.connectionKey = ConnectionKey.fromProto(proto.connectionKey);
1337
+ }
1338
+ if (proto.filters) {
1339
+ m.filters = ListAllAssistantsAssociatedToConnectionRequestFilters.fromProto(proto.filters);
1340
+ }
1341
+ return m;
1342
+ }
1343
+ constructor(kwargs) {
1344
+ if (!kwargs) {
1345
+ return;
1346
+ }
1347
+ Object.assign(this, kwargs);
1348
+ }
1349
+ toApiJson() {
1350
+ const toReturn = {};
1351
+ if (typeof this.connectionKey !== 'undefined' && this.connectionKey !== null) {
1352
+ toReturn['connectionKey'] = 'toApiJson' in this.connectionKey ? this.connectionKey.toApiJson() : this.connectionKey;
1353
+ }
1354
+ if (typeof this.filters !== 'undefined' && this.filters !== null) {
1355
+ toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
1356
+ }
1357
+ return toReturn;
1358
+ }
1359
+ }
1360
+ class ListAllAssistantsAssociatedToConnectionResponse {
1361
+ static fromProto(proto) {
1362
+ let m = new ListAllAssistantsAssociatedToConnectionResponse();
1363
+ m = Object.assign(m, proto);
1364
+ if (proto.assistants) {
1365
+ m.assistants = proto.assistants.map(Assistant.fromProto);
1366
+ }
1367
+ return m;
1368
+ }
1369
+ constructor(kwargs) {
1370
+ if (!kwargs) {
1371
+ return;
1372
+ }
1373
+ Object.assign(this, kwargs);
1374
+ }
1375
+ toApiJson() {
1376
+ const toReturn = {};
1377
+ if (typeof this.assistants !== 'undefined' && this.assistants !== null) {
1378
+ toReturn['assistants'] = 'toApiJson' in this.assistants ? this.assistants.toApiJson() : this.assistants;
1379
+ }
1380
+ return toReturn;
1381
+ }
1382
+ }
1227
1383
  class ListAssistantRequest {
1228
1384
  static fromProto(proto) {
1229
1385
  let m = new ListAssistantRequest();
@@ -1618,6 +1774,11 @@ class AssistantApiService {
1618
1774
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/ListAssistant", request.toApiJson(), this.apiOptions())
1619
1775
  .pipe(map(resp => ListAssistantResponse.fromProto(resp)));
1620
1776
  }
1777
+ listAllAssistantsAssociatedToConnection(r) {
1778
+ const request = (r.toApiJson) ? r : new ListAllAssistantsAssociatedToConnectionRequest(r);
1779
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/ListAllAssistantsAssociatedToConnection", request.toApiJson(), this.apiOptions())
1780
+ .pipe(map(resp => ListAllAssistantsAssociatedToConnectionResponse.fromProto(resp)));
1781
+ }
1621
1782
  generateChatAnswer(r) {
1622
1783
  const request = (r.toApiJson) ? r : new GenerateChatAnswerRequest(r);
1623
1784
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/GenerateChatAnswer", request.toApiJson(), this.apiOptions())
@@ -1721,6 +1882,11 @@ class PromptApiService {
1721
1882
  return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/GetDeployedVersion", request.toApiJson(), this.apiOptions())
1722
1883
  .pipe(map(resp => GetDeployedPromptVersionResponse.fromProto(resp)));
1723
1884
  }
1885
+ getMultiDeployedVersion(r) {
1886
+ const request = (r.toApiJson) ? r : new GetMultiDeployedPromptVersionRequest(r);
1887
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/GetMultiDeployedVersion", request.toApiJson(), this.apiOptions())
1888
+ .pipe(map(resp => GetMultiDeployedPromptVersionResponse.fromProto(resp)));
1889
+ }
1724
1890
  update(r) {
1725
1891
  const request = (r.toApiJson) ? r : new UpdatePromptRequest(r);
1726
1892
  return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/Update", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
@@ -1762,5 +1928,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1762
1928
  * Generated bundle index. Do not edit.
1763
1929
  */
1764
1930
 
1765
- 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, GetDeployedPromptVersionRequest, GetDeployedPromptVersionResponse, 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 };
1931
+ 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 };
1766
1932
  //# sourceMappingURL=vendasta-ai-assistants.mjs.map