Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import streamlit.components.v1 as components
|
| 3 |
-
|
| 4 |
-
st.title("Echo Bot")
|
| 5 |
-
|
| 6 |
-
# Initialize chat history
|
| 7 |
-
if "messages" not in st.session_state:
|
| 8 |
-
st.session_state.messages = []
|
| 9 |
-
|
| 10 |
-
default_chat_input_value = "Default Value"
|
| 11 |
-
js = f"""
|
| 12 |
-
<script>
|
| 13 |
-
function insertText(dummy_var_to_force_repeat_execution) {{
|
| 14 |
-
var chatInput = parent.document.querySelector('textarea[data-testid="stChatInput"]');
|
| 15 |
-
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, "value").set;
|
| 16 |
-
nativeInputValueSetter.call(chatInput, "{default_chat_input_value}");
|
| 17 |
-
var event = new Event('input', {{ bubbles: true}});
|
| 18 |
-
chatInput.dispatchEvent(event);
|
| 19 |
-
}}
|
| 20 |
-
insertText({len(st.session_state.messages)});
|
| 21 |
-
</script>
|
| 22 |
-
"""
|
| 23 |
-
st.components.v1.html(js)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|