mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
prepare #I6SC9C app_chatgpt优化,指定用户时增加使用情况
This commit is contained in:
@@ -45,7 +45,9 @@ class Channel(models.Model):
|
||||
return '\n'.join(prompt[::-1])
|
||||
|
||||
def get_ai(self, ai, prompt, partner_name, channel, user_id, message):
|
||||
res = ai.get_ai(prompt, partner_name)
|
||||
sender_id = message.create_uid.partner_id
|
||||
answer_id = user_id.partner_id
|
||||
res = ai.get_ai(prompt, sender_id, answer_id)
|
||||
if res:
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user