update ai msg ui

This commit is contained in:
Chill
2023-04-25 11:30:32 +08:00
parent 641b443391
commit 1810c81155
3 changed files with 8 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ class Channel(models.Model):
if res:
res = res.replace('\n', '<br/>')
new_msg = channel.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment', parent_id=message.id)
new_msg.write({'is_ai': True})
if usage:
prompt_tokens = usage['prompt_tokens']
completion_tokens = usage['completion_tokens']