"""
observation_text = str(step.get("observation", "")) if step.get("observation") else "None"
html_out += f"""
Observation
{format_step_content(observation_text)}
"""
thought_text = step.get("thought", "") if step.get("thought") else "None"
html_out += f"""
Thought
{format_step_content(thought_text)}
"""
action_text = ""
action = step.get("action")
if action:
if isinstance(action, dict) and "action" in action:
action_text = action["action"]
else:
action_text = str(action)
html_out += f"""
Action:
{format_step_content(action_text)}
"""
reward = step.get("reward", 0.0)
html_out += f"""
Reward: {reward}
"""
html_out += "