INNER CODE UNIT · Python

display_history

VersusControl/devops-ai-guidelines · 03-ai-agent-for-devops/code/10/app.py:130

def display_history():
    """Render all past messages, including collapsed thinking steps."""
    for msg in st.session_state.messages:
        with st.chat_message(msg["role"]):
            steps = msg.get("steps")
            if steps:
                with st.expander(
                    f"{len(steps)} step{'s' if len(steps) != 1 else ''}",
                    expanded=False,
                ):
                    for s in steps:
                        st.write(f"**{s['label']}** — {s['detail']}")
            st.markdown(msg["content"])


# ─────────────────────────────────────────────────────────────
# Sidebar
# ─────────────────────────────────────────────────────────────

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…