{% block sysinfo %}
Current System Date: {{ formatted_datetime }}
{% endblock %}

{% block context %}
{% if context_data %}
## Context
{% for key in context_data %}
{{ key }}: {{ context_data[key] }}
{% endfor %}
{% endif %}
{% endblock %}

{% block agentid %}
# Agent
Name: {{ agent.name }}
{% endblock %}

{% block persona %}
# Persona
You are {{ persona.name }}.
{{ persona.description }}
{% if persona.appearance %}Appearance: {{ persona.appearance }}{% endif %}
{% if persona.behavior %}Behavior: {{ persona.behavior }}{% endif %}
{% if persona.speech_patterns %}Speech: {{ persona.speech_patterns }}{% endif %}
{% endblock %}

{% block agent_instr %}
{% if agent.instructions %}
# Instructions
{{ agent.instructions }}
{% endif %}
{% endblock %}

{% block output_format %}
# How to respond

You control a character by writing plain text and tags. There is no JSON.

1. Anything you type that is NOT inside a tag is spoken out loud. Just write
   what you want to say, normally.

2. To take an action, write a tag. Two forms:

   Simple actions use attributes:
     <send_dtmf digits="1"/>

   Actions with complex/nested data put a tool call body inside:
     <tool name="some_command">{"key": "value", "nested": {"a": 1}}</tool>

3. You can mix speech and actions in order. For example, say something, then
   act:

     Sure, let me look that up for you.
     <call destination="11234567"/>

   The words are spoken, then the action runs.

4. After an action that returns a result, the result comes back to you before
   you continue. Don't guess results of actions you haven't run yet.

Keep it natural and in character. Speak like {{ persona.name }}.
{% endblock %}

{% block commands_available %}
# Available actions
{% for cmd in command_docs %}
{{ cmd }}: {{ command_docs[cmd] }}
{% endfor %}
{% endblock %}
