Spaces:
Running
Running
Divyanshu3321
commited on
Commit
Β·
95bf231
1
Parent(s):
86831fe
Update Images
Browse files- src/images/ai-technology (1).png +0 -0
- src/images/ai.png +0 -0
- src/images/chat.png +0 -0
- src/streamlit_app.py +5 -5
src/images/ai-technology (1).png
ADDED
|
src/images/ai.png
CHANGED
|
|
src/images/chat.png
ADDED
|
src/streamlit_app.py
CHANGED
|
@@ -22,7 +22,7 @@ if "messages" not in st.session_state:
|
|
| 22 |
|
| 23 |
# default message
|
| 24 |
if not st.session_state.messages:
|
| 25 |
-
with st.chat_message("assistant", avatar="images/ai.png"):
|
| 26 |
st.markdown("π **Hi! I can help you think, code, or search real-time info. Just ask!**")
|
| 27 |
|
| 28 |
# Tool name map
|
|
@@ -36,8 +36,8 @@ tool_mapping = {
|
|
| 36 |
# display chat messages from history at every rerun
|
| 37 |
for message in st.session_state.messages:
|
| 38 |
avatar_path = (
|
| 39 |
-
"images/person_15454011.png" if message["role"] == "user"
|
| 40 |
-
else "images/ai.png"
|
| 41 |
)
|
| 42 |
with st.chat_message(message["role"], avatar=avatar_path):
|
| 43 |
st.markdown(message["content"])
|
|
@@ -62,14 +62,14 @@ selected_tool_name = tool_mapping[st.session_state.selected_tool]
|
|
| 62 |
if prompt:
|
| 63 |
try:
|
| 64 |
# show user message
|
| 65 |
-
with st.chat_message("user", avatar="images/person_15454011.png"):
|
| 66 |
st.markdown(prompt)
|
| 67 |
# Save user message
|
| 68 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 69 |
|
| 70 |
# stream assistant response
|
| 71 |
full_response = ""
|
| 72 |
-
with st.chat_message("assistant", avatar="images/ai.png"):
|
| 73 |
response_stream = st.session_state.chat.send_message_stream(prompt)
|
| 74 |
response_placeholder = st.empty()
|
| 75 |
|
|
|
|
| 22 |
|
| 23 |
# default message
|
| 24 |
if not st.session_state.messages:
|
| 25 |
+
with st.chat_message("assistant", avatar="src/images/ai.png"):
|
| 26 |
st.markdown("π **Hi! I can help you think, code, or search real-time info. Just ask!**")
|
| 27 |
|
| 28 |
# Tool name map
|
|
|
|
| 36 |
# display chat messages from history at every rerun
|
| 37 |
for message in st.session_state.messages:
|
| 38 |
avatar_path = (
|
| 39 |
+
"src/images/person_15454011.png" if message["role"] == "user"
|
| 40 |
+
else "src/images/ai.png"
|
| 41 |
)
|
| 42 |
with st.chat_message(message["role"], avatar=avatar_path):
|
| 43 |
st.markdown(message["content"])
|
|
|
|
| 62 |
if prompt:
|
| 63 |
try:
|
| 64 |
# show user message
|
| 65 |
+
with st.chat_message("user", avatar="src/images/person_15454011.png"):
|
| 66 |
st.markdown(prompt)
|
| 67 |
# Save user message
|
| 68 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 69 |
|
| 70 |
# stream assistant response
|
| 71 |
full_response = ""
|
| 72 |
+
with st.chat_message("assistant", avatar="src/images/ai.png"):
|
| 73 |
response_stream = st.session_state.chat.send_message_stream(prompt)
|
| 74 |
response_placeholder = st.empty()
|
| 75 |
|