diff --git a/app_chatgpt/models/mail_channel.py b/app_chatgpt/models/mail_channel.py index 3dcd6b93..2f7c21db 100644 --- a/app_chatgpt/models/mail_channel.py +++ b/app_chatgpt/models/mail_channel.py @@ -165,7 +165,10 @@ class Channel(models.Model): sync_config = self.env['ir.config_parameter'].sudo().get_param('app_chatgpt.openai_sync_config') openai.api_key = api_key # 非4版本,取0次。其它取3 次历史 - chat_count = 0 if '4' in ai.ai_model else 3 + if '4' in ai.ai_model: + chat_count = 1 if self.chat_count > 0 else 0 + else: + chat_count = self.chat_count if author_id != answer_id.id and self.channel_type == 'chat': # 私聊 _logger.info(f'私聊:author_id:{author_id},partner_chatgpt.id:{answer_id.id}')