Commit 5a88e27e authored by 陈立彬's avatar 陈立彬

ai问答接入deepseek

parent 977ef3d8
......@@ -567,11 +567,11 @@ public class AppChatCompletionService {
reqBody.put("session_id", sessionId);
// JSONObject customVariables = new JSONObject();
// customVariables.put("Position", userPrincipal.getPosition());
// customVariables.put("Department", userPrincipal.getShopName());
// customVariables.put("UserId", userPrincipal.getUserId());
// reqBody.put("custom_variables", customVariables.toJSONString());
JSONObject customVariables = new JSONObject();
customVariables.put("Position", userPrincipal.getPosition());
customVariables.put("Department", userPrincipal.getShopName());
customVariables.put("UserId", userPrincipal.getUserId());
reqBody.put("custom_variables", customVariables);
final String[] thoughtContent = {""};
final String[] replyContent = {""};
......@@ -582,6 +582,7 @@ public class AppChatCompletionService {
.mapNotNull(v -> {
JSONObject json = JSONObject.parseObject(v);
System.out.println(v);
String type = json.getString("type");
if(Objects.equals(type, "error")) {
thoughtContent[0] = json.getJSONObject("error").getString("message");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment