fix #I6RFA0 [app_chat_gpt]异步处理,当前有问题

This commit is contained in:
Chill
2023-03-30 11:30:56 +08:00
parent 828e6bc8e8
commit 94c3dce069

View File

@@ -46,6 +46,7 @@ class Channel(models.Model):
def get_ai(self, ai, prompt, partner_name, channel, user_id, message): def get_ai(self, ai, prompt, partner_name, channel, user_id, message):
res = ai.get_ai(prompt, partner_name) res = ai.get_ai(prompt, partner_name)
if res:
res = res.replace('\n', '<br/>') res = res.replace('\n', '<br/>')
channel.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment', parent_id=message.id) channel.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment', parent_id=message.id)