Update app.py
Browse files
app.py
CHANGED
@@ -178,7 +178,8 @@ if ask:
|
|
178 |
st.write(f"**{BOOK_NAME}:** got {dice}, lucky you!")
|
179 |
|
180 |
# openai.api_key = api_key_
|
181 |
-
os.environ["OPENAI_API_KEY"] = api_key_
|
|
|
182 |
if not api_key_:
|
183 |
st.write(f"**{BOOK_NAME}:** got {dice}, no luck, try again?")
|
184 |
st.stop()
|
@@ -194,7 +195,7 @@ if ask:
|
|
194 |
|
195 |
with st.spinner(msg):
|
196 |
try:
|
197 |
-
answer, pages, extract = get_answer(question=user_input, openai_api_key=
|
198 |
logger.info(f"answer: {answer}")
|
199 |
except Exception as exc:
|
200 |
logger.error(exc)
|
|
|
178 |
st.write(f"**{BOOK_NAME}:** got {dice}, lucky you!")
|
179 |
|
180 |
# openai.api_key = api_key_
|
181 |
+
# os.environ["OPENAI_API_KEY"] = api_key_
|
182 |
+
|
183 |
if not api_key_:
|
184 |
st.write(f"**{BOOK_NAME}:** got {dice}, no luck, try again?")
|
185 |
st.stop()
|
|
|
195 |
|
196 |
with st.spinner(msg):
|
197 |
try:
|
198 |
+
answer, pages, extract = get_answer(question=user_input, openai_api_key=api_key_)
|
199 |
logger.info(f"answer: {answer}")
|
200 |
except Exception as exc:
|
201 |
logger.error(exc)
|