This is a streamlit app for analyzing Mpesa Statements using Langchain Pandas AI Agent. You can read more about it here.
- pandas_agent.py - contains the class that instantiates the AI agent.
- pdf_processor.py - contains the class that extracts tables from the pdf and joins them using the Tabula library.
- text_preprocessing.py - contains code to preprocess the tables extracted.
- app.py - contains code to execute the streamlit app.
- Clone the repository
git clone https://github.com/KevKibe/Analyzing-Mpesa-Statements-using-Langchain-Pandas-Agent.git
- Install requirements
pip install -r requirements.txt
- Run the command
streamlit run app.py
to launch the app on localhost.
- Enter your OpenAI API Key in the sidebar.
- Upload your M-Pesa Statement.
- Enter a query in the provided text area and click the "generate" button.
- Solutions to common errors.
jpype._jvmfinder.JVMNotFoundException: No JVM shared library file (libjvm.so) found. Try setting up the JAVA_HOME environment variable properly.
- means you do not have Java Virtual Machine installed in your environment, download it from this site and install.Retrying langchain.llms.openai.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for text-davinci-003 in organization org-X7JScsPiE6OYrh68GPSZOkVJ on requests per min. Limit: 3 / min. Please try again in 20s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method..
- means your agent has exceeded rate limit of 3 calls/min to the OpenAI API and you need to setup a payment method to increase rate limit.