{% block rendered_context %}
{% include "extra-context.jinja2" %}
{% endblock %}
<|SECTION:SCENE|>
{% for scene_context in scene.context_history(budget=max_tokens-1024-count_tokens(self.rendered_context())) -%}
{{ scene_context }}
{% endfor %}
<|CLOSE_SECTION|>
<|SECTION:TASK|>
{% if not group -%}
{# single character name -#}
Determine character name based on the following sentence: {{ character_name }}

{% if not allowed_names -%}
If the character already has a distinct name, respond with the character's name.
If the name is currently a description, give the character a distinct name.
If we don't know the character's actual name, you must decide one.
YOU MUST ONLY RESPOND WITH THE CHARACTER NAME, NOTHING ELSE.
{% else %}
Pick the most fitting name from the following list: {{ allowed_names|join(', ') }}. If none of the names fit, respond with the most accurate name based on the sentence.
{%- endif %}
{%- else %}
{# group name -#}
Determine a descriptive group name based on the following sentence: {{ character_name }}

This is how this group of characters will be referred to in the script whenever they have dialogue or performance.

The group name MUST fit the context of the scenario and scene.

If the sentence lists multiple characters by name, you must repeat it back as is.

YOU MUST ONLY RESPOND WITH THE GROUP NAME, NOTHING ELSE.
{%- endif %}
<|CLOSE_SECTION|>
{{ bot_token }}The {% if not group %}character{% else %}group{% endif %}'s name is "