Skip to content

Prompt variables

Francesco Caracciolo edited this page Jun 27, 2025 · 5 revisions

Prompts in Newelle are dynamic, you can specify these variables to add context to the LLM:

  • {DISTRO}: Your current linux distribution
  • {DE}: You current desktop environment (Gnome, KDE Plasma, Cinnamon, Hyprland...)
  • {DATE}: Today's date and time
  • {USER}: You username (specified in settings)
  • {DISPLAY}: Display server/protocol (X11 or Wayland)
  • {DIR}: Current directory

⚠️ Available from v1.0: Programmable prompts

Random Prompts

Random Prompts: choose one of the specified prompts randomly, format:

{RANDOM:
[? probability] Prompt 1
[? probability] Prompt 2
}

For example:

{RANDOM:
[? 0.3] Prompt with 30% probabilities of being chosen
[? 0.7] Prompt with 70% probabilities of being chosen
}

Probabilities don't have to sum to 1, they are considered weights.

Conditional Prompts

Shows a prompt if a condition is verified.

{COND: 
[condition 1] Prompt 1
[condition 2] Prompt 2
}

Supported things in condition expressions

{COND: 
[var] Prompt to show if var is true
[not var] Prompt to show if var is false
[var and not var2] Prompt to show if var is true and var2 is false
[var or var2] prompt to show if var is true or var2 is true
[var.contains("text")] prompt to show if var contains text
}

Supported variables in conditions

  • tts_on: bool, if TTS is on
  • virtualization_on: bool, if the command virtualization is enabled
  • auto_run: bool, if automatic command run is enabled
  • websearch_on: bool, if websearch is enabled
  • rag_on: bool, if RAG on documents (document reading) is enabled
  • loacal_folder: bool, if RAG on the local documents folder is enabled
  • automatic_stt: bool, if automatic stt is enabled
  • profile_name: string, current profile name
  • external_browser: bool, if links open in external browser instead of integrated one
  • history: string, whole chat history
  • message: string, last user message
  • You can also use any prompt variable, like distro, de as strings

Examples

{COND:
[tts_on] PROMPT1
[not tts_on] PROMPT 2
}

{COND:
[message.contains("text")] PROMPT 1
}

Example usage: Probabilities can also be simple weights:

{RANDOM:
[? 3] Message with probability 3/6
[? 2] Message with probability 2/6
It can also go on newline and have variables like {DIR}
[? 1] Message with probability 1/6
}

Make messages shorter when on TTS:

{COND:
[tts_on] Give concise responses. What you say will be spoken out loud
}

Only include the youtube transcription tool when there is a youtube link in the last message

{COND:
[message.contains("youtube") or message.contains(youtu.be)] - Yo get a transcript of a youtube video use:
\```youtube
link
\```
}

Note: in the prompt you can avoid the , it's only for markdown demonstration. Escaping: You can use [ something ] { } if you want to escape some special character in the prompt

{COND:
[message.contains("arch") and message.contains("linux")] - You can use `sudo pacman -S \{package\}` to install a package

As package is not a variable, it won't be replaced

Clone this wiki locally