Parcourir la Source

增加与ai大模型对话

wwh il y a 3 semaines
Parent
commit
a5fa595076

+ 1 - 1
huimv-employment/fe-api/src/main/java/com/huimv/employment/controller/mp/AiProxyController.java

@@ -36,7 +36,7 @@ public class AiProxyController {
36 36
         this.kbOpenAiProxyService = kbOpenAiProxyService;
37 37
     }
38 38
 
39
-    @GetMapping("/models")
39
+    @GetMapping("/version")
40 40
     @Operation(summary = "获取版本信息", description = "OpenAI 兼容 GET /api/version,透传上游 KB 服务响应。")
41 41
     public ResponseEntity<byte[]> getVersion() {
42 42
         return kbOpenAiProxyService.getVersion();

+ 2 - 2
huimv-employment/fe-integration/src/main/java/com/huimv/employment/integration/kb/KbOpenAiProxyServiceImpl.java

@@ -29,7 +29,7 @@ import java.nio.charset.StandardCharsets;
29 29
 @Service
30 30
 public class KbOpenAiProxyServiceImpl implements KbOpenAiProxyService {
31 31
 
32
-    private static final String PATH_MODELS = "/api/version";
32
+    private static final String PATH_VERSION = "/api/version";
33 33
     private static final String PATH_CHAT = "/api/console/chat";
34 34
 
35 35
     private final KbApiProperties properties;
@@ -49,7 +49,7 @@ public class KbOpenAiProxyServiceImpl implements KbOpenAiProxyService {
49 49
         ensureReady();
50 50
         try {
51 51
             ResponseEntity<byte[]> upstream = restTemplate.exchange(
52
-                    properties.baseUrl() + PATH_MODELS,
52
+                    properties.baseUrl() + PATH_VERSION,
53 53
                     HttpMethod.GET,
54 54
                     new HttpEntity<>(upstreamAuthHeaders()),
55 55
                     byte[].class);