mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-03 09:34:04 +00:00
feat(editor): editor api devlop
editor api devlop part 2
This commit is contained in:
parent
1f881dca25
commit
0bd99d7764
@ -84,13 +84,13 @@ async def get_editor_sql(con_uid: str, round: int):
|
|||||||
if int(once["chat_order"]) == round:
|
if int(once["chat_order"]) == round:
|
||||||
for element in once["messages"]:
|
for element in once["messages"]:
|
||||||
if element["type"] == "ai":
|
if element["type"] == "ai":
|
||||||
return Result.succ(json.loads(element["data"]["content"], ensure_ascii=False))
|
return Result.succ(json.loads(element["data"]["content"]))
|
||||||
return Result.faild(msg="not have sql!")
|
return Result.faild(msg="not have sql!")
|
||||||
|
|
||||||
|
|
||||||
@router.post("/v1/editor/sql/run", response_model=Result[SqlRunData])
|
@router.post("/v1/editor/sql/run", response_model=Result[SqlRunData])
|
||||||
async def editor_sql_run(run_param: dict = Body()):
|
async def editor_sql_run(run_param: dict = Body()):
|
||||||
logger.info("get_editor_sql_run:{}", run_param)
|
logger.info("editor_sql_run:{}", run_param)
|
||||||
db_name = run_param['db_name']
|
db_name = run_param['db_name']
|
||||||
sql = run_param['sql']
|
sql = run_param['sql']
|
||||||
if not db_name and not sql:
|
if not db_name and not sql:
|
||||||
|
Loading…
Reference in New Issue
Block a user