Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,13 +10,18 @@ query = st.text_input('Enter your query', type='default')
|
|
| 10 |
|
| 11 |
submit = st.button('Submit')
|
| 12 |
|
| 13 |
-
st.write(openai_key)
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
if submit:
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
|
|
|
|
| 10 |
|
| 11 |
submit = st.button('Submit')
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
if submit:
|
| 15 |
+
if query and openai_key:
|
| 16 |
+
try:
|
| 17 |
+
with st.spinner('Processing your query...'):
|
| 18 |
+
response = yg_assistant(openai_key,query)
|
| 19 |
+
st.write(response)
|
| 20 |
+
except Exception as e:
|
| 21 |
+
st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
|
| 22 |
+
else:
|
| 23 |
+
st.error('Please enter your OpenAI key and Query both!',icon="🚨")
|
| 24 |
+
|
| 25 |
|
| 26 |
|
| 27 |
|