INNER CODE UNIT · Python

create_folder_structure

mfmezger/conversational-agent-langchain · frontend/assistant.py:29

def create_folder_structure(folder_path: str) -> None:
    """Create the folder structure."""
    Path(folder_path).mkdir(parents=True, exist_ok=True)


def init_chat_history() -> None:
    """Initialize chat history in session state."""
    if "messages" not in st.session_state:
        st.session_state.messages = []


def display_chat_history() -> None:
    """Display chat messages from history."""
    for message in st.session_state.messages:
        with st.chat_message(message["role"]):
            st.markdown(message["content"])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…