@vendasta/ai-assistants 0.26.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.
@@ -1866,15 +1866,15 @@ class DeployPromptRequest {
1866
1866
  return toReturn;
1867
1867
  }
1868
1868
  }
1869
- class ListConnectionsRequestFilters {
1869
+ class ExecuteFunctionRequest {
1870
1870
  static fromProto(proto) {
1871
- let m = new ListConnectionsRequestFilters();
1871
+ let m = new ExecuteFunctionRequest();
1872
1872
  m = Object.assign(m, proto);
1873
- if (proto.namespace) {
1874
- m.namespace = Namespace.fromProto(proto.namespace);
1873
+ if (proto.assistantKey) {
1874
+ m.assistantKey = AssistantKey.fromProto(proto.assistantKey);
1875
1875
  }
1876
- if (proto.assistantType) {
1877
- m.assistantType = enumStringToValue(AssistantType, proto.assistantType);
1876
+ if (proto.functionKey) {
1877
+ m.functionKey = FunctionKey.fromProto(proto.functionKey);
1878
1878
  }
1879
1879
  return m;
1880
1880
  }
@@ -1886,22 +1886,57 @@ class ListConnectionsRequestFilters {
1886
1886
  }
1887
1887
  toApiJson() {
1888
1888
  const toReturn = {};
1889
- if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
1890
- 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;
1891
1891
  }
1892
- if (typeof this.assistantType !== 'undefined') {
1893
- 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;
1894
1897
  }
1895
1898
  return toReturn;
1896
1899
  }
1897
1900
  }
1898
- class ListPromptModuleRequestFilters {
1901
+ class ExecuteFunctionResponse {
1899
1902
  static fromProto(proto) {
1900
- 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();
1901
1930
  m = Object.assign(m, proto);
1902
1931
  if (proto.namespace) {
1903
1932
  m.namespace = Namespace.fromProto(proto.namespace);
1904
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
+ }
1905
1940
  return m;
1906
1941
  }
1907
1942
  constructor(kwargs) {
@@ -1915,6 +1950,12 @@ class ListPromptModuleRequestFilters {
1915
1950
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
1916
1951
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
1917
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
+ }
1918
1959
  return toReturn;
1919
1960
  }
1920
1961
  }
@@ -1941,6 +1982,29 @@ class ListAllAssistantsAssociatedToConnectionRequestFilters {
1941
1982
  return toReturn;
1942
1983
  }
1943
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
+ }
1944
2008
  class ListAssistantRequestFilters {
1945
2009
  static fromProto(proto) {
1946
2010
  let m = new ListAssistantRequestFilters();
@@ -1970,9 +2034,9 @@ class ListAssistantRequestFilters {
1970
2034
  return toReturn;
1971
2035
  }
1972
2036
  }
1973
- class ListFunctionRequestFilters {
2037
+ class ListPromptModuleRequestFilters {
1974
2038
  static fromProto(proto) {
1975
- let m = new ListFunctionRequestFilters();
2039
+ let m = new ListPromptModuleRequestFilters();
1976
2040
  m = Object.assign(m, proto);
1977
2041
  if (proto.namespace) {
1978
2042
  m.namespace = Namespace.fromProto(proto.namespace);
@@ -1993,18 +2057,15 @@ class ListFunctionRequestFilters {
1993
2057
  return toReturn;
1994
2058
  }
1995
2059
  }
1996
- class ListGoalsRequestFilters {
2060
+ class ListConnectionsRequestFilters {
1997
2061
  static fromProto(proto) {
1998
- let m = new ListGoalsRequestFilters();
2062
+ let m = new ListConnectionsRequestFilters();
1999
2063
  m = Object.assign(m, proto);
2000
2064
  if (proto.namespace) {
2001
2065
  m.namespace = Namespace.fromProto(proto.namespace);
2002
2066
  }
2003
- if (proto.type) {
2004
- m.type = enumStringToValue(GoalType, proto.type);
2005
- }
2006
- if (proto.supportedChannels) {
2007
- m.supportedChannels = proto.supportedChannels.map((v) => enumStringToValue(GoalChannel, v));
2067
+ if (proto.assistantType) {
2068
+ m.assistantType = enumStringToValue(AssistantType, proto.assistantType);
2008
2069
  }
2009
2070
  return m;
2010
2071
  }
@@ -2019,11 +2080,8 @@ class ListGoalsRequestFilters {
2019
2080
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
2020
2081
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
2021
2082
  }
2022
- if (typeof this.type !== 'undefined') {
2023
- toReturn['type'] = this.type;
2024
- }
2025
- if (typeof this.supportedChannels !== 'undefined') {
2026
- toReturn['supportedChannels'] = this.supportedChannels;
2083
+ if (typeof this.assistantType !== 'undefined') {
2084
+ toReturn['assistantType'] = this.assistantType;
2027
2085
  }
2028
2086
  return toReturn;
2029
2087
  }
@@ -3450,10 +3508,13 @@ class ListPromptVersionsResponse {
3450
3508
  return toReturn;
3451
3509
  }
3452
3510
  }
3453
- class CreatePromptModuleVersionRequestOptions {
3511
+ class GenerateChatAnswerRequestOptions {
3454
3512
  static fromProto(proto) {
3455
- let m = new CreatePromptModuleVersionRequestOptions();
3513
+ let m = new GenerateChatAnswerRequestOptions();
3456
3514
  m = Object.assign(m, proto);
3515
+ if (proto.maxTokens) {
3516
+ m.maxTokens = parseInt(proto.maxTokens, 10);
3517
+ }
3457
3518
  return m;
3458
3519
  }
3459
3520
  constructor(kwargs) {
@@ -3464,8 +3525,14 @@ class CreatePromptModuleVersionRequestOptions {
3464
3525
  }
3465
3526
  toApiJson() {
3466
3527
  const toReturn = {};
3467
- if (typeof this.shouldDeploy !== 'undefined') {
3468
- 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;
3469
3536
  }
3470
3537
  return toReturn;
3471
3538
  }
@@ -3490,13 +3557,10 @@ class UpsertAssistantRequestOptions {
3490
3557
  return toReturn;
3491
3558
  }
3492
3559
  }
3493
- class GenerateChatAnswerRequestOptions {
3560
+ class CreatePromptModuleVersionRequestOptions {
3494
3561
  static fromProto(proto) {
3495
- let m = new GenerateChatAnswerRequestOptions();
3562
+ let m = new CreatePromptModuleVersionRequestOptions();
3496
3563
  m = Object.assign(m, proto);
3497
- if (proto.maxTokens) {
3498
- m.maxTokens = parseInt(proto.maxTokens, 10);
3499
- }
3500
3564
  return m;
3501
3565
  }
3502
3566
  constructor(kwargs) {
@@ -3507,14 +3571,8 @@ class GenerateChatAnswerRequestOptions {
3507
3571
  }
3508
3572
  toApiJson() {
3509
3573
  const toReturn = {};
3510
- if (typeof this.includeAllCitations !== 'undefined') {
3511
- toReturn['includeAllCitations'] = this.includeAllCitations;
3512
- }
3513
- if (typeof this.enableAsyncFunctions !== 'undefined') {
3514
- toReturn['enableAsyncFunctions'] = this.enableAsyncFunctions;
3515
- }
3516
- if (typeof this.maxTokens !== 'undefined') {
3517
- toReturn['maxTokens'] = this.maxTokens;
3574
+ if (typeof this.shouldDeploy !== 'undefined') {
3575
+ toReturn['shouldDeploy'] = this.shouldDeploy;
3518
3576
  }
3519
3577
  return toReturn;
3520
3578
  }
@@ -3821,6 +3879,11 @@ class AssistantApiService {
3821
3879
  const request = (r.toApiJson) ? r : new SetAssistantConnectionsRequest(r);
3822
3880
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/SetAssistantConnections", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
3823
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
+ }
3824
3887
  }
3825
3888
  AssistantApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AssistantApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3826
3889
  AssistantApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AssistantApiService, providedIn: 'root' });
@@ -4160,5 +4223,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4160
4223
  * Generated bundle index. Do not edit.
4161
4224
  */
4162
4225
 
4163
- 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 };
4164
4227
  //# sourceMappingURL=vendasta-ai-assistants.mjs.map