(improvement)(Headless) Fix Python module parameter passing error (#1071)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2024-06-01 14:38:20 +08:00
committed by GitHub
parent f07e80587d
commit 03cb00f4b4
3 changed files with 7 additions and 7 deletions

View File

@@ -46,10 +46,10 @@ async def query2sql(query_body: Mapping[str, Any]):
else:
filter_condition = query_body['filterCondition']
if 'sqlGenerationMode' not in query_body:
raise HTTPException(status_code=400, detail="sql_generation_mode is not in query_body")
if 'sqlGenType' not in query_body:
raise HTTPException(status_code=400, detail="sqlGenType is not in query_body")
else:
sql_generation_mode = query_body['sqlGenerationMode']
sqlGenType = query_body['sqlGenType']
if 'llmConfig' in query_body:
llm_config = ast.literal_eval(str(query_body['llmConfig']))
@@ -64,8 +64,8 @@ async def query2sql(query_body: Mapping[str, Any]):
resp = await text2sql_agent_router.async_query2sql(question=query_text, filter_condition=filter_condition,
model_name=dataset_name, fields_list=fields_list,
data_date=current_date, prior_schema_links=prior_schema_links,
prior_exts=prior_exts, sql_generation_mode=sql_generation_mode,
llm_config=llm_config)
prior_exts=prior_exts, sql_generation_mode=sqlGenType,
llm_config=llm_config, terms_list=terms_list)
return resp