From a951997f1a1aa8f35870b266117f0315a91c09c5 Mon Sep 17 00:00:00 2001 From: Edouard Wautier <4435185+Duncid@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:21:48 +0100 Subject: [PATCH] iterating --- front/lib/api/assistant/visualization.ts | 26 +++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/front/lib/api/assistant/visualization.ts b/front/lib/api/assistant/visualization.ts index 7f0b026f4a3f..b9bba46d2ff3 100644 --- a/front/lib/api/assistant/visualization.ts +++ b/front/lib/api/assistant/visualization.ts @@ -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