{% if substep.thought %}
Thought: {{ substep.thought }}
{% endif %}
{% if substep.tool_name and substep.tool_input %}
Action: {"tool": "{{ substep.tool_name }}", "input": "{{ substep.tool_input }}"}
{% elif substep.tool_name %}
Action: {"tool": "{{ substep.tool_name }}"}
{% endif %}
{% if substep.output %}
Observation: {{ substep.output.value }}
{% endif %}