feat[Datasource]:add summary refresh (#1433)

Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
Aries-ckt
2024-04-20 10:04:12 +08:00
committed by GitHub
parent 57be1ece18
commit b49b07f011
175 changed files with 61020 additions and 1494 deletions

View File

@@ -165,9 +165,19 @@ async def db_connect_edit(db_config: DBConfig = Body()):
@router.post("/v1/chat/db/delete", response_model=Result[bool])
async def db_connect_delete(db_name: str = None):
CFG.local_db_manager.db_summary_client.delete_db_profile(db_name)
return Result.succ(CFG.local_db_manager.delete_db(db_name))
@router.post("/v1/chat/db/refresh", response_model=Result[bool])
async def db_connect_refresh(db_config: DBConfig = Body()):
CFG.local_db_manager.db_summary_client.delete_db_profile(db_config.db_name)
success = await CFG.local_db_manager.async_db_summary_embedding(
db_config.db_name, db_config.db_type
)
return Result.succ(success)
async def async_db_summary_embedding(db_name, db_type):
db_summary_client = DBSummaryClient(system_app=CFG.SYSTEM_APP)
db_summary_client.db_summary_embedding(db_name, db_type)