@@ -516,7 +516,7 @@ def list(self, with_valid=True):
516516 @staticmethod
517517 def reset_application (application : Dict ):
518518 application ['multiple_rounds_dialogue' ] = True if application .get ('dialogue_number' ) > 0 else False
519- del application [ 'dialogue_number' ]
519+
520520 if 'dataset_setting' in application :
521521 application ['dataset_setting' ] = {'search_mode' : 'embedding' , 'no_references_setting' : {
522522 'status' : 'ai_questioning' ,
@@ -717,14 +717,11 @@ def edit(self, instance: Dict, with_valid=True):
717717 self .update_reverse_search_node (instance .get ('work_flow' ), application_dataset_id_list )
718718
719719 update_keys = ['name' , 'desc' , 'model_id' , 'multiple_rounds_dialogue' , 'prologue' , 'status' ,
720- 'dataset_setting' , 'model_setting' , 'problem_optimization' ,
720+ 'dataset_setting' , 'model_setting' , 'problem_optimization' , 'dialogue_number' ,
721721 'api_key_is_active' , 'icon' , 'work_flow' , 'model_params_setting' ]
722722 for update_key in update_keys :
723723 if update_key in instance and instance .get (update_key ) is not None :
724- if update_key == 'multiple_rounds_dialogue' :
725- application .__setattr__ ('dialogue_number' , 0 if not instance .get (update_key ) else 3 )
726- else :
727- application .__setattr__ (update_key , instance .get (update_key ))
724+ application .__setattr__ (update_key , instance .get (update_key ))
728725 application .save ()
729726
730727 if 'dataset_id_list' in instance :
@@ -823,6 +820,16 @@ def save_other_config(self, data):
823820
824821 application .save ()
825822
823+ def speech_to_text (self , filelist ):
824+ # todo 找到模型 mp3转text
825+ print (self .application_id )
826+ print (filelist )
827+
828+ def text_to_speech (self , text ):
829+ # todo 找到模型 text转bytes
830+ print (self .application_id )
831+ print (text )
832+
826833 class ApplicationKeySerializerModel (serializers .ModelSerializer ):
827834 class Meta :
828835 model = ApplicationApiKey
0 commit comments