@@ -45,6 +45,8 @@ def get_api_info():
4545 {"Action" : "AsyncLlmMultiModeration" , "Version" : "2022-08-26" }, {}, {}),
4646 "GetMultiModerationResult" : ApiInfo ("GET" , "/openapi/v1/rc_llm/multi_moderation_result" ,
4747 {"Action" : "GetMultiModerationResult" , "Version" : "2022-08-26" }, {}, {}),
48+ "ImageTextLiteModeration" : ApiInfo ("POST" , "/openapi/v1/rc_llm/image_text_lite_moderation" ,
49+ {"Action" : "ImageTextLiteModeration" , "Version" : "2022-08-26" }, {}, {}),
4850 }
4951
5052 return api_info
@@ -134,4 +136,13 @@ def get_multi_moderation_result(self, params, body):
134136 if res == '' :
135137 raise Exception ("empty response" )
136138 res_json = json .loads (res )
139+ return res_json
140+
141+ @redo .retriable (sleeptime = 0.1 , jitter = 0.01 , attempts = 2 ,
142+ retry_exceptions = (exceptions .ConnectionError , exceptions .ConnectTimeout ))
143+ def image_text_lite_moderation (self , params , body ):
144+ res = self .json ("ImageTextLiteModeration" , params , json .dumps (body ))
145+ if res == '' :
146+ raise Exception ("empty response" )
147+ res_json = json .loads (res )
137148 return res_json
0 commit comments