diff --git a/apps/application/chat_pipeline/step/reset_problem_step/impl/base_reset_problem_step.py b/apps/application/chat_pipeline/step/reset_problem_step/impl/base_reset_problem_step.py index 2ab675570ca..c0595d590fb 100644 --- a/apps/application/chat_pipeline/step/reset_problem_step/impl/base_reset_problem_step.py +++ b/apps/application/chat_pipeline/step/reset_problem_step/impl/base_reset_problem_step.py @@ -23,6 +23,8 @@ class BaseResetProblemStep(IResetProblemStep): def execute(self, problem_text: str, history_chat_record: List[ChatRecord] = None, chat_model: BaseChatModel = None, **kwargs) -> str: if chat_model is None: + self.context['message_tokens'] = 0 + self.context['answer_tokens'] = 0 return problem_text start_index = len(history_chat_record) - 3 history_message = [[history_chat_record[index].get_human_message(), history_chat_record[index].get_ai_message()] diff --git a/apps/application/serializers/application_serializers.py b/apps/application/serializers/application_serializers.py index 164e0083fc0..e0abb772d5b 100644 --- a/apps/application/serializers/application_serializers.py +++ b/apps/application/serializers/application_serializers.py @@ -512,9 +512,7 @@ def edit(self, instance: Dict, with_valid=True): for update_key in update_keys: if update_key in instance and instance.get(update_key) is not None: if update_key == 'multiple_rounds_dialogue': - application.__setattr__('dialogue_number', - 0 if not instance.get(update_key) else ModelProvideConstants[ - model.provider].value.get_dialogue_number()) + application.__setattr__('dialogue_number', 0 if not instance.get(update_key) else 3) else: application.__setattr__(update_key, instance.get(update_key)) application.save()