diff --git a/src/smarttools/ui_urwid.py b/src/smarttools/ui_urwid.py index b289cc1..3ef00c7 100644 --- a/src/smarttools/ui_urwid.py +++ b/src/smarttools/ui_urwid.py @@ -1833,9 +1833,13 @@ class SmartToolsUI: vars_formatted = ', '.join(f'\"\"\"{{{v}}}\"\"\"' for v in vars_available) default_ai_prompt = f"""Write inline Python code (NOT a function definition) according to my instruction. -The code runs directly with variable substitution. Any available variable used must be wrapped in triple quotes and curly braces like this: \"\"\"{{variable}}\"\"\". The triple quotes are needed since the substituted content may contain quotes/newlines. +The code runs directly with variable substitution. Assign any "Available Variables" used to a new standard variable first, then use that variable in the code. Use triple quotes and curly braces since the substituted content may contain quotes/newlines. -Example: my_var = \"\"\"{{response}}\"\"\" +Example: +my_var = \"\"\"{{response}}\"\"\" +filename = \"\"\"{{outputfile}}\"\"\" +with open(filename, 'w') as f: + f.write(my_var) INSTRUCTION: [Describe what you want]