-
Notifications
You must be signed in to change notification settings - Fork 49
Update BuildChartPrompt.txt with Templates #1244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
New Chart Template Prompt with sample templates Jinja2 instead of fstrings for returning HTML Other Altair and HTML Specific Guidelines
llms/BuildChartPrompt.txt
Outdated
| housing = load_data(path) | ||
|
|
||
| # Inspect schema (useful for debugging) | ||
| print("=== Column data types ===") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? This takes up context space and I don't think adds anything to charting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted to the earlier example, as the templates cover this. we need this as sometimes the AI Might get stuck in a loop of "Fix" and it cannot determine the datatype of the columns. This added context helps it to "Fix" it in the next run.
| Data Handling Requirements: | ||
| - When working with CSV files from external sources, always include encoding handling: Use encoding="latin1" or encoding="utf-8-sig" for broader compatibility | ||
| - Always clean column names (strip whitespace, handle special characters) before using them in data visualizations or chart encodings | ||
| - NEVER ASSUME THE SCHEMA OF THE DATASET. Always create UDF to look at the sample of the dataset to find it out if you are not sure about the schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not too helpful because every UDF has only a single run. Should reframe this on how UDF can get content of tables by getting context from another UDF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behaviour I noticed which led me to add this was that
- For some partially known/famous dataset, it directly jumps on creating a chart udf, Assuming the column names itself which lead to a lot of errors. We need to think about what happens after we click on "Fix" if and when needed, does it get enough context to debug or not.
- Can remove the clean column directive - Agreed
- For CSV Files from a lot of sources, it was giving me encoding errors while reading csv directly without the encoding parameter, which led me to adding this line.
New Chart Template Prompt with sample templates
Jinja2 instead of fstrings for returning HTML
Other Altair and HTML Specific Guidelines