|
|
@@ -249,7 +249,7 @@ public class AIService {
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.error("Dify workflow 调用失败", e);
|
|
|
+ log.error("LangGraph workflow 调用失败", e);
|
|
|
}
|
|
|
Map<String, Object> empty = new LinkedHashMap<>();
|
|
|
empty.put("error", "workflow call failed");
|
|
|
@@ -258,7 +258,7 @@ public class AIService {
|
|
|
|
|
|
/**
|
|
|
* 舌诊图像分析
|
|
|
- * 调用 Dify 舌诊 Assistant 返回结构化舌诊结果
|
|
|
+ * 调用 LangGraph 舌诊 Assistant 返回结构化舌诊结果
|
|
|
*/
|
|
|
@SuppressWarnings("unchecked")
|
|
|
public Map<String, Object> sendTongueDiagnosis(String imageUrl, String userId, Map<String, Object> inputs) {
|
|
|
@@ -279,7 +279,7 @@ public class AIService {
|
|
|
body.put("user", userId);
|
|
|
body.put("response_mode", "blocking");
|
|
|
|
|
|
- // 将图片转为 Dify 可接收的格式(URL)
|
|
|
+ // 将图片转为 LangGraph 可接收的格式(URL)
|
|
|
Map<String, Object> fileInput = new HashMap<>();
|
|
|
fileInput.put("type", "image");
|
|
|
fileInput.put("url", imageUrl);
|
|
|
@@ -298,7 +298,7 @@ public class AIService {
|
|
|
}
|
|
|
return mockTongueResult();
|
|
|
} catch (Exception e) {
|
|
|
- log.warn("Dify tongue diagnosis failed, using mock: {}", e.getMessage());
|
|
|
+ log.warn("LangGraph tongue diagnosis failed, using mock: {}", e.getMessage());
|
|
|
return mockTongueResult();
|
|
|
}
|
|
|
}
|
|
|
@@ -332,7 +332,7 @@ public class AIService {
|
|
|
|
|
|
/**
|
|
|
* 照片情绪识别
|
|
|
- * 调用 Dify 情绪识别 Workflow,输入图片 URL,返回结构化情绪列表
|
|
|
+ * 调用 LangGraph 情绪识别 Workflow,输入图片 URL,返回结构化情绪列表
|
|
|
*/
|
|
|
@SuppressWarnings("unchecked")
|
|
|
public Map<String, Object> sendEmotionRecognition(String imageUrl) {
|
|
|
@@ -348,7 +348,7 @@ public class AIService {
|
|
|
body.put("user", "emotion-recognition");
|
|
|
body.put("response_mode", "blocking");
|
|
|
|
|
|
- // 将图片转为 Dify 可接收的格式(URL)
|
|
|
+ // 将图片转为 LangGraph 可接收的格式(URL)
|
|
|
Map<String, Object> fileInput = new HashMap<>();
|
|
|
fileInput.put("type", "image");
|
|
|
fileInput.put("url", imageUrl);
|
|
|
@@ -367,7 +367,7 @@ public class AIService {
|
|
|
}
|
|
|
return mockEmotionResult();
|
|
|
} catch (Exception e) {
|
|
|
- log.warn("Dify emotion recognition failed, using mock: {}", e.getMessage());
|
|
|
+ log.warn("LangGraph emotion recognition failed, using mock: {}", e.getMessage());
|
|
|
return mockEmotionResult();
|
|
|
}
|
|
|
}
|
|
|
@@ -398,7 +398,7 @@ public class AIService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Build an emotional context prompt for the Dify AI conversation
|
|
|
+ * Build an emotional context prompt for the LangGraph AI conversation
|
|
|
* based on the child's recent checkin history.
|
|
|
* Detects consecutive negative checkins and includes them as context.
|
|
|
*/
|
|
|
@@ -444,7 +444,7 @@ public class AIService {
|
|
|
// ========== AI Memory Layer ==========
|
|
|
|
|
|
/**
|
|
|
- * 获取用户上下文(供 Dify Workflow HTTP 节点回调)
|
|
|
+ * 获取用户上下文(供 LangGraph Workflow HTTP 节点回调)
|
|
|
* 返回: 会话摘要 + 近期摘要 + 关键事实
|
|
|
*/
|
|
|
public Map<String, Object> getContext(Long userId, String conversationId) {
|
|
|
@@ -494,7 +494,7 @@ public class AIService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 调用 Dify Workflow 生成对话摘要并保存
|
|
|
+ * 调用 LangGraph Workflow 生成对话摘要并保存
|
|
|
*/
|
|
|
@Async
|
|
|
public void requestSummaryAsync(Long userId, String conversationId, String recentMessages) {
|