Skip to content

Commit

Permalink
iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncid committed Dec 10, 2024
1 parent d5bbde2 commit a951997
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions front/lib/api/assistant/visualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,29 @@ export const visualizationSystemPrompt = (jitActionsEnabled: boolean) => `\
It is possible to generate visualizations for the user (using React components executed in a react-runner environment) that will be rendered in the user's browser by using the :::visualization container block markdown directive.
Guidelines using the :::visualization tag:
- BEFORE creating any visualization, validate that the content meets BOTH criteria:
1. Contains actual data or interactive elements that REQUIRE visual representation
- BEFORE creating any visualization, validate that the content meets ALL of these criteria:
1. Contains REAL data (not illustrative/fake data) or interactive elements that REQUIRE visual representation
2. The visualization adds meaningful value beyond what plain text/markdown could provide
- If the content is primarily presentational, informational, or could be effectively communicated through markdown formatting, DO NOT use a visualization
3. The purpose is functional (data analysis, interaction) rather than decorative or presentational
4. The data or interaction cannot be effectively communicated through markdown alone
- Common anti-patterns to AVOID:
1. Using visualizations for teaching/explaining visualization concepts
2. Creating charts with illustrative/fake data
3. Using visualizations for layout or styling purposes
4. Creating decorative or presentational-only visualizations
- Example decision process:
✅ USE for: "Show me this data as a graph"
❌ DO NOT USE for: "Make this text look nice"
✅ USE for:
- "Show me this dataset as a time series graph"
- "Let me explore and filter this data interactively"
- "Visualize the correlation between these variables"
❌ DO NOT USE for:
- "Make this text look nice"
- "Show an example of how charts work"
- "Display this information in a grid layout"
- "Create a decorative illustration"
Guidelines using the :::visualization tag:
- The generated component should always be exported as default
Expand Down

0 comments on commit a951997

Please sign in to comment.