init
This commit is contained in:
+42
-5
@@ -112,12 +112,49 @@ def reload_prompts(prompt_manager=Depends(get_prompt_manager)):
|
||||
@router.post("/api/ragflow/table-retrieval/reload")
|
||||
def reload_table_retrieval():
|
||||
syncer = RagflowSync()
|
||||
result = syncer.sync_table_retrieval()
|
||||
result = syncer.upload_table_retrieval()
|
||||
return {"ok": True, "result": result}
|
||||
|
||||
|
||||
@router.post("/api/ragflow/sql-gen/reload")
|
||||
def reload_sql_gen():
|
||||
@router.post("/api/ragflow/table-retrieval/upload")
|
||||
def upload_table_retrieval():
|
||||
"""上传表名检索模板文档"""
|
||||
syncer = RagflowSync()
|
||||
result = syncer.sync_sql_gen_prompts()
|
||||
return {"ok": True, "result": result}
|
||||
try:
|
||||
result = syncer.upload_table_retrieval()
|
||||
return {"ok": True, "result": result}
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
@router.put("/api/ragflow/table-retrieval/update")
|
||||
def update_table_retrieval(config: dict):
|
||||
"""更新表名检索知识库配置"""
|
||||
syncer = RagflowSync()
|
||||
try:
|
||||
result = syncer.update_dataset(syncer._table_retrieval_dataset_id, config)
|
||||
return {"ok": True, "result": result}
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
@router.post("/api/ragflow/sql-gen/upload")
|
||||
def upload_sql_gen():
|
||||
"""上传 SQL 生成提示词文档"""
|
||||
syncer = RagflowSync()
|
||||
try:
|
||||
result = syncer.upload_sql_gen()
|
||||
return {"ok": True, "result": result}
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
@router.put("/api/ragflow/sql-gen/update")
|
||||
def update_sql_gen(config: dict):
|
||||
"""更新 SQL 生成知识库配置"""
|
||||
syncer = RagflowSync()
|
||||
try:
|
||||
result = syncer.update_dataset(syncer._sql_gen_dataset_id, config)
|
||||
return {"ok": True, "result": result}
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
Reference in New Issue
Block a user