File size: 1,065 Bytes
a53de33
2ad9e08
a53de33
4592249
 
88cd75c
4592249
 
 
 
 
 
a53de33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4592249
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
import streamlit as st
from ai_assistant import ai_doctor

# Create layout with columns
left_column, _ = st.beta_columns([1, 4])

# Display image in the left column
left_column.image("ai_doctor_img.jpg", caption="Your AI Doctor Image", width=200)

# Display title in the right column
right_column = left_column.empty()  # Create an empty space in the left column
right_column.markdown("<h1 style='text-align: center;'>Your AI Doctor &#129302;</h1>", unsafe_allow_html=True)

# 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 = mh_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="🚨")