fix chat but

This commit is contained in:
ivan deng
2023-04-23 19:35:19 +08:00
parent e00da2e2ad
commit 96896d0b50

View File

@@ -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}')