fix:客服agent增加转人工

This commit is contained in:
2026-09-15 11:42:26 +08:00
parent 177a28b1de
commit 102cae6692
10 changed files with 22 additions and 100 deletions
+2 -2
View File
@@ -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"))