feat: 删除 知识库-终端 关联, 简化 prompt 配置
This commit is contained in:
@@ -22,8 +22,8 @@ class TerminalPromptFactory extends Factory
|
||||
{
|
||||
return [
|
||||
'terminal_id' => Terminal::factory(),
|
||||
'prompt_template' => $this->faker->paragraph(5),
|
||||
'variables' => ['user', 'station', 'time'],
|
||||
'prompt_template' => '你是{station_id}光束线的AI助手。当前时间是{time}。请根据用户{user}的问题提供帮助。',
|
||||
'variables' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ class TerminalSeeder extends Seeder
|
||||
'BL16U1' => '192.168.1.39',
|
||||
];
|
||||
|
||||
// 默认提示词模板(占位符由HMI端替换)
|
||||
$defaultPrompt = <<<'PROMPT'
|
||||
你是{station_id}光束线的AI助手。当前时间是{time}。请根据用户{user}的问题,提供准确的光束线操作指导、实验支持和技术咨询。你可以回答关于光束线参数、实验流程、设备状态、安全规范等方面的问题。
|
||||
PROMPT;
|
||||
|
||||
// 为每条光束线创建智慧屏终端
|
||||
$this->command->info('创建光束线智慧屏终端...');
|
||||
foreach ($beamlines as $beamline => $ipAddress) {
|
||||
@@ -47,12 +52,8 @@ class TerminalSeeder extends Seeder
|
||||
// 为每个终端创建提示词
|
||||
TerminalPrompt::create([
|
||||
'terminal_id' => $terminal->id,
|
||||
'prompt_template' => "你是{station}光束线的AI助手。当前时间是{time}。请根据用户{user}的问题,提供准确的光束线操作指导、实验支持和技术咨询。你可以回答关于光束线参数、实验流程、设备状态、安全规范等方面的问题。",
|
||||
'variables' => [
|
||||
'station' => $beamline,
|
||||
'time' => '{current_time}',
|
||||
'user' => '{current_user}',
|
||||
],
|
||||
'prompt_template' => $defaultPrompt,
|
||||
'variables' => [],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user