mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-06 11:31:12 +00:00
feat[Datasource]:add summary refresh (#1433)
Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user