This is a LLM chatbot coded with LangChain. The web interface is coded with Streamlit. It implements a hybrid RAG (keyword and semantic search) and chat memory.
if st.button("Files and DB Info"):
load_files_and_embed(json_paths, pdf_paths, embed=False)
try:
file_path = './chromadb/chroma.sqlite3'
file_size = os.path.getsize(file_path)
file_size = file_size / 1024 # In KB
if file_size > 144:
st.write(f"DB size: {file_size} KB")
else:
st.write(f"DB size: {file_size} KB. DB is empty!")
path = './'
files = os.listdir(path)
st.write("Root path:")
st.write(files) ==================> nok: should be displayed?
path = './chromadb'
files = os.listdir(path)
st.write("DB path:")
st.write(files) ====================> ok: error if the chromadb dir does not exist
except Exception as e:
st.write("Error: Is the DB available?")
st.write(f"Error: {e}")