| | |
| | | package com.zy.ai.utils; |
| | | |
| | | import com.zy.ai.enums.AiPromptScene; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class AiPromptUtils { |
| | | |
| | | public String getDefaultPrompt(String sceneCode) { |
| | | AiPromptScene scene = AiPromptScene.ofCode(sceneCode); |
| | | if (scene == null) { |
| | | throw new IllegalArgumentException("不支持的 Prompt 场景: " + sceneCode); |
| | | } |
| | | return getDefaultPrompt(scene); |
| | | } |
| | | |
| | | public String getDefaultPrompt(AiPromptScene scene) { |
| | | if (scene == AiPromptScene.DIAGNOSE_STREAM) { |
| | | return getAiDiagnosePromptMcp(); |
| | | } |
| | | if (scene == AiPromptScene.SENSOR_CHAT) { |
| | | return getWcsSensorPromptMcp(); |
| | | } |
| | | throw new IllegalArgumentException("不支持的 Prompt 场景: " + scene.getCode()); |
| | | } |
| | | |
| | | //AI诊断系统Prompt |
| | | public String getAiDiagnosePromptMcp() { |
| | | String prompt = "你是一名资深 WCS(仓储控制系统)与自动化立库专家,熟悉:堆垛机、输送线、提升机、穿梭车等设备的任务分配和运行逻辑,也熟悉常见的系统卡死、任务不执行、设备空闲但无任务等问题模式。\n\n" + |