소스 검색

多维度流程拆分

yingge 3 달 전
부모
커밋
769d08a8a6
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/api/db/services/prompt_service.py

+ 4 - 2
src/api/db/services/prompt_service.py

@@ -186,8 +186,10 @@ class PromptService:
         # 1. 先创建 RAGFlow 数据集
         from src.utils.ragflow.ragflow_service import RAGFlowService
         from src.conf.rag_parser_config import RagParserDefaults
-        
-        ragflow_service = RAGFlowService(api_key="ragflow-tP77uZTCoz81pnXhw5p9I5fWBxAiFjNXcEZ_Vm1L3QU")
+        from src.utils.ragflow.ragflow_user_service import get_ragflow_user_service
+        ragflow_user = get_ragflow_user_service().get_ragflow_id_and_api_key(3)
+        ragflow_api_key = ragflow_user.get("api_key")
+        ragflow_service = RAGFlowService(api_key=ragflow_api_key)
         logger.info(f"开始创建 RAGFlow 数据集: {name}")
         
         dataset = ragflow_service.create_dataset(