Administrator
2025-10-30 3d3fa2c75ac3ed9439b94ae2bdd034403839af34
src/main/java/cc/mrbird/febs/ai/service/impl/AiCompanyServiceImpl.java
@@ -67,6 +67,7 @@
        this.addWorkflow(entity.getId(), LlmApplicationAppIdEnum.REFERENCE_ANSWER.getCode(),null,createTime);
        this.addWorkflow(entity.getId(), LlmApplicationAppIdEnum.KEY_KNOWLEDGE.getCode(),null,createTime);
        this.addWorkflow(entity.getId(), LlmApplicationAppIdEnum.REPORT.getCode(),null,createTime);
        this.addWorkflow(entity.getId(), LlmApplicationAppIdEnum.CONTEXT_TALK.getCode(),null,createTime);
        this.addWorkflow(entity.getId(), LlmApplicationAppIdEnum.ADMIN_QUESTION.getCode(),null,createTime);
        String categoryId = "";
@@ -78,15 +79,9 @@
        String knowledgeId = "";
        try {
            Client client = KnowledgeBaseUtil.createClient();
            String workspaceId = KnowledgeBaseUtil.WORKSPACE_ID;
            String name = entity.getName();
            String sourceType = "DATA_CENTER_FILE";
            String structureType = "unstructured";
            String sinkType = "DEFAULT";
            String fileId = "file_b7d0a5b2df1745b9bfb7402f5fe1054f_12629554";
            CreateIndexResponse indexResponse = KnowledgeBaseUtil.createIndex(client, workspaceId, fileId, name, structureType, sourceType, sinkType);
            knowledgeId = indexResponse.getBody().getData().getId();
            knowledgeId = KnowledgeBaseUtil.createKnowledgeBase(fileId, name);
        } catch (Exception e) {
            throw new FebsException("初始化知识库失败");
        }