ai*
This commit is contained in:
12
ai_livechat/controllers/ai_livechat_thread.py
Normal file
12
ai_livechat/controllers/ai_livechat_thread.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from odoo.addons.ai.controllers.thread import AIThreadController
|
||||
|
||||
|
||||
class AILivechatThreadController(AIThreadController):
|
||||
def _get_channel_ai_session(self, channel):
|
||||
if session := super()._get_channel_ai_session(channel):
|
||||
return session
|
||||
if channel.channel_type == 'livechat':
|
||||
return self.env['ai.session'].sudo().create({
|
||||
'agent_id': channel.sudo().ai_agent_id.id, 'channel_id': channel.id,
|
||||
})
|
||||
return session
|
||||
Reference in New Issue
Block a user