From 71426cbd0207af158a23a32097a4a3cff2ab7a09 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:08:14 -0400 Subject: [PATCH] Improve task rendering --- .../orchestration/prompt_templates/tasks.jinja | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/controlflow/orchestration/prompt_templates/tasks.jinja b/src/controlflow/orchestration/prompt_templates/tasks.jinja index 780712a8..d194f3ce 100644 --- a/src/controlflow/orchestration/prompt_templates/tasks.jinja +++ b/src/controlflow/orchestration/prompt_templates/tasks.jinja @@ -1,9 +1,10 @@ {% macro render_task_hierarchy(task_info, indent='') -%} -{{ indent }}- {{ task_info.task.id }} ({{ task_info.task.status.value }}){% if task_info['is_active'] %} -(active){% endif %} +{{ indent }}- {{ task_info.task.id }} ({{ task_info.task.status.value }}){% if task_info['is_active'] %} (active){% +endif %} {%- if task_info.children %} + {% for child in task_info.children %} -{{ render_task_hierarchy(child, indent + ' ') }} +{{ render_task_hierarchy(child, indent + '-') }} {%- endfor %} {%- endif %} {%- endmacro -%} @@ -21,6 +22,8 @@ The following tasks are active: {{ task.get_prompt() }} + + {% endfor %} Only agents assigned to a task are able to mark the task as complete. You must