diff --git a/e2e-chatbot-app/app.py b/e2e-chatbot-app/app.py index e483eca..5ea4e4d 100644 --- a/e2e-chatbot-app/app.py +++ b/e2e-chatbot-app/app.py @@ -10,6 +10,14 @@ from collections import OrderedDict from messages import UserMessage, AssistantResponse, render_message +# Configure Streamlit page for Gainwell branding +st.set_page_config( + page_title="Gainwell AI Assistant", + page_icon="./gainwell_logo.svg", + layout="wide", + initial_sidebar_state="collapsed" +) + logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) @@ -92,9 +100,116 @@ def reduce_chat_agent_chunks(chunks): if "history" not in st.session_state: st.session_state.history = [] -st.title("🧱 Chatbot App") -st.write(f"A basic chatbot using your own serving endpoint.") -st.write(f"Endpoint name: `{SERVING_ENDPOINT}`") +# Custom CSS for Gainwell branding +st.markdown(""" + +""", unsafe_allow_html=True) + +# Gainwell-branded header +with open('/Users/sam.sisto/app-templates/e2e-chatbot-app/gainwell_logo.svg', 'r') as f: + logo_svg = f.read() + +st.markdown(f""" +
+
+
+ {logo_svg} +
+
Gainwell AI Assistant
+
+
Reliability. Innovation. Delivered.
+
+ Your intelligent healthcare companion powered by advanced AI technology. + Supporting Medicaid modernization and public health initiatives with data-driven insights. +
+
+""", unsafe_allow_html=True) + +# Status indicator +st.markdown(f""" +
+
🔗 Connected AI Endpoint:
+
{SERVING_ENDPOINT}
+
+""", unsafe_allow_html=True) @@ -315,8 +430,40 @@ def query_responses_endpoint_and_render(input_messages): -# --- Chat input (must run BEFORE rendering messages) --- -prompt = st.chat_input("Ask a question") +# --- Healthcare-focused suggestions --- +if not st.session_state.history: + st.markdown(f""" +
+
+
+ {logo_svg} +
+

Healthcare Use Cases

+
+

Ask me about healthcare topics such as:

+
+
+ Medicaid & Public Health
+ Program management, enrollment, compliance +
+
+ Data Analytics
+ Population health insights, cost analysis +
+
+ System Integration
+ Interoperability, workflow optimization +
+
+ Care Management
+ Quality metrics, patient outcomes +
+
+
+ """, unsafe_allow_html=True) + +# --- Chat input with healthcare-focused placeholder --- +prompt = st.chat_input("Ask about healthcare data, Medicaid programs, or population health insights...") if prompt: # Get the task type for this endpoint task_type = _get_endpoint_task_type(SERVING_ENDPOINT) @@ -334,3 +481,21 @@ def query_responses_endpoint_and_render(input_messages): # Add assistant response to history st.session_state.history.append(assistant_response) + +# --- Footer --- +st.markdown(f""" +--- +
+
+
+ {logo_svg} +
+ Gainwell Technologies +
+
+ Healthcare Innovation & Modernization
+ Supporting Medicaid agencies, providers, and public health initiatives nationwide
+ Learn more about Gainwell Technologies +
+
+""", unsafe_allow_html=True) diff --git a/e2e-chatbot-app/gainwell_logo.svg b/e2e-chatbot-app/gainwell_logo.svg new file mode 100644 index 0000000..1c7c8f2 --- /dev/null +++ b/e2e-chatbot-app/gainwell_logo.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/e2e-chatbot-app/messages.py b/e2e-chatbot-app/messages.py index 3c97cb0..0fe0868 100644 --- a/e2e-chatbot-app/messages.py +++ b/e2e-chatbot-app/messages.py @@ -60,26 +60,38 @@ def render(self, idx): def render_message(msg): - """Render a single message.""" + """Render a single message with healthcare-focused styling.""" if msg["role"] == "assistant": # Render content first if it exists if msg.get("content"): st.markdown(msg["content"]) - # Then render tool calls if they exist + # Then render tool calls if they exist with healthcare-focused icons and messaging if "tool_calls" in msg and msg["tool_calls"]: for call in msg["tool_calls"]: fn_name = call["function"]["name"] args = call["function"]["arguments"] - st.markdown(f"🛠️ Calling **`{fn_name}`** with:\n```json\n{args}\n```") + st.markdown(f""" +
+ ⚙️ Healthcare Analysis Tool: {fn_name} +
+ View parameters +
{args}
+
+
+ """, unsafe_allow_html=True) elif msg["role"] == "tool": - st.markdown("🧰 Tool Response:") + st.markdown(""" +
+ 📈 Analysis Results: +
+ """, unsafe_allow_html=True) st.code(msg["content"], language="json") @st.fragment def render_assistant_message_feedback(i, request_id): - """Render feedback UI for assistant messages.""" + """Render healthcare-focused feedback UI for assistant messages.""" from model_serving_utils import submit_feedback import os @@ -92,4 +104,11 @@ def save_feedback(index): rating=st.session_state[f"feedback_{index}"] ) + # Healthcare-focused feedback prompt + st.markdown(""" +
+ Was this healthcare information helpful? +
+ """, unsafe_allow_html=True) + st.feedback("thumbs", key=f"feedback_{i}", on_change=save_feedback, args=[i]) \ No newline at end of file