moderation_api 2.1.0 → 2.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/moderation_api/internal/transport/pooled_net_requester.rb +12 -10
- data/lib/moderation_api/models/content_submit_params.rb +147 -21
- data/lib/moderation_api/version.rb +1 -1
- data/rbi/moderation_api/models/content_submit_params.rbi +316 -62
- data/sig/moderation_api/models/content_submit_params.rbs +233 -62
- metadata +2 -2
|
@@ -757,11 +757,23 @@ module ModerationAPI
|
|
|
757
757
|
sig { returns(T::Boolean) }
|
|
758
758
|
attr_accessor :flag
|
|
759
759
|
|
|
760
|
-
sig {
|
|
761
|
-
|
|
760
|
+
sig { returns(T.nilable(Float)) }
|
|
761
|
+
attr_reader :threshold
|
|
762
|
+
|
|
763
|
+
sig { params(threshold: Float).void }
|
|
764
|
+
attr_writer :threshold
|
|
765
|
+
|
|
766
|
+
sig do
|
|
767
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
768
|
+
T.attached_class
|
|
769
|
+
)
|
|
770
|
+
end
|
|
771
|
+
def self.new(flag:, threshold: nil, id: :toxicity)
|
|
762
772
|
end
|
|
763
773
|
|
|
764
|
-
sig
|
|
774
|
+
sig do
|
|
775
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
776
|
+
end
|
|
765
777
|
def to_hash
|
|
766
778
|
end
|
|
767
779
|
end
|
|
@@ -781,11 +793,23 @@ module ModerationAPI
|
|
|
781
793
|
sig { returns(T::Boolean) }
|
|
782
794
|
attr_accessor :flag
|
|
783
795
|
|
|
784
|
-
sig {
|
|
785
|
-
|
|
796
|
+
sig { returns(T.nilable(Float)) }
|
|
797
|
+
attr_reader :threshold
|
|
798
|
+
|
|
799
|
+
sig { params(threshold: Float).void }
|
|
800
|
+
attr_writer :threshold
|
|
801
|
+
|
|
802
|
+
sig do
|
|
803
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
804
|
+
T.attached_class
|
|
805
|
+
)
|
|
806
|
+
end
|
|
807
|
+
def self.new(flag:, threshold: nil, id: :personal_information)
|
|
786
808
|
end
|
|
787
809
|
|
|
788
|
-
sig
|
|
810
|
+
sig do
|
|
811
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
812
|
+
end
|
|
789
813
|
def to_hash
|
|
790
814
|
end
|
|
791
815
|
end
|
|
@@ -805,11 +829,23 @@ module ModerationAPI
|
|
|
805
829
|
sig { returns(T::Boolean) }
|
|
806
830
|
attr_accessor :flag
|
|
807
831
|
|
|
808
|
-
sig {
|
|
809
|
-
|
|
832
|
+
sig { returns(T.nilable(Float)) }
|
|
833
|
+
attr_reader :threshold
|
|
834
|
+
|
|
835
|
+
sig { params(threshold: Float).void }
|
|
836
|
+
attr_writer :threshold
|
|
837
|
+
|
|
838
|
+
sig do
|
|
839
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
840
|
+
T.attached_class
|
|
841
|
+
)
|
|
842
|
+
end
|
|
843
|
+
def self.new(flag:, threshold: nil, id: :toxicity_severe)
|
|
810
844
|
end
|
|
811
845
|
|
|
812
|
-
sig
|
|
846
|
+
sig do
|
|
847
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
848
|
+
end
|
|
813
849
|
def to_hash
|
|
814
850
|
end
|
|
815
851
|
end
|
|
@@ -829,11 +865,23 @@ module ModerationAPI
|
|
|
829
865
|
sig { returns(T::Boolean) }
|
|
830
866
|
attr_accessor :flag
|
|
831
867
|
|
|
832
|
-
sig {
|
|
833
|
-
|
|
868
|
+
sig { returns(T.nilable(Float)) }
|
|
869
|
+
attr_reader :threshold
|
|
870
|
+
|
|
871
|
+
sig { params(threshold: Float).void }
|
|
872
|
+
attr_writer :threshold
|
|
873
|
+
|
|
874
|
+
sig do
|
|
875
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
876
|
+
T.attached_class
|
|
877
|
+
)
|
|
878
|
+
end
|
|
879
|
+
def self.new(flag:, threshold: nil, id: :hate)
|
|
834
880
|
end
|
|
835
881
|
|
|
836
|
-
sig
|
|
882
|
+
sig do
|
|
883
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
884
|
+
end
|
|
837
885
|
def to_hash
|
|
838
886
|
end
|
|
839
887
|
end
|
|
@@ -853,11 +901,23 @@ module ModerationAPI
|
|
|
853
901
|
sig { returns(T::Boolean) }
|
|
854
902
|
attr_accessor :flag
|
|
855
903
|
|
|
856
|
-
sig {
|
|
857
|
-
|
|
904
|
+
sig { returns(T.nilable(Float)) }
|
|
905
|
+
attr_reader :threshold
|
|
906
|
+
|
|
907
|
+
sig { params(threshold: Float).void }
|
|
908
|
+
attr_writer :threshold
|
|
909
|
+
|
|
910
|
+
sig do
|
|
911
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
912
|
+
T.attached_class
|
|
913
|
+
)
|
|
914
|
+
end
|
|
915
|
+
def self.new(flag:, threshold: nil, id: :illicit)
|
|
858
916
|
end
|
|
859
917
|
|
|
860
|
-
sig
|
|
918
|
+
sig do
|
|
919
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
920
|
+
end
|
|
861
921
|
def to_hash
|
|
862
922
|
end
|
|
863
923
|
end
|
|
@@ -877,11 +937,23 @@ module ModerationAPI
|
|
|
877
937
|
sig { returns(T::Boolean) }
|
|
878
938
|
attr_accessor :flag
|
|
879
939
|
|
|
880
|
-
sig {
|
|
881
|
-
|
|
940
|
+
sig { returns(T.nilable(Float)) }
|
|
941
|
+
attr_reader :threshold
|
|
942
|
+
|
|
943
|
+
sig { params(threshold: Float).void }
|
|
944
|
+
attr_writer :threshold
|
|
945
|
+
|
|
946
|
+
sig do
|
|
947
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
948
|
+
T.attached_class
|
|
949
|
+
)
|
|
950
|
+
end
|
|
951
|
+
def self.new(flag:, threshold: nil, id: :illicit_drugs)
|
|
882
952
|
end
|
|
883
953
|
|
|
884
|
-
sig
|
|
954
|
+
sig do
|
|
955
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
956
|
+
end
|
|
885
957
|
def to_hash
|
|
886
958
|
end
|
|
887
959
|
end
|
|
@@ -901,11 +973,23 @@ module ModerationAPI
|
|
|
901
973
|
sig { returns(T::Boolean) }
|
|
902
974
|
attr_accessor :flag
|
|
903
975
|
|
|
904
|
-
sig {
|
|
905
|
-
|
|
976
|
+
sig { returns(T.nilable(Float)) }
|
|
977
|
+
attr_reader :threshold
|
|
978
|
+
|
|
979
|
+
sig { params(threshold: Float).void }
|
|
980
|
+
attr_writer :threshold
|
|
981
|
+
|
|
982
|
+
sig do
|
|
983
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
984
|
+
T.attached_class
|
|
985
|
+
)
|
|
986
|
+
end
|
|
987
|
+
def self.new(flag:, threshold: nil, id: :illicit_alcohol)
|
|
906
988
|
end
|
|
907
989
|
|
|
908
|
-
sig
|
|
990
|
+
sig do
|
|
991
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
992
|
+
end
|
|
909
993
|
def to_hash
|
|
910
994
|
end
|
|
911
995
|
end
|
|
@@ -925,11 +1009,23 @@ module ModerationAPI
|
|
|
925
1009
|
sig { returns(T::Boolean) }
|
|
926
1010
|
attr_accessor :flag
|
|
927
1011
|
|
|
928
|
-
sig {
|
|
929
|
-
|
|
1012
|
+
sig { returns(T.nilable(Float)) }
|
|
1013
|
+
attr_reader :threshold
|
|
1014
|
+
|
|
1015
|
+
sig { params(threshold: Float).void }
|
|
1016
|
+
attr_writer :threshold
|
|
1017
|
+
|
|
1018
|
+
sig do
|
|
1019
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1020
|
+
T.attached_class
|
|
1021
|
+
)
|
|
1022
|
+
end
|
|
1023
|
+
def self.new(flag:, threshold: nil, id: :illicit_firearms)
|
|
930
1024
|
end
|
|
931
1025
|
|
|
932
|
-
sig
|
|
1026
|
+
sig do
|
|
1027
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1028
|
+
end
|
|
933
1029
|
def to_hash
|
|
934
1030
|
end
|
|
935
1031
|
end
|
|
@@ -949,11 +1045,23 @@ module ModerationAPI
|
|
|
949
1045
|
sig { returns(T::Boolean) }
|
|
950
1046
|
attr_accessor :flag
|
|
951
1047
|
|
|
952
|
-
sig {
|
|
953
|
-
|
|
1048
|
+
sig { returns(T.nilable(Float)) }
|
|
1049
|
+
attr_reader :threshold
|
|
1050
|
+
|
|
1051
|
+
sig { params(threshold: Float).void }
|
|
1052
|
+
attr_writer :threshold
|
|
1053
|
+
|
|
1054
|
+
sig do
|
|
1055
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1056
|
+
T.attached_class
|
|
1057
|
+
)
|
|
1058
|
+
end
|
|
1059
|
+
def self.new(flag:, threshold: nil, id: :illicit_tobacco)
|
|
954
1060
|
end
|
|
955
1061
|
|
|
956
|
-
sig
|
|
1062
|
+
sig do
|
|
1063
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1064
|
+
end
|
|
957
1065
|
def to_hash
|
|
958
1066
|
end
|
|
959
1067
|
end
|
|
@@ -973,11 +1081,23 @@ module ModerationAPI
|
|
|
973
1081
|
sig { returns(T::Boolean) }
|
|
974
1082
|
attr_accessor :flag
|
|
975
1083
|
|
|
976
|
-
sig {
|
|
977
|
-
|
|
1084
|
+
sig { returns(T.nilable(Float)) }
|
|
1085
|
+
attr_reader :threshold
|
|
1086
|
+
|
|
1087
|
+
sig { params(threshold: Float).void }
|
|
1088
|
+
attr_writer :threshold
|
|
1089
|
+
|
|
1090
|
+
sig do
|
|
1091
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1092
|
+
T.attached_class
|
|
1093
|
+
)
|
|
1094
|
+
end
|
|
1095
|
+
def self.new(flag:, threshold: nil, id: :illicit_gambling)
|
|
978
1096
|
end
|
|
979
1097
|
|
|
980
|
-
sig
|
|
1098
|
+
sig do
|
|
1099
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1100
|
+
end
|
|
981
1101
|
def to_hash
|
|
982
1102
|
end
|
|
983
1103
|
end
|
|
@@ -997,11 +1117,23 @@ module ModerationAPI
|
|
|
997
1117
|
sig { returns(T::Boolean) }
|
|
998
1118
|
attr_accessor :flag
|
|
999
1119
|
|
|
1000
|
-
sig {
|
|
1001
|
-
|
|
1120
|
+
sig { returns(T.nilable(Float)) }
|
|
1121
|
+
attr_reader :threshold
|
|
1122
|
+
|
|
1123
|
+
sig { params(threshold: Float).void }
|
|
1124
|
+
attr_writer :threshold
|
|
1125
|
+
|
|
1126
|
+
sig do
|
|
1127
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1128
|
+
T.attached_class
|
|
1129
|
+
)
|
|
1130
|
+
end
|
|
1131
|
+
def self.new(flag:, threshold: nil, id: :sexual)
|
|
1002
1132
|
end
|
|
1003
1133
|
|
|
1004
|
-
sig
|
|
1134
|
+
sig do
|
|
1135
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1136
|
+
end
|
|
1005
1137
|
def to_hash
|
|
1006
1138
|
end
|
|
1007
1139
|
end
|
|
@@ -1021,11 +1153,23 @@ module ModerationAPI
|
|
|
1021
1153
|
sig { returns(T::Boolean) }
|
|
1022
1154
|
attr_accessor :flag
|
|
1023
1155
|
|
|
1024
|
-
sig {
|
|
1025
|
-
|
|
1156
|
+
sig { returns(T.nilable(Float)) }
|
|
1157
|
+
attr_reader :threshold
|
|
1158
|
+
|
|
1159
|
+
sig { params(threshold: Float).void }
|
|
1160
|
+
attr_writer :threshold
|
|
1161
|
+
|
|
1162
|
+
sig do
|
|
1163
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1164
|
+
T.attached_class
|
|
1165
|
+
)
|
|
1166
|
+
end
|
|
1167
|
+
def self.new(flag:, threshold: nil, id: :flirtation)
|
|
1026
1168
|
end
|
|
1027
1169
|
|
|
1028
|
-
sig
|
|
1170
|
+
sig do
|
|
1171
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1172
|
+
end
|
|
1029
1173
|
def to_hash
|
|
1030
1174
|
end
|
|
1031
1175
|
end
|
|
@@ -1045,11 +1189,23 @@ module ModerationAPI
|
|
|
1045
1189
|
sig { returns(T::Boolean) }
|
|
1046
1190
|
attr_accessor :flag
|
|
1047
1191
|
|
|
1048
|
-
sig {
|
|
1049
|
-
|
|
1192
|
+
sig { returns(T.nilable(Float)) }
|
|
1193
|
+
attr_reader :threshold
|
|
1194
|
+
|
|
1195
|
+
sig { params(threshold: Float).void }
|
|
1196
|
+
attr_writer :threshold
|
|
1197
|
+
|
|
1198
|
+
sig do
|
|
1199
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1200
|
+
T.attached_class
|
|
1201
|
+
)
|
|
1202
|
+
end
|
|
1203
|
+
def self.new(flag:, threshold: nil, id: :profanity)
|
|
1050
1204
|
end
|
|
1051
1205
|
|
|
1052
|
-
sig
|
|
1206
|
+
sig do
|
|
1207
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1208
|
+
end
|
|
1053
1209
|
def to_hash
|
|
1054
1210
|
end
|
|
1055
1211
|
end
|
|
@@ -1069,11 +1225,23 @@ module ModerationAPI
|
|
|
1069
1225
|
sig { returns(T::Boolean) }
|
|
1070
1226
|
attr_accessor :flag
|
|
1071
1227
|
|
|
1072
|
-
sig {
|
|
1073
|
-
|
|
1228
|
+
sig { returns(T.nilable(Float)) }
|
|
1229
|
+
attr_reader :threshold
|
|
1230
|
+
|
|
1231
|
+
sig { params(threshold: Float).void }
|
|
1232
|
+
attr_writer :threshold
|
|
1233
|
+
|
|
1234
|
+
sig do
|
|
1235
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1236
|
+
T.attached_class
|
|
1237
|
+
)
|
|
1238
|
+
end
|
|
1239
|
+
def self.new(flag:, threshold: nil, id: :violence)
|
|
1074
1240
|
end
|
|
1075
1241
|
|
|
1076
|
-
sig
|
|
1242
|
+
sig do
|
|
1243
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1244
|
+
end
|
|
1077
1245
|
def to_hash
|
|
1078
1246
|
end
|
|
1079
1247
|
end
|
|
@@ -1093,11 +1261,23 @@ module ModerationAPI
|
|
|
1093
1261
|
sig { returns(T::Boolean) }
|
|
1094
1262
|
attr_accessor :flag
|
|
1095
1263
|
|
|
1096
|
-
sig {
|
|
1097
|
-
|
|
1264
|
+
sig { returns(T.nilable(Float)) }
|
|
1265
|
+
attr_reader :threshold
|
|
1266
|
+
|
|
1267
|
+
sig { params(threshold: Float).void }
|
|
1268
|
+
attr_writer :threshold
|
|
1269
|
+
|
|
1270
|
+
sig do
|
|
1271
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1272
|
+
T.attached_class
|
|
1273
|
+
)
|
|
1274
|
+
end
|
|
1275
|
+
def self.new(flag:, threshold: nil, id: :self_harm)
|
|
1098
1276
|
end
|
|
1099
1277
|
|
|
1100
|
-
sig
|
|
1278
|
+
sig do
|
|
1279
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1280
|
+
end
|
|
1101
1281
|
def to_hash
|
|
1102
1282
|
end
|
|
1103
1283
|
end
|
|
@@ -1117,11 +1297,23 @@ module ModerationAPI
|
|
|
1117
1297
|
sig { returns(T::Boolean) }
|
|
1118
1298
|
attr_accessor :flag
|
|
1119
1299
|
|
|
1120
|
-
sig {
|
|
1121
|
-
|
|
1300
|
+
sig { returns(T.nilable(Float)) }
|
|
1301
|
+
attr_reader :threshold
|
|
1302
|
+
|
|
1303
|
+
sig { params(threshold: Float).void }
|
|
1304
|
+
attr_writer :threshold
|
|
1305
|
+
|
|
1306
|
+
sig do
|
|
1307
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1308
|
+
T.attached_class
|
|
1309
|
+
)
|
|
1310
|
+
end
|
|
1311
|
+
def self.new(flag:, threshold: nil, id: :spam)
|
|
1122
1312
|
end
|
|
1123
1313
|
|
|
1124
|
-
sig
|
|
1314
|
+
sig do
|
|
1315
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1316
|
+
end
|
|
1125
1317
|
def to_hash
|
|
1126
1318
|
end
|
|
1127
1319
|
end
|
|
@@ -1141,11 +1333,23 @@ module ModerationAPI
|
|
|
1141
1333
|
sig { returns(T::Boolean) }
|
|
1142
1334
|
attr_accessor :flag
|
|
1143
1335
|
|
|
1144
|
-
sig {
|
|
1145
|
-
|
|
1336
|
+
sig { returns(T.nilable(Float)) }
|
|
1337
|
+
attr_reader :threshold
|
|
1338
|
+
|
|
1339
|
+
sig { params(threshold: Float).void }
|
|
1340
|
+
attr_writer :threshold
|
|
1341
|
+
|
|
1342
|
+
sig do
|
|
1343
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1344
|
+
T.attached_class
|
|
1345
|
+
)
|
|
1346
|
+
end
|
|
1347
|
+
def self.new(flag:, threshold: nil, id: :self_promotion)
|
|
1146
1348
|
end
|
|
1147
1349
|
|
|
1148
|
-
sig
|
|
1350
|
+
sig do
|
|
1351
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1352
|
+
end
|
|
1149
1353
|
def to_hash
|
|
1150
1354
|
end
|
|
1151
1355
|
end
|
|
@@ -1165,11 +1369,23 @@ module ModerationAPI
|
|
|
1165
1369
|
sig { returns(T::Boolean) }
|
|
1166
1370
|
attr_accessor :flag
|
|
1167
1371
|
|
|
1168
|
-
sig {
|
|
1169
|
-
|
|
1372
|
+
sig { returns(T.nilable(Float)) }
|
|
1373
|
+
attr_reader :threshold
|
|
1374
|
+
|
|
1375
|
+
sig { params(threshold: Float).void }
|
|
1376
|
+
attr_writer :threshold
|
|
1377
|
+
|
|
1378
|
+
sig do
|
|
1379
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1380
|
+
T.attached_class
|
|
1381
|
+
)
|
|
1382
|
+
end
|
|
1383
|
+
def self.new(flag:, threshold: nil, id: :political)
|
|
1170
1384
|
end
|
|
1171
1385
|
|
|
1172
|
-
sig
|
|
1386
|
+
sig do
|
|
1387
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1388
|
+
end
|
|
1173
1389
|
def to_hash
|
|
1174
1390
|
end
|
|
1175
1391
|
end
|
|
@@ -1189,11 +1405,23 @@ module ModerationAPI
|
|
|
1189
1405
|
sig { returns(T::Boolean) }
|
|
1190
1406
|
attr_accessor :flag
|
|
1191
1407
|
|
|
1192
|
-
sig {
|
|
1193
|
-
|
|
1408
|
+
sig { returns(T.nilable(Float)) }
|
|
1409
|
+
attr_reader :threshold
|
|
1410
|
+
|
|
1411
|
+
sig { params(threshold: Float).void }
|
|
1412
|
+
attr_writer :threshold
|
|
1413
|
+
|
|
1414
|
+
sig do
|
|
1415
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1416
|
+
T.attached_class
|
|
1417
|
+
)
|
|
1418
|
+
end
|
|
1419
|
+
def self.new(flag:, threshold: nil, id: :religion)
|
|
1194
1420
|
end
|
|
1195
1421
|
|
|
1196
|
-
sig
|
|
1422
|
+
sig do
|
|
1423
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1424
|
+
end
|
|
1197
1425
|
def to_hash
|
|
1198
1426
|
end
|
|
1199
1427
|
end
|
|
@@ -1213,11 +1441,23 @@ module ModerationAPI
|
|
|
1213
1441
|
sig { returns(T::Boolean) }
|
|
1214
1442
|
attr_accessor :flag
|
|
1215
1443
|
|
|
1216
|
-
sig {
|
|
1217
|
-
|
|
1444
|
+
sig { returns(T.nilable(Float)) }
|
|
1445
|
+
attr_reader :threshold
|
|
1446
|
+
|
|
1447
|
+
sig { params(threshold: Float).void }
|
|
1448
|
+
attr_writer :threshold
|
|
1449
|
+
|
|
1450
|
+
sig do
|
|
1451
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1452
|
+
T.attached_class
|
|
1453
|
+
)
|
|
1454
|
+
end
|
|
1455
|
+
def self.new(flag:, threshold: nil, id: :code_abuse)
|
|
1218
1456
|
end
|
|
1219
1457
|
|
|
1220
|
-
sig
|
|
1458
|
+
sig do
|
|
1459
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1460
|
+
end
|
|
1221
1461
|
def to_hash
|
|
1222
1462
|
end
|
|
1223
1463
|
end
|
|
@@ -1603,15 +1843,28 @@ module ModerationAPI
|
|
|
1603
1843
|
sig { returns(String) }
|
|
1604
1844
|
attr_accessor :instructions
|
|
1605
1845
|
|
|
1846
|
+
sig { returns(T.nilable(Float)) }
|
|
1847
|
+
attr_reader :threshold
|
|
1848
|
+
|
|
1849
|
+
sig { params(threshold: Float).void }
|
|
1850
|
+
attr_writer :threshold
|
|
1851
|
+
|
|
1606
1852
|
sig do
|
|
1607
1853
|
params(
|
|
1608
1854
|
flag: T::Boolean,
|
|
1609
1855
|
guideline_key: String,
|
|
1610
1856
|
instructions: String,
|
|
1857
|
+
threshold: Float,
|
|
1611
1858
|
id: Symbol
|
|
1612
1859
|
).returns(T.attached_class)
|
|
1613
1860
|
end
|
|
1614
|
-
def self.new(
|
|
1861
|
+
def self.new(
|
|
1862
|
+
flag:,
|
|
1863
|
+
guideline_key:,
|
|
1864
|
+
instructions:,
|
|
1865
|
+
threshold: nil,
|
|
1866
|
+
id: :guideline
|
|
1867
|
+
)
|
|
1615
1868
|
end
|
|
1616
1869
|
|
|
1617
1870
|
sig do
|
|
@@ -1620,7 +1873,8 @@ module ModerationAPI
|
|
|
1620
1873
|
id: Symbol,
|
|
1621
1874
|
flag: T::Boolean,
|
|
1622
1875
|
guideline_key: String,
|
|
1623
|
-
instructions: String
|
|
1876
|
+
instructions: String,
|
|
1877
|
+
threshold: Float
|
|
1624
1878
|
}
|
|
1625
1879
|
)
|
|
1626
1880
|
end
|