Skip to main content

System Prompt

The system prompt is a key feature in TaskingAI's assistant system, enabling assistants to generate consistent and contextually relevant responses. It incorporates variables, allowing for personalized and dynamic message generation based on different conversation contexts.

System Prompt Template


Features of the System Prompt

  • Priority Placement: The system prompt is placed at the forefront during each call to the chat completion model inference to guide the Assistant's generation.
  • Variable Support: The template allows for the inclusion of variables, making the prompts adaptable to the conversation's context.
  • Dynamic Hiding: If any variable within the list of strings is not provided, that part of the template is hidden in the construction of the final prompt, ensuring only relevant information is presented.

Example: System Prompt with Variables

Consider a system prompt template designed for a virtual health advisor, with variables for the type of advice and urgency:

[
"You are a health advisor providing {{advice_type}} advice",
"Please respond with {{urgency}} urgency.",
"You should always reply with a professional, kind, and patient tone."
]

Here are different scenarios for constructing the final system prompt:

Both Variables Provided:

If advice_type is set to "nutritional" and urgency to "immediate", the final system prompt would be:

[
"You are a health advisor providing nutritional advice",
"Please respond with immediate urgency.",
"You should always reply with a professional, kind, and patient tone."
]

One Variable Omitted:

If advice_type is provided as "nutritional" but urgency is not specified, the line containing urgency will be omitted. The final system prompt would be:

[  
"You are a health advisor providing nutritional advice",
"You should always reply with a professional, kind, and patient tone."
]

No Variables Provided:

If neither variable is provided, both lines with variables are omitted, and the The final system prompt would be:

[  
"You should always reply with a professional, kind, and patient tone."
]

Overall, the system prompt template functions as a dynamic script for the Assistant. It changes based on the variables provided. Each line in the template is conditional. If a line contains a variable that is not filled, that line is excluded from the final system prompt.

This feature ensures that the Assistant’s responses are always tailored to the specific context of the conversation. It prevents irrelevant or incomplete information from being included in the Assistant’s dialogue.