{% block rendered_context -%}
{% include "character-context.jinja2" -%}
{% endblock %}
<|SECTION:SCENE|>
{% block scene_history -%}

{% set scene_context = scene.context_history(
    budget=max_tokens-300-count_tokens(self.rendered_context()), 
    min_dialogue=15, 
    sections=False, 
    keep_director=False, 
    chapter_labels=True
    ) 
-%}
{% set final_line_number=len(scene_context) %}

{% for scene_line in scene_context -%}
{{ scene_line }}

{% endfor %}
<|CLOSE_SECTION|>
{% if context_investigation %}
<|SECTION:HISTORIC CONTEXT|>
{{ context_investigation }}
<|CLOSE_SECTION|>
{% endif %}
{% endblock -%}
<|SECTION:TASK|>
Your task is to analyze the scene progression so far and how it informs what {{ character.name }}'s next line or action in the scene will be.

The information you write will be given to the other story editors to write {{ character.name }}'s next action in the scene. Use plain text formatting.

{% set bullet_num=1 %}

{{ bullet_num }}) Make statements about context, meaning and facts established.


{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Quickly list who the characters in the scene are to each other.

{% set last_message = scene.last_message_of_type("character") %}

{% if last_message %}
{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Analyze the meaning of {{ last_message.character_name }}'s final line the scene. What was the meaning of their dialogue and actions?

``` {{ last_message.character_name }}'s final line
{{ last_message }}
```

{% if context_investigation -%}
{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Briefly explain what you understand from the historical context.
{% endif %}
{% endif %}

{% if deep_analysis -%}
{% set bullet_num = bullet_num+1 %}{{ bullet_num }}) Tell the story editors to read through any chapter(s) that may provide additional information to help guide them in writing the continuation of the scene for {{ character.name }}. To do this simply state "Read through chapter {number} to find out ..." followed by a specific detail you wish to understand. What question are you looking to answer? Avoid generic and broad queries and explain why the answer will help guide the story editors.

You may instruct them to read {{ max_content_investigations }} chapter(s).

The chapter number is always two digits separated by a period.
{% endif %}

{% if length == "medium" %}Your analysis should be 2 - 3 paragraphs long.{% elif length == "short" %}Your analysis should be 1 - 2 paragraphs long.{% endif %}
<|CLOSE_SECTION|>