Spaces:
Running
Running
change app avatars
Browse files- 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 |
-
|
|
|
|
| 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 |
|