diff --git a/yuthon_ai_agent/data/demo_rule.xml b/yuthon_ai_agent/data/demo_rule.xml index bcc326b60..0480d2865 100644 --- a/yuthon_ai_agent/data/demo_rule.xml +++ b/yuthon_ai_agent/data/demo_rule.xml @@ -1,31 +1,5 @@ - - - - - 简洁回复 - instruction - 5 - 所有回复控制在 200 字以内,重点突出结论,避免冗长的铺垫和解释。如果内容较多,优先使用表格或列表形式呈现。 - - - - - 数据展示规范 - instruction - 10 - 当查询到多条数据时,必须用 Markdown 表格呈现,表头使用中文名称。金额字段保留两位小数并加上 ¥ 前缀,日期使用 YYYY-MM-DD 格式。 - - - - - 专业商务风格 - instruction - 15 - 使用专业、正式的商务语气回复,避免口语化表达、网络用语和表情符号。对不确定的信息要明确说明"暂无相关数据",不得猜测或编造。 - - 禁止薪资话题 @@ -48,57 +22,4 @@ 3 禁止协助用户修改系统参数(ir.config_parameter)、用户权限组(res.groups)、安全规则(ir.rule)等系统级配置。统一回复"系统配置修改需由管理员在后台操作,请联系 IT 部门。" - - - - 天气查询技能 - skill - 10 - query_weather - 当用户询问某个城市的天气状况时调用此技能,获取实时天气数据。 - { - "type": "object", - "properties": { - "city": { - "type": "string", - "description": "要查询的城市名,如:北京、上海、深圳" - } - }, - "required": ["city"] -} - https://api.example.com/weather - GET - {} - 5 - - - - - 企业知识库检索 - skill - 5 - search_knowledge - 当用户询问公司制度、流程规范、操作手册等内部知识时,调用此技能从企业知识库中检索相关内容。 - { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "用户的问题或关键词" - }, - "category": { - "type": "string", - "enum": ["制度规范", "操作手册", "常见问题", "全部"], - "description": "知识分类,默认全部" - } - }, - "required": ["query"] -} - https://api.example.com/knowledge/search - POST - {"Authorization": "Bearer YOUR_API_KEY"} - 10 - - - diff --git a/yuthon_ai_agent/models/ai_rule.py b/yuthon_ai_agent/models/ai_rule.py index f04b75ee3..4e4174d02 100644 --- a/yuthon_ai_agent/models/ai_rule.py +++ b/yuthon_ai_agent/models/ai_rule.py @@ -215,7 +215,7 @@ class AiRule(models.Model): string='触发值', help='字段值等于什么时触发,如 True', ) - guide_message = fields.Text( + guide_message = fields.Char( string='提醒内容', help='主动弹出时显示的文字,支持变量:{record_name}, {user_name}', ) @@ -223,8 +223,8 @@ class AiRule(models.Model): string='按钮文字', default='确认执行', ) - guide_button_action = fields.Text( - string='按钮动作 (JSON)', + guide_button_action = fields.Char( + string='按钮方法配置', help='按钮点击后执行的动作,JSON格式,如 {"type": "execute_tool", "tool": "notice_publish", "params": {"notice_id": "{record_id}"}}', default='{}', ) @@ -232,7 +232,7 @@ class AiRule(models.Model): string='方法名称', help='后台处理方法名,用于标识触发哪个逻辑', ) - guide_method_desc = fields.Text( + guide_method_desc = fields.Char( string='方法说明', ) diff --git a/yuthon_ai_agent/views/ai_rule_views.xml b/yuthon_ai_agent/views/ai_rule_views.xml index ce63182aa..f58db4cc5 100644 --- a/yuthon_ai_agent/views/ai_rule_views.xml +++ b/yuthon_ai_agent/views/ai_rule_views.xml @@ -14,7 +14,8 @@ decoration-info="rule_type == 'instruction'" decoration-warning="rule_type == 'restriction'" decoration-success="rule_type == 'skill'" - decoration-danger="rule_type == 'method'"/> + decoration-danger="rule_type == 'method'" + decoration-primary="rule_type == 'active_guide'"/> @@ -61,10 +62,25 @@ + invisible="rule_type in ('skill', 'method', 'active_guide')"> + + + + + + + + + + + @@ -137,6 +153,8 @@ domain="[('rule_type','=','skill')]"/> + diff --git a/yuthon_base/__manifest__.py b/yuthon_base/__manifest__.py index 1c1393971..8f4a07011 100644 --- a/yuthon_base/__manifest__.py +++ b/yuthon_base/__manifest__.py @@ -23,7 +23,7 @@ 'web.assets_backend': [ 'yuthon_base/static/src/views/**/*', 'yuthon_base/static/src/js/datetime_picker.js', - # 'yuthon_base/static/src/scss/base.css', + 'yuthon_base/static/src/scss/base.css', ] }, 'demo': [], diff --git a/yuthon_base/static/src/scss/base.css b/yuthon_base/static/src/scss/base.css index 49404987e..56696c0fb 100644 --- a/yuthon_base/static/src/scss/base.css +++ b/yuthon_base/static/src/scss/base.css @@ -1,3 +1,11 @@ .flex-column { flex-direction: row !important; +} + +/* 隐藏控制面板右上角 Knowledge 搜索按钮 */ +.o_control_panel .o_knowledge_icon_search, +.o_control_panel .o_cp_action_menus .o_knowledge_icon_search, +.o_form_view .o_knowledge_icon_search, +.o_cp_action_menus .o_knowledge_icon_search { + display: none !important; } \ No newline at end of file