tykimos commited on
Commit
dc871e4
Β·
1 Parent(s): 2fe06f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -2,18 +2,19 @@ import openai
2
  import streamlit as st
3
  from streamlit_pills import pills
4
 
5
- openai.api_key = st.secrets['api_secret']
6
-
7
  st.subheader("AI Assistant : Streamlit + OpenAI: `stream` *argument*")
8
 
9
  # You can also use radio buttons instead
10
  selected = pills("", ["NO Streaming", "Streaming"], ["🎈", "🌈"])
11
 
12
  user_input = st.text_input("You: ",placeholder = "Ask me anything ...", key="input")
 
13
 
14
  if st.button("Submit", type="primary"):
15
  st.markdown("----")
16
  res_box = st.empty()
 
 
17
 
18
  if selected == "Streaming":
19
  report = []
 
2
  import streamlit as st
3
  from streamlit_pills import pills
4
 
 
 
5
  st.subheader("AI Assistant : Streamlit + OpenAI: `stream` *argument*")
6
 
7
  # You can also use radio buttons instead
8
  selected = pills("", ["NO Streaming", "Streaming"], ["🎈", "🌈"])
9
 
10
  user_input = st.text_input("You: ",placeholder = "Ask me anything ...", key="input")
11
+ api_key = st.text_input("api_key: ",placeholder = "api_key ...", key="api_key")
12
 
13
  if st.button("Submit", type="primary"):
14
  st.markdown("----")
15
  res_box = st.empty()
16
+
17
+ openai.api_key = api_key
18
 
19
  if selected == "Streaming":
20
  report = []