def _render_messages(state: AgentState) -> None: if not state.get("messages"): with st.chat_message("assistant"): st.write( "Hi! I can help you book house or couch cleaning. " "Tell me what you need, including the size and service address." ) return for message in state["messages"]: if isinstance(message, HumanMessage): role = "user" elif isinstance(message, AIMessage): role = "assistant" else: continue with st.chat_message(role): st.write(str(message.content))