Giter Club home page Giter Club logo

rappel-conso-chat-app's Introduction

Rappel conso chat application

In this project, we create a GPT based chatbot that interacts with a complex database using Langchain agents and tools. The chat application is deployed using Streamlit.

The data is provided by the RappelConso API, a French public service that shares information about product recalls in France.

For a step by step guide on how to run the application and to understand the concepts behind the chatbot, you can check the article I made about this project: https://medium.com/@hamzagharbi_19502/building-a-chat-application-with-langchain-llms-and-streamlit-for-complex-sql-database-7433245079f3

Demo video

Here is a demo video about some example interactions that we can do with the chatbot:

Watch the video

Quick run

If you are in a hurry, you can run the application in a few steps.

First clone the github repo with the following command:

git clone https://github.com/HamzaG737/rappel-conso-chat-app.git

Next, you can navigate to the project root and install the packages requirements:

pip install -r requirements.txt

Then you need to setup the Postgres database. In a previous project, I covered how to set up a data pipeline for streaming data from a source API directly into a Postgres database.

However, if you want a simpler solution, I created a script that allows you to transfer all the data from the API straight to Postgres, bypassing the need to set up the entire pipeline.

First off, you need to install Docker. Next, get the Postgres server running with the docker-compose yaml file at the project's root:

docker-compose -f docker-compose-postgres.yaml up -d

After that, the script database/stream_data.py helps you create the rappel_conso_table table, stream the data from the API into the database, and do a quick check on the data by counting the rows. As of February 2024, you should see around 10400 rows, so expect a number close to that.

To run the script, use this command:

python database/stream_data.py

Please note that the data transfer might take around one minute, possibly a little longer, depending on the speed of your internet connection.

Next you need to set your OPENAI_API_KEY as environment variable.

After that everything is set to start the chat application. For that, you can execute the following command:

streamlit run streamlit_app/app.py

rappel-conso-chat-app's People

Contributors

hamzag737 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.