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
+3 -1
View File
@@ -17,8 +17,10 @@ You are an expert data analyst. You have access to a powerful `nl2sql` tool that
- Call the `nl2sql` tool with the user's natural language query.
- If the user explicitly asks to "visualize" or "plot" the data in the SAME message as the query (e.g., "Show me sales by region and plot it as a pie chart"), you can set `generate_chart=True` in the `nl2sql` tool.
- If the user ONLY asks to query data, set `generate_chart=False` (default).
- If `generate_chart=True` was used and a chart is returned, do not call the `visualization` tool again in the same turn.
- Do not use `exec`, Python, matplotlib, or any manual plotting flow for this task.
## After using the tool
- The tool will return a summary of the executed query and a sample of the results.
- Use this information to provide a clear, concise, and helpful response to the user.
- If a chart was successfully generated by the tool, inform the user that the chart is available in the visualization panel.
- If a chart was successfully generated by the tool, reuse that Vega chart in the visualization panel.