fix:客服agent增加转人工
This commit is contained in:
+2
-2
@@ -74,7 +74,7 @@ async def generate_sql(
|
||||
},
|
||||
]
|
||||
try:
|
||||
output = await llm_client.chat(messages, temperature=0, max_tokens=256)
|
||||
output = await llm_client.chat(messages, temperature=0)
|
||||
except Exception as exc: # noqa: BLE001 统一收敛模型异常
|
||||
raise SqlGenerationError("SQL 模型调用失败") from exc
|
||||
sql = _clean_model_output(output)
|
||||
@@ -86,4 +86,4 @@ async def generate_sql(
|
||||
raise SqlGenerationError("模型返回的 SQL 无法解析") from exc
|
||||
if len(statements) != 1 or not isinstance(statements[0], exp.Select):
|
||||
raise SqlGenerationError("模型只允许返回单条 SELECT")
|
||||
return GeneratedSql(sql=statements[0].sql(dialect="mysql"))
|
||||
return GeneratedSql(sql=statements[0].sql(dialect="mysql"))
|
||||
Reference in New Issue
Block a user