Spaces:
Sleeping
Sleeping
Commit
•
17ab3e0
1
Parent(s):
23cf2d7
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,8 @@ import openai
|
|
13 |
load_dotenv()
|
14 |
|
15 |
# Set OpenAI API key
|
16 |
-
openai.api_key = os.environ
|
|
|
17 |
# Define the storage directory
|
18 |
PERSIST_DIR = "./storage"
|
19 |
|
@@ -60,8 +61,12 @@ for message in st.session_state.messages:
|
|
60 |
st.markdown(message["content"])
|
61 |
|
62 |
# Get user input
|
|
|
|
|
63 |
if user_input := st.chat_input("Describe your symptoms or ask a medical question:"):
|
64 |
# Add user message to chat history
|
|
|
|
|
65 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
66 |
with st.chat_message("user"):
|
67 |
st.markdown(user_input)
|
|
|
13 |
load_dotenv()
|
14 |
|
15 |
# Set OpenAI API key
|
16 |
+
openai.api_key = os.environ("OPENAI_API_KEY")
|
17 |
+
|
18 |
# Define the storage directory
|
19 |
PERSIST_DIR = "./storage"
|
20 |
|
|
|
61 |
st.markdown(message["content"])
|
62 |
|
63 |
# Get user input
|
64 |
+
user_query_prefix = "Suggest all possible diagnosis, remedies and medicines for symptoms combining "
|
65 |
+
|
66 |
if user_input := st.chat_input("Describe your symptoms or ask a medical question:"):
|
67 |
# Add user message to chat history
|
68 |
+
user_input += user_query_prefix
|
69 |
+
|
70 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
71 |
with st.chat_message("user"):
|
72 |
st.markdown(user_input)
|