5 小时以前 9bad721754fe8bbe2e5f459d0706e0fefac569f3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package cn.iocoder.yudao.module.ai.framework.ai.config;
 
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
 
import java.time.Duration;
 
/**
 * 超级管理员 AI 配置类
 */
@ConfigurationProperties(prefix = "yudao.ai")
@Data
public class YudaoAiProperties {
 
    /**
     * 单次大模型调用超时。
     * <p>
     * 必须有默认值:模型排队时若不设超时,请求会一直挂到 TCP 层超时,
     * 同期没有超时的前端 axios 也不会主动断开,用户界面会永远转圈。
     */
    private Duration timeout = Duration.ofSeconds(60);
 
    private WebSearch webSearch;
 
    /** 向量库配置 */
    private VectorStore vectorStore = new VectorStore();
 
    @Data
    public static class WebSearch {
        private boolean enable;
        private String apiKey;
    }
 
    @Data
    public static class VectorStore {
 
        /** 向量库类型:milvus */
        private String type = "milvus";
 
        /** Milvus 配置 */
        private Milvus milvus = new Milvus();
 
        @Data
        public static class Milvus {
            /** 是否初始化 Schema */
            private boolean initializeSchema = true;
            /** 数据库名称 */
            private String databaseName = "default";
            /** 集合名称 */
            private String collectionName = "knowledge_segment";
            /** 主机地址 */
            private String host = "127.0.0.1";
            /** 端口 */
            private int port = 19530;
        }
    }
 
}