mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt 对话
This commit is contained in:
@@ -6,8 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 16.0+e-20241226\n"
|
"Project-Id-Version: Odoo Server 16.0+e-20241226\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2025-02-07 12:32+0000\n"
|
"POT-Creation-Date: 2025-02-07 15:24+0000\n"
|
||||||
"PO-Revision-Date: 2025-02-07 12:32+0000\n"
|
"PO-Revision-Date: 2025-02-07 15:24+0000\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -75,7 +75,8 @@ msgid ""
|
|||||||
" so it counts against the overall token limit.\n"
|
" so it counts against the overall token limit.\n"
|
||||||
" "
|
" "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ai角色场景设定。为Ai设定角色和场景后,Ai即可按你设定要求进行回答。你可以让Ai专注某领域回答,描述Ai个性。并告诉Ai应该回答什么,不应该回答什么,并告诉他以何种格式响应。角色设定会计入整体的会话Token限制和数量。"
|
"Ai角色场景设定。为Ai设定角色和场景后,Ai即可按你设定要求进行回答。你可以让Ai专注某领域回答,描述Ai个性。"
|
||||||
|
"并告诉Ai应该回答什么,不应该回答什么,并告诉他以何种格式响应。角色设定会计入整体的会话Token限制和数量。"
|
||||||
|
|
||||||
#. module: app_chatgpt
|
#. module: app_chatgpt
|
||||||
#: model:ir.model.fields,help:app_chatgpt.field_ai_robot__top_p
|
#: model:ir.model.fields,help:app_chatgpt.field_ai_robot__top_p
|
||||||
@@ -706,6 +707,11 @@ msgstr "用户设定的角色相关,一般不要调整"
|
|||||||
msgid "Ai Conversation"
|
msgid "Ai Conversation"
|
||||||
msgstr "开启Ai二人转"
|
msgstr "开启Ai二人转"
|
||||||
|
|
||||||
|
#. module: app_chatgpt
|
||||||
|
#: model_terms:ir.ui.view,arch_db:app_chatgpt.ai_mail_channel_view_kanban
|
||||||
|
msgid "Ai Conversation:"
|
||||||
|
msgstr "Ai二人转"
|
||||||
|
|
||||||
#. module: app_chatgpt
|
#. module: app_chatgpt
|
||||||
#: model:ir.model.fields,field_description:app_chatgpt.field_ai_robot__ai_model
|
#: model:ir.model.fields,field_description:app_chatgpt.field_ai_robot__ai_model
|
||||||
msgid "Ai Model"
|
msgid "Ai Model"
|
||||||
@@ -761,6 +767,11 @@ msgstr "Ai用户"
|
|||||||
msgid "Ai would help you act as the Character set."
|
msgid "Ai would help you act as the Character set."
|
||||||
msgstr "Ai将按您设定的角色与场景进行思考并会话。"
|
msgstr "Ai将按您设定的角色与场景进行思考并会话。"
|
||||||
|
|
||||||
|
#. module: app_chatgpt
|
||||||
|
#: model:mail.channel,description:app_chatgpt.channel_ai_conversation
|
||||||
|
msgid "Ai互怼/辩论/二人转"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: app_chatgpt
|
#. module: app_chatgpt
|
||||||
#: model:ir.model.fields.selection,name:app_chatgpt.selection__res_users__gpt_policy__all
|
#: model:ir.model.fields.selection,name:app_chatgpt.selection__res_users__gpt_policy__all
|
||||||
msgid "All Users"
|
msgid "All Users"
|
||||||
@@ -1779,6 +1790,11 @@ msgstr "专属主Ai"
|
|||||||
msgid "Main Ai is the robot help you default."
|
msgid "Main Ai is the robot help you default."
|
||||||
msgstr "主Ai是主要对话对象,当没有 @ 操作时,由主Ai回答"
|
msgstr "主Ai是主要对话对象,当没有 @ 操作时,由主Ai回答"
|
||||||
|
|
||||||
|
#. module: app_chatgpt
|
||||||
|
#: model_terms:ir.ui.view,arch_db:app_chatgpt.ai_mail_channel_view_kanban
|
||||||
|
msgid "Main Ai:"
|
||||||
|
msgstr "专属主Ai:"
|
||||||
|
|
||||||
#. module: app_chatgpt
|
#. module: app_chatgpt
|
||||||
#: model:ir.model.fields,field_description:app_chatgpt.field_mail_channel__ai_sys_content
|
#: model:ir.model.fields,field_description:app_chatgpt.field_mail_channel__ai_sys_content
|
||||||
msgid "Main Robot Role"
|
msgid "Main Robot Role"
|
||||||
@@ -2176,7 +2192,7 @@ msgid ""
|
|||||||
"Role-playing and scene setting.Give the model instructions about how it "
|
"Role-playing and scene setting.Give the model instructions about how it "
|
||||||
"should behave and any context it should reference when generating a "
|
"should behave and any context it should reference when generating a "
|
||||||
"response."
|
"response."
|
||||||
msgstr ""
|
msgstr "默认Ai的角色设定及场景设定。设定后,如未在频道中设置额外角色,则Ai将以此角色来进行对话。"
|
||||||
|
|
||||||
#. module: app_chatgpt
|
#. module: app_chatgpt
|
||||||
#. odoo-javascript
|
#. odoo-javascript
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ class Channel(models.Model):
|
|||||||
if 'o_odoobot_command' in message.body:
|
if 'o_odoobot_command' in message.body:
|
||||||
return rdata
|
return rdata
|
||||||
|
|
||||||
|
# begin: 找ai,增加 ai二人转功能。 chat类型不用管, 使用其中一个ai登录即可。 author_id 是 res.partner 模型
|
||||||
if channel_type == 'chat':
|
if channel_type == 'chat':
|
||||||
channel_partner_ids = self.channel_partner_ids
|
channel_partner_ids = self.channel_partner_ids
|
||||||
answer_id = channel_partner_ids - message.author_id
|
answer_id = channel_partner_ids - message.author_id
|
||||||
@@ -209,12 +210,18 @@ class Channel(models.Model):
|
|||||||
# partner_ids = @ ids
|
# partner_ids = @ ids
|
||||||
partner_ids = list(msg_vals.get('partner_ids'))
|
partner_ids = list(msg_vals.get('partner_ids'))
|
||||||
if hasattr(self, 'ai_partner_id') and self.ai_partner_id:
|
if hasattr(self, 'ai_partner_id') and self.ai_partner_id:
|
||||||
# 当有主id时,使用主id
|
if self.is_ai_conversation and self.ext_ai_partner_id:
|
||||||
if self.ai_partner_id.id in partner_ids:
|
# 二人转模式时
|
||||||
|
if author_id == self.ai_partner_id.id:
|
||||||
|
partner_ids = [self.ext_ai_partner_id.id]
|
||||||
|
else:
|
||||||
|
partner_ids = [self.ai_partner_id.id]
|
||||||
|
elif self.ai_partner_id.id in partner_ids:
|
||||||
|
# 其它,普通Ai群。当有主id时,使用主id
|
||||||
partner_ids = [self.ai_partner_id.id]
|
partner_ids = [self.ai_partner_id.id]
|
||||||
if partner_ids:
|
if partner_ids:
|
||||||
# 常规群聊 @
|
# 常规群聊 @
|
||||||
partners = self.env['res.partner'].search([('id', 'in', partner_ids)])
|
partners = self.env['res.partner'].search([('id', 'in', partner_ids)]) - message.author_id
|
||||||
# user_id = user, who has binded gpt robot
|
# user_id = user, who has binded gpt robot
|
||||||
user_id = partners.mapped('user_ids').sudo().filtered(lambda r: r.gpt_id)[:1]
|
user_id = partners.mapped('user_ids').sudo().filtered(lambda r: r.gpt_id)[:1]
|
||||||
elif message.body == _('<div class="o_mail_notification">joined the channel</div>'):
|
elif message.body == _('<div class="o_mail_notification">joined the channel</div>'):
|
||||||
@@ -252,6 +259,8 @@ class Channel(models.Model):
|
|||||||
# elif user_id.gpt_id and not is_allow:
|
# elif user_id.gpt_id and not is_allow:
|
||||||
# # 暂时有限用户的Ai
|
# # 暂时有限用户的Ai
|
||||||
# raise UserError(_('此Ai暂时未开放,请联系管理员。'))
|
# raise UserError(_('此Ai暂时未开放,请联系管理员。'))
|
||||||
|
# end: 找ai,增加 ai二人转功能
|
||||||
|
|
||||||
if hasattr(ai, 'is_translator') and ai.is_translator and ai.ai_model == 'translator':
|
if hasattr(ai, 'is_translator') and ai.is_translator and ai.ai_model == 'translator':
|
||||||
return rdata
|
return rdata
|
||||||
chatgpt_channel_id = self.env.ref('app_chatgpt.channel_chatgpt')
|
chatgpt_channel_id = self.env.ref('app_chatgpt.channel_chatgpt')
|
||||||
|
|||||||
Reference in New Issue
Block a user