@@ -961,7 +961,7 @@ def rename_chat_history(self, filename, chatbot):
961
961
filename = os .path .basename (full_path )
962
962
963
963
self .history_file_path = filename
964
- save_file (filename , self , chatbot )
964
+ save_file (filename , self )
965
965
return init_history_list (self .user_name )
966
966
967
967
def auto_name_chat_history (
@@ -978,14 +978,14 @@ def auto_name_chat_history(
978
978
979
979
def auto_save (self , chatbot = None ):
980
980
if chatbot is not None :
981
- save_file (self .history_file_path , self , chatbot )
981
+ save_file (self .history_file_path , self )
982
982
983
983
def export_markdown (self , filename , chatbot ):
984
984
if filename == "" :
985
985
return
986
986
if not filename .endswith (".md" ):
987
987
filename += ".md"
988
- save_file (filename , self , chatbot )
988
+ save_file (filename , self )
989
989
990
990
def load_chat_history (self , new_history_file_path = None ):
991
991
logging .debug (f"{ self .user_name } 加载对话历史中……" )
@@ -1034,6 +1034,8 @@ def load_chat_history(self, new_history_file_path=None):
1034
1034
- len (saved_json ["chatbot" ]) :
1035
1035
]
1036
1036
logging .info (f"Trimmed history: { saved_json ['history' ]} " )
1037
+ # Sanitize chatbot
1038
+ saved_json ["chatbot" ] = remove_html_tags (saved_json ["chatbot" ])
1037
1039
logging .debug (f"{ self .user_name } 加载对话历史完毕" )
1038
1040
self .history = saved_json ["history" ]
1039
1041
self .single_turn = saved_json .get ("single_turn" , self .single_turn )
0 commit comments