diff --git a/src/smarttools/ui_urwid.py b/src/smarttools/ui_urwid.py index c27dee2..bb6fc08 100644 --- a/src/smarttools/ui_urwid.py +++ b/src/smarttools/ui_urwid.py @@ -1829,7 +1829,9 @@ class SmartToolsUI: ai_provider_select_btn = Button3DCompact("▼", on_press=show_ai_provider_dropdown) # Default prompt template for AI code generation/adjustment - default_ai_prompt = f"""Modify or generate Python code according to my instruction below. + default_ai_prompt = f"""Write inline Python code (NOT a function definition) according to my instruction. + +The code runs directly - variables are already available, no function needed. INSTRUCTION: [Describe what you want] @@ -1840,7 +1842,8 @@ CURRENT CODE: AVAILABLE VARIABLES: {', '.join(vars_available)} -Return ONLY the Python code, no explanations or markdown fencing.""" +IMPORTANT: Return ONLY executable inline code. Do NOT wrap in a function. +No explanations, no markdown fencing, just the code.""" # Multiline editable prompt for AI with DOS-style scrollbar ai_prompt_edit = TabPassEdit(edit_text=default_ai_prompt, multiline=True)