Explorar o código

增加与ai大模型对话

wwh hai 3 semanas
pai
achega
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
         this.kbOpenAiProxyService = kbOpenAiProxyService;
36
         this.kbOpenAiProxyService = kbOpenAiProxyService;
37
     }
37
     }
38
 
38
 
39
-    @GetMapping("/models")
39
+    @GetMapping("/version")
40
     @Operation(summary = "获取版本信息", description = "OpenAI 兼容 GET /api/version,透传上游 KB 服务响应。")
40
     @Operation(summary = "获取版本信息", description = "OpenAI 兼容 GET /api/version,透传上游 KB 服务响应。")
41
     public ResponseEntity<byte[]> getVersion() {
41
     public ResponseEntity<byte[]> getVersion() {
42
         return kbOpenAiProxyService.getVersion();
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
 @Service
29
 @Service
30
 public class KbOpenAiProxyServiceImpl implements KbOpenAiProxyService {
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
     private static final String PATH_CHAT = "/api/console/chat";
33
     private static final String PATH_CHAT = "/api/console/chat";
34
 
34
 
35
     private final KbApiProperties properties;
35
     private final KbApiProperties properties;
@@ -49,7 +49,7 @@ public class KbOpenAiProxyServiceImpl implements KbOpenAiProxyService {
49
         ensureReady();
49
         ensureReady();
50
         try {
50
         try {
51
             ResponseEntity<byte[]> upstream = restTemplate.exchange(
51
             ResponseEntity<byte[]> upstream = restTemplate.exchange(
52
-                    properties.baseUrl() + PATH_MODELS,
52
+                    properties.baseUrl() + PATH_VERSION,
53
                     HttpMethod.GET,
53
                     HttpMethod.GET,
54
                     new HttpEntity<>(upstreamAuthHeaders()),
54
                     new HttpEntity<>(upstreamAuthHeaders()),
55
                     byte[].class);
55
                     byte[].class);