-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
23 lines (19 loc) · 806 Bytes
/
app.py
File metadata and controls
23 lines (19 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
from main import get_response
st.set_page_config(page_title="Air India Assistant", layout="wide")
st.title("✈️ Air India Chat Assistant")
st.markdown("Ask any question about Air India based on the provided documents.")
st# Input field
question = st.text_input("Enter your question:")
# When the user submits a question
if st.button("Ask"):
if question.strip() == "":
st.warning("Please enter a question.")
else:
with st.spinner("Generating answer..."):
try:
result = get_response(question)
st.markdown("### 📄 Answer")
st.write(result['output']['message']['content'][0]['text'])
except Exception as e:
st.error(f"An error occurred: {e}")