fix: prompt for viz enhanced

This commit is contained in:
qixinbo
2026-04-01 10:00:40 +08:00
parent 8e174df3d5
commit 9952af198a
5 changed files with 49 additions and 6 deletions
+6
View File
@@ -470,6 +470,9 @@ async def nanobot_chat(request: ChatRequest):
instructions = []
if request.route_mode == "sql" or request.prefer_sql_chart:
instructions.append("Use the nl2sql tool to answer the query")
instructions.append("If the user also asks for visualization, set generate_chart=true in the same nl2sql call")
instructions.append("Do not call visualization after nl2sql if a chart is already generated for this request")
instructions.append("Do not use exec, Python scripts, or matplotlib for chart plotting")
elif request.route_mode == "chat":
instructions.append("Normal chat mode. Do NOT use the nl2sql tool")
@@ -581,6 +584,9 @@ async def nanobot_chat_stream(request: ChatRequest):
instructions = []
if request.route_mode == "sql" or request.prefer_sql_chart:
instructions.append("Use the nl2sql tool to answer the query")
instructions.append("If the user also asks for visualization, set generate_chart=true in the same nl2sql call")
instructions.append("Do not call visualization after nl2sql if a chart is already generated for this request")
instructions.append("Do not use exec, Python scripts, or matplotlib for chart plotting")
elif request.route_mode == "chat":
instructions.append("Normal chat mode. Do NOT use the nl2sql tool")