@vendasta/ai-assistants 0.25.0 → 0.27.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.
@@ -79,6 +79,7 @@ var AssistantType;
79
79
  AssistantType[AssistantType["ASSISTANT_TYPE_INBOX"] = 2] = "ASSISTANT_TYPE_INBOX";
80
80
  AssistantType[AssistantType["ASSISTANT_TYPE_SOCIAL_MARKETING"] = 3] = "ASSISTANT_TYPE_SOCIAL_MARKETING";
81
81
  AssistantType[AssistantType["ASSISTANT_TYPE_VOICE_RECEPTIONIST"] = 4] = "ASSISTANT_TYPE_VOICE_RECEPTIONIST";
82
+ AssistantType[AssistantType["ASSISTANT_TYPE_CUSTOM"] = 5] = "ASSISTANT_TYPE_CUSTOM";
82
83
  })(AssistantType || (AssistantType = {}));
83
84
  var VendorModel;
84
85
  (function (VendorModel) {
@@ -1865,15 +1866,15 @@ class DeployPromptRequest {
1865
1866
  return toReturn;
1866
1867
  }
1867
1868
  }
1868
- class ListConnectionsRequestFilters {
1869
+ class ExecuteFunctionRequest {
1869
1870
  static fromProto(proto) {
1870
- let m = new ListConnectionsRequestFilters();
1871
+ let m = new ExecuteFunctionRequest();
1871
1872
  m = Object.assign(m, proto);
1872
- if (proto.namespace) {
1873
- m.namespace = Namespace.fromProto(proto.namespace);
1873
+ if (proto.assistantKey) {
1874
+ m.assistantKey = AssistantKey.fromProto(proto.assistantKey);
1874
1875
  }
1875
- if (proto.assistantType) {
1876
- m.assistantType = enumStringToValue(AssistantType, proto.assistantType);
1876
+ if (proto.functionKey) {
1877
+ m.functionKey = FunctionKey.fromProto(proto.functionKey);
1877
1878
  }
1878
1879
  return m;
1879
1880
  }
@@ -1885,22 +1886,57 @@ class ListConnectionsRequestFilters {
1885
1886
  }
1886
1887
  toApiJson() {
1887
1888
  const toReturn = {};
1888
- if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
1889
- toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
1889
+ if (typeof this.assistantKey !== 'undefined' && this.assistantKey !== null) {
1890
+ toReturn['assistantKey'] = 'toApiJson' in this.assistantKey ? this.assistantKey.toApiJson() : this.assistantKey;
1890
1891
  }
1891
- if (typeof this.assistantType !== 'undefined') {
1892
- toReturn['assistantType'] = this.assistantType;
1892
+ if (typeof this.functionKey !== 'undefined' && this.functionKey !== null) {
1893
+ toReturn['functionKey'] = 'toApiJson' in this.functionKey ? this.functionKey.toApiJson() : this.functionKey;
1894
+ }
1895
+ if (typeof this.arguments !== 'undefined') {
1896
+ toReturn['arguments'] = this.arguments;
1893
1897
  }
1894
1898
  return toReturn;
1895
1899
  }
1896
1900
  }
1897
- class ListPromptModuleRequestFilters {
1901
+ class ExecuteFunctionResponse {
1898
1902
  static fromProto(proto) {
1899
- let m = new ListPromptModuleRequestFilters();
1903
+ let m = new ExecuteFunctionResponse();
1904
+ m = Object.assign(m, proto);
1905
+ if (proto.metadata) {
1906
+ m.metadata = proto.metadata.map(KeyValuePair.fromProto);
1907
+ }
1908
+ return m;
1909
+ }
1910
+ constructor(kwargs) {
1911
+ if (!kwargs) {
1912
+ return;
1913
+ }
1914
+ Object.assign(this, kwargs);
1915
+ }
1916
+ toApiJson() {
1917
+ const toReturn = {};
1918
+ if (typeof this.output !== 'undefined') {
1919
+ toReturn['output'] = this.output;
1920
+ }
1921
+ if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
1922
+ toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
1923
+ }
1924
+ return toReturn;
1925
+ }
1926
+ }
1927
+ class ListGoalsRequestFilters {
1928
+ static fromProto(proto) {
1929
+ let m = new ListGoalsRequestFilters();
1900
1930
  m = Object.assign(m, proto);
1901
1931
  if (proto.namespace) {
1902
1932
  m.namespace = Namespace.fromProto(proto.namespace);
1903
1933
  }
1934
+ if (proto.type) {
1935
+ m.type = enumStringToValue(GoalType, proto.type);
1936
+ }
1937
+ if (proto.supportedChannels) {
1938
+ m.supportedChannels = proto.supportedChannels.map((v) => enumStringToValue(GoalChannel, v));
1939
+ }
1904
1940
  return m;
1905
1941
  }
1906
1942
  constructor(kwargs) {
@@ -1914,6 +1950,12 @@ class ListPromptModuleRequestFilters {
1914
1950
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
1915
1951
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
1916
1952
  }
1953
+ if (typeof this.type !== 'undefined') {
1954
+ toReturn['type'] = this.type;
1955
+ }
1956
+ if (typeof this.supportedChannels !== 'undefined') {
1957
+ toReturn['supportedChannels'] = this.supportedChannels;
1958
+ }
1917
1959
  return toReturn;
1918
1960
  }
1919
1961
  }
@@ -1940,6 +1982,29 @@ class ListAllAssistantsAssociatedToConnectionRequestFilters {
1940
1982
  return toReturn;
1941
1983
  }
1942
1984
  }
1985
+ class ListFunctionRequestFilters {
1986
+ static fromProto(proto) {
1987
+ let m = new ListFunctionRequestFilters();
1988
+ m = Object.assign(m, proto);
1989
+ if (proto.namespace) {
1990
+ m.namespace = Namespace.fromProto(proto.namespace);
1991
+ }
1992
+ return m;
1993
+ }
1994
+ constructor(kwargs) {
1995
+ if (!kwargs) {
1996
+ return;
1997
+ }
1998
+ Object.assign(this, kwargs);
1999
+ }
2000
+ toApiJson() {
2001
+ const toReturn = {};
2002
+ if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
2003
+ toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
2004
+ }
2005
+ return toReturn;
2006
+ }
2007
+ }
1943
2008
  class ListAssistantRequestFilters {
1944
2009
  static fromProto(proto) {
1945
2010
  let m = new ListAssistantRequestFilters();
@@ -1969,9 +2034,9 @@ class ListAssistantRequestFilters {
1969
2034
  return toReturn;
1970
2035
  }
1971
2036
  }
1972
- class ListFunctionRequestFilters {
2037
+ class ListPromptModuleRequestFilters {
1973
2038
  static fromProto(proto) {
1974
- let m = new ListFunctionRequestFilters();
2039
+ let m = new ListPromptModuleRequestFilters();
1975
2040
  m = Object.assign(m, proto);
1976
2041
  if (proto.namespace) {
1977
2042
  m.namespace = Namespace.fromProto(proto.namespace);
@@ -1992,18 +2057,15 @@ class ListFunctionRequestFilters {
1992
2057
  return toReturn;
1993
2058
  }
1994
2059
  }
1995
- class ListGoalsRequestFilters {
2060
+ class ListConnectionsRequestFilters {
1996
2061
  static fromProto(proto) {
1997
- let m = new ListGoalsRequestFilters();
2062
+ let m = new ListConnectionsRequestFilters();
1998
2063
  m = Object.assign(m, proto);
1999
2064
  if (proto.namespace) {
2000
2065
  m.namespace = Namespace.fromProto(proto.namespace);
2001
2066
  }
2002
- if (proto.type) {
2003
- m.type = enumStringToValue(GoalType, proto.type);
2004
- }
2005
- if (proto.supportedChannels) {
2006
- m.supportedChannels = proto.supportedChannels.map((v) => enumStringToValue(GoalChannel, v));
2067
+ if (proto.assistantType) {
2068
+ m.assistantType = enumStringToValue(AssistantType, proto.assistantType);
2007
2069
  }
2008
2070
  return m;
2009
2071
  }
@@ -2018,11 +2080,8 @@ class ListGoalsRequestFilters {
2018
2080
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
2019
2081
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
2020
2082
  }
2021
- if (typeof this.type !== 'undefined') {
2022
- toReturn['type'] = this.type;
2023
- }
2024
- if (typeof this.supportedChannels !== 'undefined') {
2025
- toReturn['supportedChannels'] = this.supportedChannels;
2083
+ if (typeof this.assistantType !== 'undefined') {
2084
+ toReturn['assistantType'] = this.assistantType;
2026
2085
  }
2027
2086
  return toReturn;
2028
2087
  }
@@ -3449,10 +3508,13 @@ class ListPromptVersionsResponse {
3449
3508
  return toReturn;
3450
3509
  }
3451
3510
  }
3452
- class CreatePromptModuleVersionRequestOptions {
3511
+ class GenerateChatAnswerRequestOptions {
3453
3512
  static fromProto(proto) {
3454
- let m = new CreatePromptModuleVersionRequestOptions();
3513
+ let m = new GenerateChatAnswerRequestOptions();
3455
3514
  m = Object.assign(m, proto);
3515
+ if (proto.maxTokens) {
3516
+ m.maxTokens = parseInt(proto.maxTokens, 10);
3517
+ }
3456
3518
  return m;
3457
3519
  }
3458
3520
  constructor(kwargs) {
@@ -3463,8 +3525,14 @@ class CreatePromptModuleVersionRequestOptions {
3463
3525
  }
3464
3526
  toApiJson() {
3465
3527
  const toReturn = {};
3466
- if (typeof this.shouldDeploy !== 'undefined') {
3467
- toReturn['shouldDeploy'] = this.shouldDeploy;
3528
+ if (typeof this.includeAllCitations !== 'undefined') {
3529
+ toReturn['includeAllCitations'] = this.includeAllCitations;
3530
+ }
3531
+ if (typeof this.enableAsyncFunctions !== 'undefined') {
3532
+ toReturn['enableAsyncFunctions'] = this.enableAsyncFunctions;
3533
+ }
3534
+ if (typeof this.maxTokens !== 'undefined') {
3535
+ toReturn['maxTokens'] = this.maxTokens;
3468
3536
  }
3469
3537
  return toReturn;
3470
3538
  }
@@ -3489,13 +3557,10 @@ class UpsertAssistantRequestOptions {
3489
3557
  return toReturn;
3490
3558
  }
3491
3559
  }
3492
- class GenerateChatAnswerRequestOptions {
3560
+ class CreatePromptModuleVersionRequestOptions {
3493
3561
  static fromProto(proto) {
3494
- let m = new GenerateChatAnswerRequestOptions();
3562
+ let m = new CreatePromptModuleVersionRequestOptions();
3495
3563
  m = Object.assign(m, proto);
3496
- if (proto.maxTokens) {
3497
- m.maxTokens = parseInt(proto.maxTokens, 10);
3498
- }
3499
3564
  return m;
3500
3565
  }
3501
3566
  constructor(kwargs) {
@@ -3506,14 +3571,8 @@ class GenerateChatAnswerRequestOptions {
3506
3571
  }
3507
3572
  toApiJson() {
3508
3573
  const toReturn = {};
3509
- if (typeof this.includeAllCitations !== 'undefined') {
3510
- toReturn['includeAllCitations'] = this.includeAllCitations;
3511
- }
3512
- if (typeof this.enableAsyncFunctions !== 'undefined') {
3513
- toReturn['enableAsyncFunctions'] = this.enableAsyncFunctions;
3514
- }
3515
- if (typeof this.maxTokens !== 'undefined') {
3516
- toReturn['maxTokens'] = this.maxTokens;
3574
+ if (typeof this.shouldDeploy !== 'undefined') {
3575
+ toReturn['shouldDeploy'] = this.shouldDeploy;
3517
3576
  }
3518
3577
  return toReturn;
3519
3578
  }
@@ -3820,6 +3879,11 @@ class AssistantApiService {
3820
3879
  const request = (r.toApiJson) ? r : new SetAssistantConnectionsRequest(r);
3821
3880
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/SetAssistantConnections", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3822
3881
  }
3882
+ executeFunction(r) {
3883
+ const request = (r.toApiJson) ? r : new ExecuteFunctionRequest(r);
3884
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/ExecuteFunction", request.toApiJson(), this.apiOptions())
3885
+ .pipe(map(resp => ExecuteFunctionResponse.fromProto(resp)));
3886
+ }
3823
3887
  }
3824
3888
  AssistantApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AssistantApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3825
3889
  AssistantApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AssistantApiService, providedIn: 'root' });
@@ -4159,5 +4223,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4159
4223
  * Generated bundle index. Do not edit.
4160
4224
  */
4161
4225
 
4162
- export { Access, Assistant, AssistantApiService, AssistantKey, AssistantType, BuildDefaultAssistantRequest, BuildDefaultAssistantResponse, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, ConfigVoiceConfig, ConfigurableGoal, Connection, ConnectionApiService, ConnectionKey, CreateGoalRequest, CreateGoalResponse, CreatePromptModuleRequest, CreatePromptModuleResponse, CreatePromptModuleVersionRequest, CreatePromptModuleVersionRequestOptions, CreatePromptRequest, DeepgramConfig, DeleteAssistantRequest, DeleteConnectionRequest, DeleteFunctionRequest, DeleteGoalRequest, DeletePromptModuleRequest, DeletePromptRequest, DeployPromptModuleRequest, DeployPromptRequest, Function, FunctionApiService, FunctionHeader, FunctionKey, FunctionParameter, FunctionParameterParameterLocation, 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, UpdateGoalRequest, UpdatePromptModuleRequest, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantRequestOptions, UpsertAssistantResponse, UpsertConnectionRequest, UpsertFunctionRequest, UpsertGoalRequest, VendorModel };
4226
+ export { Access, Assistant, AssistantApiService, AssistantKey, AssistantType, BuildDefaultAssistantRequest, BuildDefaultAssistantResponse, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, ConfigVoiceConfig, ConfigurableGoal, Connection, ConnectionApiService, ConnectionKey, CreateGoalRequest, CreateGoalResponse, CreatePromptModuleRequest, CreatePromptModuleResponse, CreatePromptModuleVersionRequest, CreatePromptModuleVersionRequestOptions, CreatePromptRequest, DeepgramConfig, DeleteAssistantRequest, DeleteConnectionRequest, DeleteFunctionRequest, DeleteGoalRequest, DeletePromptModuleRequest, DeletePromptRequest, DeployPromptModuleRequest, DeployPromptRequest, ExecuteFunctionRequest, ExecuteFunctionResponse, Function, FunctionApiService, FunctionHeader, FunctionKey, FunctionParameter, FunctionParameterParameterLocation, 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, UpdateGoalRequest, UpdatePromptModuleRequest, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantRequestOptions, UpsertAssistantResponse, UpsertConnectionRequest, UpsertFunctionRequest, UpsertGoalRequest, VendorModel };
4163
4227
  //# sourceMappingURL=vendasta-ai-assistants.mjs.map