niddijoris commited on
Commit
2e59ed2
·
verified ·
1 Parent(s): d22e425

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
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
- automated_ingestion()
 
 
 
 
 
 
 
 
 
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