18586361686
2025-05-07 1d6a99f6467f08eb02ed93b9b58af79069d13010
fix: 修复知识库使用milvus向量模型为空问题 和 milvus配置问题
close #IC00HI
3个文件已修改
22 ■■■■ 已修改文件
aiflowy-modules/aiflowy-module-ai/src/main/java/tech/aiflowy/ai/entity/AiLlm.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aiflowy-ui-react/src/components/CardPage/index.tsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
aiflowy-ui-react/src/pages/ai/Knowledge.tsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aiflowy-modules/aiflowy-module-ai/src/main/java/tech/aiflowy/ai/entity/AiLlm.java
@@ -126,12 +126,17 @@
        openAiLlmConfig.setEndpoint(getLlmEndpoint());
        openAiLlmConfig.setApiKey(getLlmApiKey());
        openAiLlmConfig.setModel(getLlmModel());
        openAiLlmConfig.setDefaultEmbeddingModel(getLlmModel());
        String llmExtraConfig = getLlmExtraConfig();
        Properties prop = PropertiesUtil.textToProperties(llmExtraConfig);
        String chatPath = prop.getProperty("chatPath");
        String embedPath = prop.getProperty("embedPath");
        if (chatPath != null && !chatPath.isEmpty()) {
            openAiLlmConfig.setChatPath(chatPath);
        }
        if (embedPath != null && !embedPath.isEmpty()) {
            openAiLlmConfig.setEmbedPath(embedPath);
        }
        return new OpenAILlm(openAiLlmConfig);
    }
aiflowy-ui-react/src/components/CardPage/index.tsx
@@ -152,7 +152,7 @@
                                    avatar={<Avatar src={item[avatarKey] || defaultAvatarSrc}/>}
                                    title={item[titleKey]}
                                    description={
                                        <Tooltip title={item[descriptionKey] || "暂无描述"}>
                                        <Tooltip title={item[descriptionKey] || "暂无描述"} placement="top" >
                                            <div style={{
                                                display: '-webkit-box',
                                                WebkitLineClamp: 1,
aiflowy-ui-react/src/pages/ai/Knowledge.tsx
@@ -80,12 +80,21 @@
            tooltip: (
                <span>
                     <p style={{ marginBottom: 8, width: 300 }}>数据库配置说明:</p>
                     <p>1.  Redis数据库,建议使用docker安装redis-stack向量数据库</p>
                     <p>1.  Redis数据库,建议使用docker安装redis-stack向量数据库,普通redis不支持向量化</p>
                     <p style={{ fontSize: 12}}>uri=redis://:pwssword@127.0.0.1:6379</p>
                     <p>2.  ElasticSearch 数据库</p>
                     <span style={{ fontSize: 12}}>serverUrl=http://localhost:9200</span><br/>
                     <span style={{ fontSize: 12}}>serverUrl=http://127.0.0.1:9200</span><br/>
                     <span style={{ fontSize: 12}}>username=elastic</span><br/>
                     <span style={{ fontSize: 12}}>password=123456</span>
                     <span style={{ fontSize: 12}}>password=123456</span><br/>
                     <p>3.  Milvus 数据库</p>
                     <span style={{ fontSize: 12}}>uri=http://127.0.0.1:19530</span><br/>
                     <span style={{ fontSize: 12}}>username=root</span><br/>
                     <span style={{ fontSize: 12}}>password=123456</span><br/>
                     <span style={{ fontSize: 12}}>对话地址:</span><br/>
                     <span style={{ fontSize: 12}}>chatPath=/api/v3/chat/completions</span><br/>
                     <span style={{ fontSize: 12}}>向量化地址:</span><br/>
                     <span style={{ fontSize: 12}}>enbedPath=/v1/embeddings</span>
                </span>
            ),
            type: 'TextArea',