Spaces:
Running
Running
Commit
·
a51e165
1
Parent(s):
a27f48a
Update page1.py
Browse files
page1.py
CHANGED
|
@@ -10,7 +10,7 @@ import time
|
|
| 10 |
import random
|
| 11 |
def text():
|
| 12 |
with st.chat_message("assistant"):
|
| 13 |
-
|
| 14 |
full_response = ""
|
| 15 |
assistant_response = random.choice(
|
| 16 |
[
|
|
@@ -24,8 +24,8 @@ def text():
|
|
| 24 |
full_response += chunk + " "
|
| 25 |
time.sleep(0.5)
|
| 26 |
# Add a blinking cursor to simulate typing
|
| 27 |
-
|
| 28 |
-
|
| 29 |
# Add assistant response to chat history
|
| 30 |
#st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 31 |
apiKey = "AIzaSyAXkkcrrUBjPEgj93tZ9azy7zcS1wI1jUA"
|
|
|
|
| 10 |
import random
|
| 11 |
def text():
|
| 12 |
with st.chat_message("assistant"):
|
| 13 |
+
message_placeholder = st.empty()
|
| 14 |
full_response = ""
|
| 15 |
assistant_response = random.choice(
|
| 16 |
[
|
|
|
|
| 24 |
full_response += chunk + " "
|
| 25 |
time.sleep(0.5)
|
| 26 |
# Add a blinking cursor to simulate typing
|
| 27 |
+
st.markdown(full_response + "▌")
|
| 28 |
+
st.markdown(full_response)
|
| 29 |
# Add assistant response to chat history
|
| 30 |
#st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 31 |
apiKey = "AIzaSyAXkkcrrUBjPEgj93tZ9azy7zcS1wI1jUA"
|