Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,13 +9,18 @@ load_dotenv()
|
|
| 9 |
|
| 10 |
st.set_page_config(page_title="Customer Support AI", page_icon="🤖")
|
| 11 |
|
| 12 |
-
@st.cache_resource
|
| 13 |
-
def automated_ingestion():
|
| 14 |
-
run_ingestion()
|
| 15 |
|
| 16 |
-
# Run ingestion automatically on startup (cached)
|
| 17 |
with st.spinner("Updating knowledge base..."):
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
st.title("🤖 TechFlow Support Agent")
|
| 21 |
|
|
|
|
| 9 |
|
| 10 |
st.set_page_config(page_title="Customer Support AI", page_icon="🤖")
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
|
|
|
|
| 13 |
with st.spinner("Updating knowledge base..."):
|
| 14 |
+
try:
|
| 15 |
+
|
| 16 |
+
if not os.path.exists("./chroma_db"):
|
| 17 |
+
st.info("Vector database not found. Starting ingestion...")
|
| 18 |
+
run_ingestion()
|
| 19 |
+
st.success("Ingestion complete!")
|
| 20 |
+
else:
|
| 21 |
+
st.write("Database already exists.")
|
| 22 |
+
except Exception as e:
|
| 23 |
+
st.error(f"Ingestion failed: {e}")
|
| 24 |
|
| 25 |
st.title("🤖 TechFlow Support Agent")
|
| 26 |
|