calmgoose commited on
Commit
3ba989b
·
1 Parent(s): 7e76253

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -113,11 +113,14 @@ if "generated" not in st.session_state:
113
  if "past" not in st.session_state:
114
  st.session_state["past"] = []
115
 
 
 
 
116
 
117
- user_input = st.text_input("You: ", "Who are you?", key="input")
 
118
 
119
-
120
- if user_input:
121
 
122
  if os.environ["OPENAI_API_KEY"] is None:
123
  st.text("Paste your OpenAI API key to get started")
 
113
  if "past" not in st.session_state:
114
  st.session_state["past"] = []
115
 
116
+ def get_text():
117
+ user_input = st.text_input("You: ", "Who are you?", key="input")
118
+ return user_input
119
 
120
+ user_input = get_text()
121
+ ask = st.button("Ask")
122
 
123
+ if ask:
 
124
 
125
  if os.environ["OPENAI_API_KEY"] is None:
126
  st.text("Paste your OpenAI API key to get started")