Spaces:
Runtime error
Runtime error
File size: 737 Bytes
2e88969 c97cf9e 2cbe032 2e88969 1037a0b 2e88969 5b16fd0 3af5c68 2e88969 7dc6762 7d24120 14db7ff 3211a34 c97cf9e 26cc192 af481ed | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #use this code
import streamlit as st
from ns_updyoga import yg_assistant
st.title('Yogic Health Assistant :man_in_lotus_position:')
# Create a text input box for the OpenAI key
openai_key = st.text_input('Enter your OpenAI Key', type='password')
query = st.text_input('Enter your query', type='default')
submit = st.button('Submit')
if submit:
if query and openai_key:
try:
with st.spinner('Processing your query...'):
response = yg_assistant(openai_key,query)
st.write(response)
except Exception as e:
st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
else:
st.error('Please enter your OpenAI key and Query both!',icon="🚨")
|