Skip to content

Goal of this project is to build RAG which is capable to create plots based on database's data

Notifications You must be signed in to change notification settings

lucasosiewicz/ReportsAreGenerated

Repository files navigation

ReportsAreGenerated

Aim of this project is to build a system capable to connect to any database and draw a figure based on the prompt.

How to run project:

  1. Install necesarry frameworks: pip install -r requirements.txt,
  2. Go to app directory: cd app,
  3. Run streamlit app: streamlit run app.py,
  4. Create .env file and add there Your OPENAI_API_KEY.

Contents:

  1. Adding database connection,
  2. Generating figures.

1. Adding database connection.

At the very beginning You'll see layout like below:

image

Reason of this is that You haven't added any database connection yet. To do this, go to Add new database tab. After that You'll see a form which You have to complete with appropriate data. General shape of form may be diffrent for each DBMS. It is caused of the diffrent ways to connect with this systems. After clicking button Add database app will create new directory in existing/, then creates .env file which contains all db connection details.

Oracle SQL Server.

Form to add Oracle DB connection looks like below:

image

To propertly run configuration You have to add sqlplus to global PATH variables. Form allows You to connect with database by SID and Service Name.

Microsoft SQL Server.

image

First of all, You have to download ODBC Driver. Except that you have to download extension for SQL Server:

Install-Module -Name SqlServer`

PostgreSQL, MySQL.

image

Form for both DBMSs are the same. If You're using PostgreSQL add pg_dump to global PATH variables. Otherwise add mysqkdump to PATH global variables.

To show an example I'll use dvdrental sample database. Making connection showed below:

image

2. Generating figures.

Go back to Chat tab and refresh the page. Now You should see available connections:

image

Now in text field You have to provide sentence what plot You want to see. In my example I'm gonna plot a pie chart of amount of films in each category. Results showed below:

image

About

Goal of this project is to build RAG which is capable to create plots based on database's data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published