Ver código fonte

修复java后端问题

liuchengsen 1 mês atrás
pai
commit
6b0a06ebd9

+ 1 - 1
backend-java/src/main/java/com/pharmacopoeia/config/QwenProperties.java

@@ -12,7 +12,7 @@ public class QwenProperties {
     private String baseUrl = "https://dashscope.aliyuncs.com/compatible-mode/v1";
     private String model = "qwen-max";
     private int maxTokens = 4096;
-    private double temperature = 0.1;
+    private double temperature = 0.0;
     private String embeddingModel = "text-embedding-v3";
     private String embeddingUrl = "https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding";
     private int embeddingDim = 1024;

+ 2 - 5
backend-java/src/main/java/com/pharmacopoeia/controller/ChatController.java

@@ -55,7 +55,6 @@ public class ChatController {
         return ResponseEntity.ok(Map.of(
                 "answer", answer,
                 "sources", sources,
-                "conversation_id", cid,
                 "intent", intent
         ));
     }
@@ -90,8 +89,7 @@ public class ChatController {
                         try {
                             String meta = new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(Map.of(
                                     "intent", intent,
-                                    "sources", sources,
-                                    "cid", cid
+                                    "sources", sources
                             ));
                             sink.tryEmitNext(ServerSentEvent.<String>builder().event("meta").data(meta).build());
                         } catch (Exception ignored) {}
@@ -173,8 +171,7 @@ public class ChatController {
                 .map(d -> Map.<String, Object>of(
                         "name", d.getOrDefault("source", ""),
                         "section", d.getOrDefault("section", ""),
-                        "source", d.getOrDefault("source", ""),
-                        "score", d.getOrDefault("similarity", 0)
+                        "source", d.getOrDefault("source", "")
                 ))
                 .collect(Collectors.toList());
     }

+ 1 - 1
backend-java/src/main/resources/application.yml

@@ -37,7 +37,7 @@ qwen:
   base-url: https://dashscope.aliyuncs.com/compatible-mode/v1
   model: qwen-max
   max-tokens: 4096
-  temperature: 0.1
+  temperature: 0.0
   # 嵌入模型
   embedding-model: text-embedding-v3
   embedding-url: https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding