{% set rendered_context -%}
{% include "character-context.jinja2" -%}
{% include "memory-context.jinja2" -%}
{% include "extra-context.jinja2" -%}
{% if context_investigation %}
<|SECTION:POTENTIALLY RELEVANT INFORMATION|>
{{ context_investigation }}
<|CLOSE_SECTION|>
{% endif %}
{% include "scene-intent.jinja2" %}
{% endset %}
{{ rendered_context }}
{% include "scene-classification.jinja2" %}
<|SECTION:SCENE|>
{% block scene_history -%}
{% set scene_context = scene.context_history(
    budget=max_tokens-300-count_tokens(rendered_context), 
    min_dialogue=min_dialogue or 20, 
    sections=sections or False, 
    keep_director=keep_director or False, 
    chapter_labels=chapter_labels or False
    ) 
-%}
{% for scene_line in scene_context -%}
{{ scene_line }}
{% endfor %}
<|CLOSE_SECTION|>
{% endblock -%}