From 7d0c4c5aa75413f803184f5d1bde80ce68bb0933 Mon Sep 17 00:00:00 2001 From: Ivan Ortega Alba Date: Tue, 10 Oct 2023 09:45:13 +0200 Subject: [PATCH] Auto-generate: Improve long text generation (#76213) Breaklines don't render for history text --- .../dashboard/components/GenAI/GenAIPanelDescriptionButton.tsx | 1 + .../dashboard/components/GenAI/GenerationHistoryCarousel.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/public/app/features/dashboard/components/GenAI/GenAIPanelDescriptionButton.tsx b/public/app/features/dashboard/components/GenAI/GenAIPanelDescriptionButton.tsx index fc014eb1691..570443e8759 100644 --- a/public/app/features/dashboard/components/GenAI/GenAIPanelDescriptionButton.tsx +++ b/public/app/features/dashboard/components/GenAI/GenAIPanelDescriptionButton.tsx @@ -17,6 +17,7 @@ const DESCRIPTION_GENERATION_STANDARD_PROMPT = 'You will be given the title and description of the dashboard the panel is in as well as the JSON for the panel.\n' + 'Your goal is to write a descriptive and concise panel description.\n' + 'The panel description is meant to explain the purpose of the panel, not just its attributes.\n' + + 'Do not refer to the panel; simply describe its purpose.\n' + 'There should be no numbers in the description except for thresholds.\n' + 'The description should be, at most, 140 characters.'; diff --git a/public/app/features/dashboard/components/GenAI/GenerationHistoryCarousel.tsx b/public/app/features/dashboard/components/GenAI/GenerationHistoryCarousel.tsx index 5a8803a4cc7..b1506961954 100644 --- a/public/app/features/dashboard/components/GenAI/GenerationHistoryCarousel.tsx +++ b/public/app/features/dashboard/components/GenAI/GenerationHistoryCarousel.tsx @@ -62,6 +62,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ display: 'flex', flexBasis: '100%', flexGrow: 3, + whiteSpace: 'pre-wrap', marginTop: 20, }), });