"""Practice Fields Hub — Curated Therapeutic Practice Spaces""" import streamlit as st import base64 import os st.set_page_config(page_title="Practice Fields", page_icon="🌱", layout="wide") def get_image_base64(image_path): """Convert image to base64 for embedding in HTML.""" try: with open(image_path, "rb") as f: return base64.b64encode(f.read()).decode() except: return None # Get base path for images BASE_PATH = os.path.dirname(os.path.abspath(__file__)) IMG_PATH = os.path.join(BASE_PATH, "images") st.markdown(""" """, unsafe_allow_html=True) if "clinician_name" not in st.session_state: st.session_state.clinician_name = "" if "clinician_orientation" not in st.session_state: st.session_state.clinician_orientation = "" if "onboarded" not in st.session_state: st.session_state.onboarded = False # Load images IMAGES = { "shadowbox": get_image_base64(os.path.join(IMG_PATH, "shadowbox.webp")), "tendsend": get_image_base64(os.path.join(IMG_PATH, "tendsend.webp")), "buildabot": get_image_base64(os.path.join(IMG_PATH, "buildabot.webp")), "diagnosis": get_image_base64(os.path.join(IMG_PATH, "diagnosis.webp")), "gspt": get_image_base64(os.path.join(IMG_PATH, "gspt.webp")), "learnnvc": get_image_base64(os.path.join(IMG_PATH, "learnnvc.webp")), "difficultconversations": get_image_base64(os.path.join(IMG_PATH, "difficultconversations.webp")), } def img_tag(key): if IMAGES.get(key): return f'' return "" SPACES = [ {"key": "shadowbox", "title": "ShadowBox Library", "desc": "A resonant library for hard thoughts. Psychoeducation without synthetic intimacy.", "url": "https://huggingface.co/spaces/jostlebot/shadowbox.library"}, {"key": "tendsend", "title": "Tend & Send", "desc": "Craft messages with care. Practice tending to yourself before sending.", "url": "https://huggingface.co/spaces/jostlebot/TendSend.PrototypeBot"}, {"key": "buildabot", "title": "Build a Bot", "desc": "AI literacy — understand how LLMs work, spot synthetic intimacy.", "url": "https://huggingface.co/spaces/jostlebot/BuildABot.2"}, {"key": "diagnosis", "title": "Diagnosis Explorer", "desc": "Understand diagnostic categories with nuance and care.", "url": "https://huggingface.co/spaces/jostlebot/DiagnosisExplorer"}, {"key": "gspt", "title": "GSPT", "desc": "Generating Safer Passages of Text. Warm, boundaried reflections.", "url": "https://huggingface.co/spaces/jostlebot/GSPT"}, {"key": "learnnvc", "title": "Learn NVC", "desc": "Practice Nonviolent Communication. Transform judgments into needs.", "url": "https://huggingface.co/spaces/jostlebot/LearnNVC"}, {"key": "difficultconversations", "title": "Difficult Conversations", "desc": "Rehearse hard conversations before having them for real.", "url": "https://huggingface.co/spaces/jostlebot/PracticeDifficultConversations"}, ] if not st.session_state.onboarded: st.markdown("""
Practice Fields
Example Prototype
""", unsafe_allow_html=True) st.markdown("""

This is a prototype demonstration of what becomes possible when mental health professionals bring clinical insight, experience, and wisdom to the design of AI-assisted tools.

Each space represents bounded, trauma-informed innovation — using LLMs as a relational medium with extraordinary strategic care. Not replacing therapy. Not performing synthetic intimacy. Building bridges back to human connection.

Created by a licensed clinician exploring what ethical, clinically-grounded AI practice spaces can look like.

""", unsafe_allow_html=True) st.markdown('
', unsafe_allow_html=True) st.markdown("""
Enter as Clinician
Personalize this hub to explore the prototype spaces
""", unsafe_allow_html=True) col1, col2, col3 = st.columns([1, 2, 1]) with col2: with st.form("onboarding"): name = st.text_input("Your Name & Credentials", placeholder="e.g., Dr. Sarah Chen, LMHC") orientation = st.text_area("Clinical Orientation", placeholder="e.g., Attachment-focused, DBT-informed, IFS, somatic...", height=80) st.markdown("
", unsafe_allow_html=True) if st.form_submit_button("Enter Practice Fields", use_container_width=True): if name: st.session_state.clinician_name = name st.session_state.clinician_orientation = orientation st.session_state.onboarded = True st.rerun() else: st.error("Please enter your name.") else: st.markdown("""
Practice Fields
Structured practice for relational growth
""", unsafe_allow_html=True) st.markdown(f"""
{st.session_state.clinician_name}
{st.session_state.clinician_orientation or "Clinical Practice"}
""", unsafe_allow_html=True) col1, col2, col3 = st.columns([1, 1, 1]) with col2: if st.button("✎ Edit Info", use_container_width=True): st.session_state.onboarded = False st.rerun() st.markdown('

Practice Spaces

', unsafe_allow_html=True) col1, col2 = st.columns(2, gap="medium") for i, s in enumerate(SPACES): with col1 if i % 2 == 0 else col2: st.markdown(f""" {img_tag(s["key"])}
{s["title"]}
{s["desc"]}
""", unsafe_allow_html=True) st.markdown(""" """, unsafe_allow_html=True)