slimshadow commited on
Commit
0e52e66
·
verified ·
1 Parent(s): 5e5d24f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -33,7 +33,9 @@ if 'responses' not in st.session_state:
33
  st.title('SlimshadowGPT')
34
  st.write("This is a simple interface to interact with the GPT-3.5 API.")
35
 
36
- user_input = st.text_input("Enter your message:", key='user_input')
 
 
37
 
38
  if st.button('Send'):
39
  if user_input:
@@ -49,7 +51,7 @@ if st.button('Send'):
49
  st.write("Failed to get a response from the API.")
50
 
51
  # Clear input box after sending
52
- st.session_state.user_input = ""
53
 
54
  # Display the conversation history
55
  st.write("### Chat History")
 
33
  st.title('SlimshadowGPT')
34
  st.write("This is a simple interface to interact with the GPT-3.5 API.")
35
 
36
+ # Placeholder for user input
37
+ input_placeholder = st.empty()
38
+ user_input = input_placeholder.text_input("Enter your message:")
39
 
40
  if st.button('Send'):
41
  if user_input:
 
51
  st.write("Failed to get a response from the API.")
52
 
53
  # Clear input box after sending
54
+ input_placeholder.text_input("Enter your message:", value="", key="user_input_clear")
55
 
56
  # Display the conversation history
57
  st.write("### Chat History")