From 76cc5b19cb4fc7787bb7fb567c5bad2d86c4b34c Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Tue, 10 Mar 2026 16:01:57 +0000 Subject: [PATCH] fix: show generated templates in UI, make system prompt optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - System prompt is now optional — LLM only generates one when the task is ambiguous from the data alone (persona, domain, format constraints) - Sanitize system_prompt extraction (handle literal "null" string) - Show system prompt, user template, and assistant template in the advisor notification banner so user can see exactly what was generated - Templates displayed in monospace with labeled sections --- studio/backend/utils/datasets/llm_assist.py | 15 ++++++-- .../dataset-preview-dialog-mapping.tsx | 36 +++++++++++++++++-- .../sections/dataset-preview-dialog.tsx | 7 ++++ 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/studio/backend/utils/datasets/llm_assist.py b/studio/backend/utils/datasets/llm_assist.py index 34ecd5eb55..ded4c49a00 100644 --- a/studio/backend/utils/datasets/llm_assist.py +++ b/studio/backend/utils/datasets/llm_assist.py @@ -562,7 +562,8 @@ def _run_multi_pass_advisor( {samples_text} Design a conversion strategy to turn this into conversation format for fine-tuning. - The strategy should create a system prompt, a user message template, and an assistant message template. + The strategy should create a user message template and an assistant message template. + Optionally include a system prompt ONLY if the task is ambiguous from the data alone. RULES: - Use {{column_name}} placeholders in templates to reference column values. @@ -574,10 +575,13 @@ def _run_multi_pass_advisor( - The assistant template should produce the expected model output. - column_roles: mark columns used in the user template as "user", columns used in the assistant template as "assistant". + - system_prompt: set to null if the user/assistant templates alone + make the task clear. Only provide one when extra context is needed + (e.g. persona, domain expertise, output format constraints). Respond with a JSON object: {{ - "system_prompt": "", + "system_prompt": "", "user_template": "