An open API service indexing awesome lists of open source software.

https://github.com/gkamboj/finance-gpt

Streamlit based Gen AI chatbot that allows users to get answers to queries related to financial documents.
https://github.com/gkamboj/finance-gpt

analytics cloud-foundry csv-files genai-chatbot langchain openai python rag sap-btp streamlit text-embedding

Last synced: 8 months ago
JSON representation

Streamlit based Gen AI chatbot that allows users to get answers to queries related to financial documents.

Awesome Lists containing this project

README

          

# finance-gpt

Finance GPT is a generative AI chatbot built on [Streamlit](https://streamlit.io/) that effectively addresses user queries by utilizing a vector-based document database. It allows users to get answers to queries related to any financial documents such as annual reports of listed companies or CSV/Excel of their financial figures. By employing the Retrieval-Augmented Generation (RAG) framework, uploaded document serve as context for generating responses through a large language model (LLM) using [LangChain](https://www.langchain.com/).

## Table of Contents
- [Setup Instructions](#setup-instructions)
- [Usage](#usage)
- [Screenshots](#screenshots)
- [Customizations](#customizations)
- [Deployment](#deployment)
- [Contributing](#contributing)
- [License](#license)

## Setup Instructions

After cloning the repository, follow these steps to set up the project:

1. **Set Up your development environment**:
- Download and install JetBrains PyCharm IDE or your preferred IDE.
- The following instructions will focus on PyCharm, but most IDEs provide similar features.

2. **Open the project**:
- In PyCharm, navigate to `File -> Open` and select the cloned repository folder.

3. **Set Up a local virtual environment**:
- Go to `Settings` > `Project: finance-gpt` > `Python Interpreter` > `Add Interpreter`.
- Choose `Add Local Interpreter` > `Virtualenv Environment`.
1. Select `Environment` -> `New`.
2. Set `Base Interpreter` to your installed Python version (e.g., Python 3.x).
3. Click `OK`.

4. **Install dependencies**:
- Run the following commands in your terminal:
```bash
pip install "generative-ai-hub-sdk[all]==1.2.2" --extra-index-url https://int.repositories.cloud.sap/artifactory/api/pypi/proxy-deploy-releases-hyperspace-pypi/simple/
pip install -r requirements.txt
```
- If you prefer to connect directly to the LLM via OpenAI instead of using the SAP proxy, you can skip the installation of `generative-ai-hub-sdk` and install required LangChain libraries instead.

5. **Run the application**:
```bash
streamlit run finance-gpt.py
```

6. **Access the user interface**:
Open your web browser and navigate to [http://localhost:8500/](http://localhost:8500/) (or the appropriate port if different).

## Usage
Once the application is running, you can interact with finance-gpt by uploading your file and entering your in the selected interface. The chatbot will retrieve relevant information from the document and generate responses based on the context.

## Screenshots
Here are some screenshots showcasing working deployments of the application.
- Chat inteerface selection:
1-interaction-types

- _PDF_ interaction type:
2-pdf-1

3-pdf-2

- _EXCEL_ interaction type:
4-csv-line

5-csv-bar

## Customizations
You can easily customize the application in the following ways:
- Financial documents are just a use case for the RAG, same application can be generalised to query any kind of PDFs and CSVs.
- Modify the `properties.yml` file to adjust various flags and properties (e.g., enabling calls to the LLM without context if call with context does not give relevant response) to suit your requirements.

## Deployment
Here are a few options for deploying the application:
- [Streamlit Community Cloud](https://share.streamlit.io/deploy)
- Cloud Foundry: Relevant files for deployment through SAP BTP are included in the repository.

## Contributing
We welcome contributions to enhance finance-gpt! Please fork the repository and submit a pull request for any new features or bug fixes.

## License
This project is licensed under the MIT License. See the LICENSE file for more details.