@vendasta/ai-assistants 0.17.0 → 0.19.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 (29) hide show
  1. package/esm2020/lib/_internal/assistant.api.service.mjs +7 -2
  2. package/esm2020/lib/_internal/goal.api.service.mjs +7 -2
  3. package/esm2020/lib/_internal/interfaces/api.interface.mjs +1 -1
  4. package/esm2020/lib/_internal/interfaces/function.interface.mjs +1 -1
  5. package/esm2020/lib/_internal/interfaces/goal.interface.mjs +1 -1
  6. package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
  7. package/esm2020/lib/_internal/interfaces/prompt.interface.mjs +1 -1
  8. package/esm2020/lib/_internal/objects/api.mjs +120 -22
  9. package/esm2020/lib/_internal/objects/function.mjs +4 -1
  10. package/esm2020/lib/_internal/objects/goal.mjs +4 -1
  11. package/esm2020/lib/_internal/objects/index.mjs +2 -2
  12. package/esm2020/lib/_internal/objects/prompt.mjs +4 -1
  13. package/fesm2015/vendasta-ai-assistants.mjs +139 -22
  14. package/fesm2015/vendasta-ai-assistants.mjs.map +1 -1
  15. package/fesm2020/vendasta-ai-assistants.mjs +139 -22
  16. package/fesm2020/vendasta-ai-assistants.mjs.map +1 -1
  17. package/lib/_internal/assistant.api.service.d.ts +3 -2
  18. package/lib/_internal/goal.api.service.d.ts +3 -2
  19. package/lib/_internal/interfaces/api.interface.d.ts +23 -8
  20. package/lib/_internal/interfaces/function.interface.d.ts +1 -0
  21. package/lib/_internal/interfaces/goal.interface.d.ts +1 -0
  22. package/lib/_internal/interfaces/index.d.ts +1 -1
  23. package/lib/_internal/interfaces/prompt.interface.d.ts +1 -0
  24. package/lib/_internal/objects/api.d.ts +43 -16
  25. package/lib/_internal/objects/function.d.ts +1 -0
  26. package/lib/_internal/objects/goal.d.ts +1 -0
  27. package/lib/_internal/objects/index.d.ts +1 -1
  28. package/lib/_internal/objects/prompt.d.ts +1 -0
  29. package/package.json +1 -1
@@ -342,6 +342,9 @@ class Function {
342
342
  if (typeof this.headers !== 'undefined' && this.headers !== null) {
343
343
  toReturn['headers'] = 'toApiJson' in this.headers ? this.headers.toApiJson() : this.headers;
344
344
  }
345
+ if (typeof this.managed !== 'undefined') {
346
+ toReturn['managed'] = this.managed;
347
+ }
345
348
  return toReturn;
346
349
  }
347
350
  }
@@ -530,6 +533,9 @@ class PromptModule {
530
533
  if (typeof this.deployed !== 'undefined' && this.deployed !== null) {
531
534
  toReturn['deployed'] = 'toApiJson' in this.deployed ? this.deployed.toApiJson() : this.deployed;
532
535
  }
536
+ if (typeof this.managed !== 'undefined') {
537
+ toReturn['managed'] = this.managed;
538
+ }
533
539
  return toReturn;
534
540
  }
535
541
  }
@@ -704,6 +710,9 @@ class Goal {
704
710
  if (typeof this.supportedChannels !== 'undefined') {
705
711
  toReturn['supportedChannels'] = this.supportedChannels;
706
712
  }
713
+ if (typeof this.managed !== 'undefined') {
714
+ toReturn['managed'] = this.managed;
715
+ }
707
716
  return toReturn;
708
717
  }
709
718
  }
@@ -1380,6 +1389,61 @@ function enumStringToValue(enumRef, value) {
1380
1389
  }
1381
1390
  return enumRef[value];
1382
1391
  }
1392
+ class BuildDefaultAssistantRequest {
1393
+ static fromProto(proto) {
1394
+ let m = new BuildDefaultAssistantRequest();
1395
+ m = Object.assign(m, proto);
1396
+ if (proto.namespace) {
1397
+ m.namespace = Namespace.fromProto(proto.namespace);
1398
+ }
1399
+ if (proto.type) {
1400
+ m.type = enumStringToValue(AssistantType, proto.type);
1401
+ }
1402
+ return m;
1403
+ }
1404
+ constructor(kwargs) {
1405
+ if (!kwargs) {
1406
+ return;
1407
+ }
1408
+ Object.assign(this, kwargs);
1409
+ }
1410
+ toApiJson() {
1411
+ const toReturn = {};
1412
+ if (typeof this.id !== 'undefined') {
1413
+ toReturn['id'] = this.id;
1414
+ }
1415
+ if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
1416
+ toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
1417
+ }
1418
+ if (typeof this.type !== 'undefined') {
1419
+ toReturn['type'] = this.type;
1420
+ }
1421
+ return toReturn;
1422
+ }
1423
+ }
1424
+ class BuildDefaultAssistantResponse {
1425
+ static fromProto(proto) {
1426
+ let m = new BuildDefaultAssistantResponse();
1427
+ m = Object.assign(m, proto);
1428
+ if (proto.assistant) {
1429
+ m.assistant = Assistant.fromProto(proto.assistant);
1430
+ }
1431
+ return m;
1432
+ }
1433
+ constructor(kwargs) {
1434
+ if (!kwargs) {
1435
+ return;
1436
+ }
1437
+ Object.assign(this, kwargs);
1438
+ }
1439
+ toApiJson() {
1440
+ const toReturn = {};
1441
+ if (typeof this.assistant !== 'undefined' && this.assistant !== null) {
1442
+ toReturn['assistant'] = 'toApiJson' in this.assistant ? this.assistant.toApiJson() : this.assistant;
1443
+ }
1444
+ return toReturn;
1445
+ }
1446
+ }
1383
1447
  class SetAssistantConnectionsRequestConnectionState {
1384
1448
  static fromProto(proto) {
1385
1449
  let m = new SetAssistantConnectionsRequestConnectionState();
@@ -1438,6 +1502,9 @@ class CreatePromptModuleRequest {
1438
1502
  if (typeof this.content !== 'undefined') {
1439
1503
  toReturn['content'] = this.content;
1440
1504
  }
1505
+ if (typeof this.managed !== 'undefined') {
1506
+ toReturn['managed'] = this.managed;
1507
+ }
1441
1508
  return toReturn;
1442
1509
  }
1443
1510
  }
@@ -1759,13 +1826,16 @@ class ListConnectionsRequestFilters {
1759
1826
  return toReturn;
1760
1827
  }
1761
1828
  }
1762
- class ListFunctionRequestFilters {
1829
+ class ListAssistantRequestFilters {
1763
1830
  static fromProto(proto) {
1764
- let m = new ListFunctionRequestFilters();
1831
+ let m = new ListAssistantRequestFilters();
1765
1832
  m = Object.assign(m, proto);
1766
1833
  if (proto.namespace) {
1767
1834
  m.namespace = Namespace.fromProto(proto.namespace);
1768
1835
  }
1836
+ if (proto.type) {
1837
+ m.type = enumStringToValue(AssistantType, proto.type);
1838
+ }
1769
1839
  return m;
1770
1840
  }
1771
1841
  constructor(kwargs) {
@@ -1779,6 +1849,9 @@ class ListFunctionRequestFilters {
1779
1849
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
1780
1850
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
1781
1851
  }
1852
+ if (typeof this.type !== 'undefined') {
1853
+ toReturn['type'] = this.type;
1854
+ }
1782
1855
  return toReturn;
1783
1856
  }
1784
1857
  }
@@ -1840,16 +1913,13 @@ class ListAllAssistantsAssociatedToConnectionRequestFilters {
1840
1913
  return toReturn;
1841
1914
  }
1842
1915
  }
1843
- class ListAssistantRequestFilters {
1916
+ class ListFunctionRequestFilters {
1844
1917
  static fromProto(proto) {
1845
- let m = new ListAssistantRequestFilters();
1918
+ let m = new ListFunctionRequestFilters();
1846
1919
  m = Object.assign(m, proto);
1847
1920
  if (proto.namespace) {
1848
1921
  m.namespace = Namespace.fromProto(proto.namespace);
1849
1922
  }
1850
- if (proto.type) {
1851
- m.type = enumStringToValue(AssistantType, proto.type);
1852
- }
1853
1923
  return m;
1854
1924
  }
1855
1925
  constructor(kwargs) {
@@ -1863,9 +1933,6 @@ class ListAssistantRequestFilters {
1863
1933
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
1864
1934
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
1865
1935
  }
1866
- if (typeof this.type !== 'undefined') {
1867
- toReturn['type'] = this.type;
1868
- }
1869
1936
  return toReturn;
1870
1937
  }
1871
1938
  }
@@ -2726,6 +2793,46 @@ class GetPromptVersionResponse {
2726
2793
  return toReturn;
2727
2794
  }
2728
2795
  }
2796
+ class GoalsDisabledForAccountGroupRequest {
2797
+ static fromProto(proto) {
2798
+ let m = new GoalsDisabledForAccountGroupRequest();
2799
+ m = Object.assign(m, proto);
2800
+ return m;
2801
+ }
2802
+ constructor(kwargs) {
2803
+ if (!kwargs) {
2804
+ return;
2805
+ }
2806
+ Object.assign(this, kwargs);
2807
+ }
2808
+ toApiJson() {
2809
+ const toReturn = {};
2810
+ if (typeof this.accountGroupId !== 'undefined') {
2811
+ toReturn['accountGroupId'] = this.accountGroupId;
2812
+ }
2813
+ return toReturn;
2814
+ }
2815
+ }
2816
+ class GoalsDisabledForAccountGroupResponse {
2817
+ static fromProto(proto) {
2818
+ let m = new GoalsDisabledForAccountGroupResponse();
2819
+ m = Object.assign(m, proto);
2820
+ return m;
2821
+ }
2822
+ constructor(kwargs) {
2823
+ if (!kwargs) {
2824
+ return;
2825
+ }
2826
+ Object.assign(this, kwargs);
2827
+ }
2828
+ toApiJson() {
2829
+ const toReturn = {};
2830
+ if (typeof this.goalsDisabled !== 'undefined') {
2831
+ toReturn['goalsDisabled'] = this.goalsDisabled;
2832
+ }
2833
+ return toReturn;
2834
+ }
2835
+ }
2729
2836
  class ListAllAssistantsAssociatedToConnectionRequest {
2730
2837
  static fromProto(proto) {
2731
2838
  let m = new ListAllAssistantsAssociatedToConnectionRequest();
@@ -3251,9 +3358,9 @@ class ListPromptVersionsResponse {
3251
3358
  return toReturn;
3252
3359
  }
3253
3360
  }
3254
- class GenerateChatAnswerRequestOptions {
3361
+ class UpsertAssistantRequestOptions {
3255
3362
  static fromProto(proto) {
3256
- let m = new GenerateChatAnswerRequestOptions();
3363
+ let m = new UpsertAssistantRequestOptions();
3257
3364
  m = Object.assign(m, proto);
3258
3365
  return m;
3259
3366
  }
@@ -3265,11 +3372,8 @@ class GenerateChatAnswerRequestOptions {
3265
3372
  }
3266
3373
  toApiJson() {
3267
3374
  const toReturn = {};
3268
- if (typeof this.includeAllCitations !== 'undefined') {
3269
- toReturn['includeAllCitations'] = this.includeAllCitations;
3270
- }
3271
- if (typeof this.enableAsyncFunctions !== 'undefined') {
3272
- toReturn['enableAsyncFunctions'] = this.enableAsyncFunctions;
3375
+ if (typeof this.applyDefaults !== 'undefined') {
3376
+ toReturn['applyDefaults'] = this.applyDefaults;
3273
3377
  }
3274
3378
  return toReturn;
3275
3379
  }
@@ -3294,9 +3398,9 @@ class CreatePromptModuleVersionRequestOptions {
3294
3398
  return toReturn;
3295
3399
  }
3296
3400
  }
3297
- class UpsertAssistantRequestOptions {
3401
+ class GenerateChatAnswerRequestOptions {
3298
3402
  static fromProto(proto) {
3299
- let m = new UpsertAssistantRequestOptions();
3403
+ let m = new GenerateChatAnswerRequestOptions();
3300
3404
  m = Object.assign(m, proto);
3301
3405
  return m;
3302
3406
  }
@@ -3308,8 +3412,11 @@ class UpsertAssistantRequestOptions {
3308
3412
  }
3309
3413
  toApiJson() {
3310
3414
  const toReturn = {};
3311
- if (typeof this.applyDefaults !== 'undefined') {
3312
- toReturn['applyDefaults'] = this.applyDefaults;
3415
+ if (typeof this.includeAllCitations !== 'undefined') {
3416
+ toReturn['includeAllCitations'] = this.includeAllCitations;
3417
+ }
3418
+ if (typeof this.enableAsyncFunctions !== 'undefined') {
3419
+ toReturn['enableAsyncFunctions'] = this.enableAsyncFunctions;
3313
3420
  }
3314
3421
  return toReturn;
3315
3422
  }
@@ -3560,6 +3667,11 @@ class AssistantApiService {
3560
3667
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/GetAssistant", request.toApiJson(), this.apiOptions())
3561
3668
  .pipe(map(resp => GetAssistantResponse.fromProto(resp)));
3562
3669
  }
3670
+ buildDefaultAssistant(r) {
3671
+ const request = (r.toApiJson) ? r : new BuildDefaultAssistantRequest(r);
3672
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/BuildDefaultAssistant", request.toApiJson(), this.apiOptions())
3673
+ .pipe(map(resp => BuildDefaultAssistantResponse.fromProto(resp)));
3674
+ }
3563
3675
  deleteAssistant(r) {
3564
3676
  const request = (r.toApiJson) ? r : new DeleteAssistantRequest(r);
3565
3677
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/DeleteAssistant", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
@@ -3736,6 +3848,11 @@ class GoalApiService {
3736
3848
  return this.http.post(this._host + "/ai_assistants.v1alpha1.GoalService/List", request.toApiJson(), this.apiOptions())
3737
3849
  .pipe(map(resp => ListGoalsResponse.fromProto(resp)));
3738
3850
  }
3851
+ goalsDisabledForAccountGroup(r) {
3852
+ const request = (r.toApiJson) ? r : new GoalsDisabledForAccountGroupRequest(r);
3853
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.GoalService/GoalsDisabledForAccountGroup", request.toApiJson(), this.apiOptions())
3854
+ .pipe(map(resp => GoalsDisabledForAccountGroupResponse.fromProto(resp)));
3855
+ }
3739
3856
  }
3740
3857
  GoalApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GoalApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3741
3858
  GoalApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GoalApiService, providedIn: 'root' });
@@ -3912,5 +4029,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3912
4029
  * Generated bundle index. Do not edit.
3913
4030
  */
3914
4031
 
3915
- export { Access, Assistant, AssistantApiService, AssistantKey, AssistantType, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, ConfigVoiceConfig, ConfigurableGoal, Connection, ConnectionApiService, ConnectionKey, CreatePromptModuleRequest, CreatePromptModuleVersionRequest, CreatePromptModuleVersionRequestOptions, CreatePromptRequest, DeepgramConfig, DeleteAssistantRequest, DeleteConnectionRequest, DeleteFunctionRequest, DeleteGoalRequest, DeletePromptModuleRequest, DeletePromptRequest, DeployPromptModuleRequest, DeployPromptRequest, Function, FunctionApiService, FunctionHeader, FunctionKey, FunctionParameter, GenerateChatAnswerRequest, GenerateChatAnswerRequestOptions, GenerateChatAnswerResponse, GetAssistantRequest, GetAssistantResponse, GetChatAnswerFunctionExecutionJobRequest, GetChatAnswerFunctionExecutionJobResponse, GetConnectionRequest, GetConnectionResponse, GetDeployedPromptModuleVersionRequest, GetDeployedPromptModuleVersionResponse, GetDeployedPromptVersionRequest, GetDeployedPromptVersionResponse, GetFunctionRequest, GetFunctionResponse, GetGoalRequest, GetGoalResponse, GetHydratedDeployedPromptModuleVersionRequest, GetHydratedDeployedPromptModuleVersionResponse, GetMultiDeployedPromptVersionRequest, GetMultiDeployedPromptVersionResponse, GetMultiFunctionRequest, GetMultiFunctionResponse, GetMultiGoalRequest, GetMultiGoalResponse, GetMultiHydratedDeployedPromptModuleVersionRequest, GetMultiHydratedDeployedPromptModuleVersionResponse, GetPromptModuleRequest, GetPromptModuleResponse, GetPromptModuleVersionRequest, GetPromptModuleVersionResponse, GetPromptRequest, GetPromptResponse, GetPromptVersionRequest, GetPromptVersionResponse, Goal, GoalApiService, GoalChannel, GoalKey, GoalType, HostService, KeyValuePair, ListAllAssistantsAssociatedToConnectionRequest, ListAllAssistantsAssociatedToConnectionRequestFilters, ListAllAssistantsAssociatedToConnectionResponse, ListAssistantRequest, ListAssistantRequestFilters, ListAssistantResponse, ListConnectionsRequest, ListConnectionsRequestFilters, ListConnectionsResponse, ListFunctionRequest, ListFunctionRequestFilters, ListFunctionResponse, ListGoalsRequest, ListGoalsRequestFilters, ListGoalsResponse, ListPromptModuleRequest, ListPromptModuleRequestFilters, ListPromptModuleResponse, ListPromptModuleVersionsRequest, ListPromptModuleVersionsResponse, ListPromptRequest, ListPromptResponse, ListPromptVersionsRequest, ListPromptVersionsResponse, ModelConfig, Namespace, NamespaceAccountGroupNamespace, NamespaceAccountGroupsForGroupNamespace, NamespaceAccountGroupsForPartnerNamespace, NamespaceGlobalNamespace, NamespacePartnerNamespace, NamespaceSystemNamespace, OpenAIRealtimeConfig, OpenAIRealtimeConfigTurnDetection, PagedRequestOptions, PagedResponseMetadata, Prompt, PromptApiService, PromptModule, PromptModuleApiService, PromptModuleKey, PromptModuleVersion, PromptVersion, SetAssistantConnectionsRequest, SetAssistantConnectionsRequestConnectionState, UpdatePromptModuleRequest, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantRequestOptions, UpsertAssistantResponse, UpsertConnectionRequest, UpsertFunctionRequest, UpsertGoalRequest, VendorModel };
4032
+ export { Access, Assistant, AssistantApiService, AssistantKey, AssistantType, BuildDefaultAssistantRequest, BuildDefaultAssistantResponse, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, ConfigVoiceConfig, ConfigurableGoal, Connection, ConnectionApiService, ConnectionKey, CreatePromptModuleRequest, CreatePromptModuleVersionRequest, CreatePromptModuleVersionRequestOptions, CreatePromptRequest, DeepgramConfig, DeleteAssistantRequest, DeleteConnectionRequest, DeleteFunctionRequest, DeleteGoalRequest, DeletePromptModuleRequest, DeletePromptRequest, DeployPromptModuleRequest, DeployPromptRequest, Function, FunctionApiService, FunctionHeader, FunctionKey, FunctionParameter, GenerateChatAnswerRequest, GenerateChatAnswerRequestOptions, GenerateChatAnswerResponse, GetAssistantRequest, GetAssistantResponse, GetChatAnswerFunctionExecutionJobRequest, GetChatAnswerFunctionExecutionJobResponse, GetConnectionRequest, GetConnectionResponse, GetDeployedPromptModuleVersionRequest, GetDeployedPromptModuleVersionResponse, GetDeployedPromptVersionRequest, GetDeployedPromptVersionResponse, GetFunctionRequest, GetFunctionResponse, GetGoalRequest, GetGoalResponse, GetHydratedDeployedPromptModuleVersionRequest, GetHydratedDeployedPromptModuleVersionResponse, GetMultiDeployedPromptVersionRequest, GetMultiDeployedPromptVersionResponse, GetMultiFunctionRequest, GetMultiFunctionResponse, GetMultiGoalRequest, GetMultiGoalResponse, GetMultiHydratedDeployedPromptModuleVersionRequest, GetMultiHydratedDeployedPromptModuleVersionResponse, GetPromptModuleRequest, GetPromptModuleResponse, GetPromptModuleVersionRequest, GetPromptModuleVersionResponse, GetPromptRequest, GetPromptResponse, GetPromptVersionRequest, GetPromptVersionResponse, Goal, GoalApiService, GoalChannel, GoalKey, GoalType, GoalsDisabledForAccountGroupRequest, GoalsDisabledForAccountGroupResponse, HostService, KeyValuePair, ListAllAssistantsAssociatedToConnectionRequest, ListAllAssistantsAssociatedToConnectionRequestFilters, ListAllAssistantsAssociatedToConnectionResponse, ListAssistantRequest, ListAssistantRequestFilters, ListAssistantResponse, ListConnectionsRequest, ListConnectionsRequestFilters, ListConnectionsResponse, ListFunctionRequest, ListFunctionRequestFilters, ListFunctionResponse, ListGoalsRequest, ListGoalsRequestFilters, ListGoalsResponse, ListPromptModuleRequest, ListPromptModuleRequestFilters, ListPromptModuleResponse, ListPromptModuleVersionsRequest, ListPromptModuleVersionsResponse, ListPromptRequest, ListPromptResponse, ListPromptVersionsRequest, ListPromptVersionsResponse, ModelConfig, Namespace, NamespaceAccountGroupNamespace, NamespaceAccountGroupsForGroupNamespace, NamespaceAccountGroupsForPartnerNamespace, NamespaceGlobalNamespace, NamespacePartnerNamespace, NamespaceSystemNamespace, OpenAIRealtimeConfig, OpenAIRealtimeConfigTurnDetection, PagedRequestOptions, PagedResponseMetadata, Prompt, PromptApiService, PromptModule, PromptModuleApiService, PromptModuleKey, PromptModuleVersion, PromptVersion, SetAssistantConnectionsRequest, SetAssistantConnectionsRequestConnectionState, UpdatePromptModuleRequest, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantRequestOptions, UpsertAssistantResponse, UpsertConnectionRequest, UpsertFunctionRequest, UpsertGoalRequest, VendorModel };
3916
4033
  //# sourceMappingURL=vendasta-ai-assistants.mjs.map