arvjay commited on
Commit
b396072
Β·
1 Parent(s): 294683f

change app avatars

Browse files
Files changed (1) hide show
  1. streamlit_app.py +12 -3
streamlit_app.py CHANGED
@@ -153,6 +153,14 @@ hr { border-color: #3A2408 !important; }
153
  """
154
 
155
 
 
 
 
 
 
 
 
 
156
  # ── streaming field markers ───────────────────────────────────────────────────
157
  # Gemma 4 outputs [[ ## field ]] (no closing ##); standard DSPy uses
158
  # [[ ## field ## ]]. config.py patches the DSPy parser to accept both, so
@@ -602,7 +610,8 @@ def main():
602
  total_assistant = sum(1 for m in st.session_state.messages if m["role"] == "assistant")
603
  assistant_count = 0
604
  for msg in st.session_state.messages:
605
- with st.chat_message(msg["role"]):
 
606
  st.markdown(msg["content"])
607
  if msg["role"] == "assistant":
608
  if assistant_count < len(st.session_state.turn_data):
@@ -635,7 +644,7 @@ def main():
635
 
636
  # Add user message to history and display it immediately
637
  st.session_state.messages.append({"role": "user", "content": prompt})
638
- with st.chat_message("user"):
639
  st.markdown(prompt)
640
 
641
  # Build DSPy history from all prior turns (before this one)
@@ -649,7 +658,7 @@ def main():
649
  ]
650
 
651
  # ── pipeline execution inside assistant bubble ────────────────────────────
652
- with st.chat_message("assistant"):
653
 
654
  with st.status("Working through your question…", expanded=True) as pipeline_status:
655
 
 
153
  """
154
 
155
 
156
+ # ── chat avatars ──────────────────────────────────────────────────────────────
157
+ # πŸ™ namaste β€” the seeker approaching a teacher with folded hands
158
+ # πŸͺ” diya β€” jñāna-dΔ«pa, the lamp of knowledge that dispels avidyā;
159
+ # ŚaαΉ…kara uses this metaphor throughout the VivekacūḍāmaαΉ‡i
160
+ _AVATAR_USER = "πŸ™"
161
+ _AVATAR_ADVISOR = "πŸͺ”"
162
+
163
+
164
  # ── streaming field markers ───────────────────────────────────────────────────
165
  # Gemma 4 outputs [[ ## field ]] (no closing ##); standard DSPy uses
166
  # [[ ## field ## ]]. config.py patches the DSPy parser to accept both, so
 
610
  total_assistant = sum(1 for m in st.session_state.messages if m["role"] == "assistant")
611
  assistant_count = 0
612
  for msg in st.session_state.messages:
613
+ avatar = _AVATAR_USER if msg["role"] == "user" else _AVATAR_ADVISOR
614
+ with st.chat_message(msg["role"], avatar=avatar):
615
  st.markdown(msg["content"])
616
  if msg["role"] == "assistant":
617
  if assistant_count < len(st.session_state.turn_data):
 
644
 
645
  # Add user message to history and display it immediately
646
  st.session_state.messages.append({"role": "user", "content": prompt})
647
+ with st.chat_message("user", avatar=_AVATAR_USER):
648
  st.markdown(prompt)
649
 
650
  # Build DSPy history from all prior turns (before this one)
 
658
  ]
659
 
660
  # ── pipeline execution inside assistant bubble ────────────────────────────
661
+ with st.chat_message("assistant", avatar=_AVATAR_ADVISOR):
662
 
663
  with st.status("Working through your question…", expanded=True) as pipeline_status:
664