{# ── Header row ── #}
{# ── Waterfall timeline bar ── #}
{% if span.waterfall_left_pct is defined and span.waterfall_width_pct is defined %}
{% endif %}
{# ── Expandable details ── #}
{# ── Summary row ── #}
{% if span.model %}
Model: {{ span.model }}
{% endif %}
{% if span.error_message %}
Error: {{ span.error_message }}
{% endif %}
{# ══════════ LLM SPAN DETAILS ══════════ #}
{% if span.span_type == 'llm' %}
{# -- Tokens & Cost -- #}
{% if span.input_tokens is not none %}
| Input Tokens | {{ "{:,}".format(span.input_tokens | default(0) | int) }}{% if span.input_cost is not none %} (${{ "%.6f" | format(span.input_cost | float) }}){% endif %} |
{% if span.cached_tokens %}| Cached Input Tokens | {{ "{:,}".format(span.cached_tokens | int) }}{% if span.cached_cost is not none %} (${{ "%.6f" | format(span.cached_cost | float) }}){% endif %} |
{% endif %}
| Output Tokens | {{ "{:,}".format(span.output_tokens | default(0) | int) }}{% if span.output_cost is not none %} (${{ "%.6f" | format(span.output_cost | float) }}){% endif %} |
{% if span.reasoning_tokens %}| Reasoning Tokens | {{ "{:,}".format(span.reasoning_tokens | int) }}{% if span.reasoning_cost is not none %} (${{ "%.6f" | format(span.reasoning_cost | float) }}){% endif %} |
{% endif %}
| Total Tokens | {{ "{:,}".format(span.total_tokens | default(0) | int) }} |
{% if span.total_cost is not none %}| Total Cost | ${{ "%.6f" | format(span.total_cost | float) }} |
{% endif %}
{% endif %}
{# -- Configuration -- #}
{% if span.llm_model %}| Model | {{ span.llm_model }} |
{% endif %}
{% if span.llm_provider %}| Provider | {{ span.llm_provider }} |
{% endif %}
{% if span.llm_api_type %}| API Type | {{ span.llm_api_type }} |
{% endif %}
{% if span.llm_temperature is not none %}| Temperature | {{ span.llm_temperature }} |
{% endif %}
{% if span.llm_max_output_tokens is not none %}| Max Output Tokens | {{ span.llm_max_output_tokens }} |
{% endif %}
{% if span.llm_top_p is not none %}| Top P | {{ span.llm_top_p }} |
{% endif %}
{% if span.llm_reasoning_enabled is not none %}| Reasoning Enabled | {{ span.llm_reasoning_enabled }} |
{% endif %}
{% if span.llm_reasoning_effort %}| Reasoning Effort | {{ span.llm_reasoning_effort }} |
{% endif %}
{% if span.llm_streaming is not none %}| Streaming | {{ span.llm_streaming }} |
{% endif %}
{% if span.stop_reason %}| Stop Reason | {{ span.stop_reason }} |
{% endif %}
{% if span.llm_response_id %}| Response ID | {{ span.llm_response_id }} |
{% endif %}
{# -- Tools -- #}
{% if span.llm_tool_names %}
{% for tool in span.llm_tool_names %}
{% if tool is mapping %}
{% else %}
{{ tool }}
{% endif %}
{% endfor %}
{% endif %}
{# -- System Prompt -- #}
{% if span.llm_system_prompt %}
{{ span.llm_system_prompt }}
{% endif %}
{# -- Input Messages -- #}
{% if span.llm_input_messages %}
{{ span.llm_input_messages | pretty_json }}
{% endif %}
{# -- Output -- #}
{% if span.llm_output_text %}
{{ span.llm_output_text }}
{% endif %}
{# -- Output Content (structured) -- #}
{% if span.llm_output_content %}
{{ span.llm_output_content | pretty_json }}
{% endif %}
{# -- Reasoning -- #}
{% if span.llm_reasoning_text %}
{{ span.llm_reasoning_text }}
{% endif %}
{# -- Full Config Snapshot -- #}
{% if span.llm_config_snapshot %}
{{ span.llm_config_snapshot | pretty_json }}
{% endif %}
{% endif %}{# end LLM #}
{# ══════════ AGENT SPAN DETAILS ══════════ #}
{% if span.span_type == 'agent' %}
{# -- Agent Summary -- #}
{% if span.agent_detail_name %}| Agent Name | {{ span.agent_detail_name }} |
{% endif %}
{% if span.agent_detail_class %}| Agent Class | {{ span.agent_detail_class }} |
{% endif %}
{% if span.iteration_count is not none %}| Iterations | {{ span.iteration_count }} |
{% endif %}
{% if span.agent_total_llm_calls is not none %}| Total LLM Calls | {{ span.agent_total_llm_calls }} |
{% endif %}
{% if span.agent_tool_count is not none %}| Tools Available | {{ span.agent_tool_count }} |
{% endif %}
{% if span.agent_sub_agent_count is not none %}| Sub-Agents | {{ span.agent_sub_agent_count }} |
{% endif %}
{% if span.agent_input_message_count is not none %}| Input Messages | {{ span.agent_input_message_count }} |
{% endif %}
{# -- Tools -- #}
{% if span.agent_tool_names %}
{% for tool in span.agent_tool_names %}
{% if tool is mapping %}
{% else %}
{{ tool }}
{% endif %}
{% endfor %}
{% endif %}
{# -- Tool Interactions -- #}
{% if span.agent_tool_interactions %}
{% for ti in span.agent_tool_interactions %}
{% endfor %}
{% endif %}
{# -- System Prompt -- #}
{% if span.agent_system_prompt %}
{{ span.agent_system_prompt }}
{% endif %}
{# -- User Prompt Template -- #}
{% if span.agent_user_prompt_template %}
{{ span.agent_user_prompt_template }}
{% endif %}
{# -- Input Messages -- #}
{% if span.agent_input_messages %}
{{ span.agent_input_messages | pretty_json }}
{% endif %}
{# -- Output -- #}
{% if span.agent_output_text %}
{{ span.agent_output_text }}
{% endif %}
{# -- Output Content (structured) -- #}
{% if span.agent_output_content %}
{{ span.agent_output_content | pretty_json }}
{% endif %}
{# -- Context -- #}
{% if span.agent_context %}
{{ span.agent_context | pretty_json }}
{% endif %}
{# -- Full Config Snapshot -- #}
{% if span.agent_config_snapshot %}
{{ span.agent_config_snapshot | pretty_json }}
{% endif %}
{% endif %}{# end Agent #}
{# ══════════ TOOL CALLS ══════════ #}
{% set span_tools = tool_calls.get(span.span_id, []) if tool_calls else [] %}
{% if span_tools %}
{% for tc in span_tools %}
{% endfor %}
{% endif %}
{# end span-details #}
{# ── Children (recursive) ── #}
{% if span.children %}
{% for child in span.children %}
{{ render_span(child, tool_calls, loop.last) }}
{% endfor %}
{% endif %}