@vendasta/ai-assistants 0.19.0 → 0.21.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.
@@ -749,6 +749,36 @@ function enumStringToValue$6(enumRef, value) {
749
749
  }
750
750
  return enumRef[value];
751
751
  }
752
+ class KeyValuePair {
753
+ static fromProto(proto) {
754
+ let m = new KeyValuePair();
755
+ m = Object.assign(m, proto);
756
+ return m;
757
+ }
758
+ constructor(kwargs) {
759
+ if (!kwargs) {
760
+ return;
761
+ }
762
+ Object.assign(this, kwargs);
763
+ }
764
+ toApiJson() {
765
+ const toReturn = {};
766
+ if (typeof this.key !== 'undefined') {
767
+ toReturn['key'] = this.key;
768
+ }
769
+ if (typeof this.value !== 'undefined') {
770
+ toReturn['value'] = this.value;
771
+ }
772
+ return toReturn;
773
+ }
774
+ }
775
+
776
+ function enumStringToValue$5(enumRef, value) {
777
+ if (typeof value === 'number') {
778
+ return value;
779
+ }
780
+ return enumRef[value];
781
+ }
752
782
  class Assistant {
753
783
  static fromProto(proto) {
754
784
  let m = new Assistant();
@@ -757,7 +787,7 @@ class Assistant {
757
787
  m.namespace = Namespace.fromProto(proto.namespace);
758
788
  }
759
789
  if (proto.type) {
760
- m.type = enumStringToValue$6(AssistantType, proto.type);
790
+ m.type = enumStringToValue$5(AssistantType, proto.type);
761
791
  }
762
792
  if (proto.config) {
763
793
  m.config = Config.fromProto(proto.config);
@@ -861,6 +891,9 @@ class ConfigurableGoal {
861
891
  if (proto.goal) {
862
892
  m.goal = Goal.fromProto(proto.goal);
863
893
  }
894
+ if (proto.configuration) {
895
+ m.configuration = proto.configuration.map(KeyValuePair.fromProto);
896
+ }
864
897
  return m;
865
898
  }
866
899
  constructor(kwargs) {
@@ -874,6 +907,9 @@ class ConfigurableGoal {
874
907
  if (typeof this.goal !== 'undefined' && this.goal !== null) {
875
908
  toReturn['goal'] = 'toApiJson' in this.goal ? this.goal.toApiJson() : this.goal;
876
909
  }
910
+ if (typeof this.configuration !== 'undefined' && this.configuration !== null) {
911
+ toReturn['configuration'] = 'toApiJson' in this.configuration ? this.configuration.toApiJson() : this.configuration;
912
+ }
877
913
  return toReturn;
878
914
  }
879
915
  }
@@ -1006,7 +1042,7 @@ class ConfigVoiceConfig {
1006
1042
  let m = new ConfigVoiceConfig();
1007
1043
  m = Object.assign(m, proto);
1008
1044
  if (proto.vendorModel) {
1009
- m.vendorModel = enumStringToValue$6(VendorModel, proto.vendorModel);
1045
+ m.vendorModel = enumStringToValue$5(VendorModel, proto.vendorModel);
1010
1046
  }
1011
1047
  if (proto.modelConfig) {
1012
1048
  m.modelConfig = ModelConfig.fromProto(proto.modelConfig);
@@ -1031,7 +1067,7 @@ class ConfigVoiceConfig {
1031
1067
  }
1032
1068
  }
1033
1069
 
1034
- function enumStringToValue$5(enumRef, value) {
1070
+ function enumStringToValue$4(enumRef, value) {
1035
1071
  if (typeof value === 'number') {
1036
1072
  return value;
1037
1073
  }
@@ -1048,7 +1084,7 @@ class Connection {
1048
1084
  m.assistantKeys = proto.assistantKeys.map(AssistantKey.fromProto);
1049
1085
  }
1050
1086
  if (proto.supportedAssistantTypes) {
1051
- m.supportedAssistantTypes = proto.supportedAssistantTypes.map((v) => enumStringToValue$5(AssistantType, v));
1087
+ m.supportedAssistantTypes = proto.supportedAssistantTypes.map((v) => enumStringToValue$4(AssistantType, v));
1052
1088
  }
1053
1089
  return m;
1054
1090
  }
@@ -1123,36 +1159,6 @@ class ConnectionKey {
1123
1159
  }
1124
1160
  }
1125
1161
 
1126
- function enumStringToValue$4(enumRef, value) {
1127
- if (typeof value === 'number') {
1128
- return value;
1129
- }
1130
- return enumRef[value];
1131
- }
1132
- class KeyValuePair {
1133
- static fromProto(proto) {
1134
- let m = new KeyValuePair();
1135
- m = Object.assign(m, proto);
1136
- return m;
1137
- }
1138
- constructor(kwargs) {
1139
- if (!kwargs) {
1140
- return;
1141
- }
1142
- Object.assign(this, kwargs);
1143
- }
1144
- toApiJson() {
1145
- const toReturn = {};
1146
- if (typeof this.key !== 'undefined') {
1147
- toReturn['key'] = this.key;
1148
- }
1149
- if (typeof this.value !== 'undefined') {
1150
- toReturn['value'] = this.value;
1151
- }
1152
- return toReturn;
1153
- }
1154
- }
1155
-
1156
1162
  function enumStringToValue$3(enumRef, value) {
1157
1163
  if (typeof value === 'number') {
1158
1164
  return value;
@@ -3402,6 +3408,9 @@ class GenerateChatAnswerRequestOptions {
3402
3408
  static fromProto(proto) {
3403
3409
  let m = new GenerateChatAnswerRequestOptions();
3404
3410
  m = Object.assign(m, proto);
3411
+ if (proto.maxTokens) {
3412
+ m.maxTokens = parseInt(proto.maxTokens, 10);
3413
+ }
3405
3414
  return m;
3406
3415
  }
3407
3416
  constructor(kwargs) {
@@ -3418,6 +3427,9 @@ class GenerateChatAnswerRequestOptions {
3418
3427
  if (typeof this.enableAsyncFunctions !== 'undefined') {
3419
3428
  toReturn['enableAsyncFunctions'] = this.enableAsyncFunctions;
3420
3429
  }
3430
+ if (typeof this.maxTokens !== 'undefined') {
3431
+ toReturn['maxTokens'] = this.maxTokens;
3432
+ }
3421
3433
  return toReturn;
3422
3434
  }
3423
3435
  }