| | |
| | | import asyncio |
| | | |
| | | from fastapi import Depends |
| | | |
| | | from Log import logger |
| | |
| | | from app.service.ragflow import RagflowService |
| | | |
| | | |
| | | async def sync_resource(): |
| | | await sync_knowledge() |
| | | await sync_dialog() |
| | | await sync_agent() |
| | | await sync_llm() |
| | | def sync_resource(): |
| | | asyncio.run(sync_knowledge()) |
| | | asyncio.run(sync_dialog()) |
| | | asyncio.run(sync_agent()) |
| | | asyncio.run(sync_llm()) |
| | | |
| | | |
| | | async def sync_knowledge(db=Depends(get_db)): |
| | | |
| | |
| | | if rapp.app_type == AgentType.RAGFLOW: |
| | | token = "" |
| | | ragflow_service = RagflowService(settings.fwr_base_url) |
| | | ragflow_service.get_knowledge_list() |
| | | elif rapp.app_type ==AgentType.BISHENG: |
| | | token = "" |
| | | bisheng_service = BishengService(settings.sgb_base_url) |
| | | else: |
| | | logger.error("注册未知应用:{}".format(rapp.app_type)) |
| | | |
| | | |
| | | async def sync_dialog(): |
| | | ... |
| | | |