mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
parent
4eb46786a6
commit
b40790492c
|
|
@ -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()]
|
||||
|
|
|
|||
|
|
@ -512,9 +512,7 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue