Upload app.py with huggingface_hub
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
######################## WRITE YOUR CODE HERE #########################
|
3 |
+
import streamlit as st
|
4 |
+
#import agentic_rag
|
5 |
+
|
6 |
+
st.set_page_config(page_title="Nutribot - Your Nutrition Assistant", layout="centered")
|
7 |
+
|
8 |
+
st.title("Nutribot")
|
9 |
+
st.subheader("Personalized, intelligent nutrition guidance")
|
10 |
+
|
11 |
+
st.markdown("""
|
12 |
+
Ask me anything related to nutrition, diet, or healthy eating!
|
13 |
+
Examples:
|
14 |
+
- *What is a good high-protein vegetarian lunch under 400 calories?*
|
15 |
+
- *Suggest a low-carb dinner that’s rich in fiber.*
|
16 |
+
""")
|
17 |
+
|
18 |
+
query = st.text_area("Enter your question", height=100, placeholder="e.g., Suggest meals for iron deficiency")
|
19 |
+
|
20 |
+
if st.button("Ask Nutribot") and query.strip():
|
21 |
+
with st.spinner("Thinking..."):
|
22 |
+
#result = agentic_rag.invoke(query)
|
23 |
+
result = nutrition_disorder_agent() #review this and the line of code above it before finalizing the program
|
24 |
+
st.success("Here’s what I found:")
|
25 |
+
st.markdown(f"**Response:** {result.get('response', 'Sorry, I couldn’t generate a response.')}")
|
26 |
+
|
27 |
+
elif query.strip() == "":
|
28 |
+
st.info("Please enter a question to get started.")
|