feat: 删除 知识库-终端 关联, 简化 prompt 配置

This commit is contained in:
2026-03-23 15:27:06 +08:00
parent 81a22a2b54
commit 89af7c17f1
23 changed files with 102 additions and 1633 deletions

View File

@@ -3,144 +3,37 @@
return [
/*
|--------------------------------------------------------------------------
| AI提示词可用变量
| AI提示词占位符
|--------------------------------------------------------------------------
|
| 定义在AI提示词模板中可以使用的变量列表
| 每个变量包含:名称、描述、示例值、类型
| 以下占位符由HMI端在运行时替换KMS仅存储含占位符的原始模板
|
*/
'variables' => [
[
'name' => 'station_id',
'label' => '线站ID',
'description' => '终端所在的线站标识由HMI从 /config 接口获取',
'example' => 'BL02U1',
'source' => 'KMS /config',
'replaced_by' => 'HMI',
],
[
'name' => 'user',
'label' => '用户名称',
'description' => '当前登录用户的姓名',
'description' => '当前登录用户的姓名由HMI从登录信息或固定值获取',
'example' => '张三',
'type' => 'string',
'category' => 'user',
],
[
'name' => 'user_id',
'label' => '用户ID',
'description' => '当前登录用户的唯一标识符',
'example' => '12345',
'type' => 'integer',
'category' => 'user',
],
[
'name' => 'user_role',
'label' => '用户角色',
'description' => '当前登录用户的角色',
'example' => '操作员',
'type' => 'string',
'category' => 'user',
],
[
'name' => 'station',
'label' => '工作站名称',
'description' => '终端所在的工作站名称',
'example' => '生产线A-工位1',
'type' => 'string',
'category' => 'station',
],
[
'name' => 'station_id',
'label' => '工作站ID',
'description' => '终端所在的工作站ID',
'example' => '1001',
'type' => 'integer',
'category' => 'station',
],
[
'name' => 'terminal_name',
'label' => '终端名称',
'description' => '当前终端的名称',
'example' => 'TERM-0001',
'type' => 'string',
'category' => 'terminal',
],
[
'name' => 'terminal_code',
'label' => '终端编码',
'description' => '当前终端的唯一编码',
'example' => 'TERM-0001',
'type' => 'string',
'category' => 'terminal',
'source' => '登录信息或固定值',
'replaced_by' => 'HMI',
],
[
'name' => 'time',
'label' => '当前时间',
'description' => '当前的日期和时间',
'example' => '2024-01-15 14:30:00',
'type' => 'datetime',
'category' => 'time',
'description' => '当前的日期和时间由HMI通过 QDateTime::currentDateTime() 获取',
'example' => '2026-03-23 14:30:00',
'source' => 'QDateTime::currentDateTime()',
'replaced_by' => 'HMI',
],
[
'name' => 'date',
'label' => '当前日期',
'description' => '当前的日期',
'example' => '2024-01-15',
'type' => 'date',
'category' => 'time',
],
[
'name' => 'time_only',
'label' => '当前时刻',
'description' => '当前的时间(不含日期)',
'example' => '14:30:00',
'type' => 'time',
'category' => 'time',
],
[
'name' => 'shift',
'label' => '当前班次',
'description' => '当前的工作班次',
'example' => '早班',
'type' => 'string',
'category' => 'time',
],
[
'name' => 'knowledge_bases',
'label' => '关联知识库',
'description' => '终端关联的知识库列表',
'example' => '安全操作规程, 设备维护手册',
'type' => 'array',
'category' => 'knowledge',
],
[
'name' => 'company_name',
'label' => '公司名称',
'description' => '系统配置的公司名称',
'example' => 'XX制造有限公司',
'type' => 'string',
'category' => 'system',
],
[
'name' => 'department',
'label' => '部门名称',
'description' => '用户所属的部门',
'example' => '生产部',
'type' => 'string',
'category' => 'user',
],
],
/*
|--------------------------------------------------------------------------
| 变量分类
|--------------------------------------------------------------------------
|
| 变量的分类标签用于在UI中分组显示
|
*/
'categories' => [
'user' => '用户信息',
'station' => '工作站信息',
'terminal' => '终端信息',
'time' => '时间信息',
'knowledge' => '知识库信息',
'system' => '系统信息',
],
];