This is a Flask-based chatbot application that uses a GET request to the /query
endpoint to process user input and return a response.
The project has the following structure:
app/
: Contains the main application code.routes.py
: Defines the routes for the Flask application.index.py
: Contains the code for initializing the indexation of our data stored ./static/data. This script is responsible for the LLM and embeddings models + the indexationagent.py
: Contains the code for the agent that interacts with the OpenAI API and use our custom toolsstatic/
: Contains static files such as JavaScript and CSS files and pdf.media/
: Contains files that generated by the llm.data/
: Contains input files added by the uses.storage/
: Contains vector storage and other files created by the embeddings model at the indexation
templates/
: Contains HTML templates rendered by the Flask application.archives/
: Contains test and old version of the chatbot
config.py
: Contains the configuration class for the flask application.run.py
: Contains the code for running the Flask application.
- Clone the repository.
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
source venv/bin/activate
on Linux orvenv\Scripts\activate
on Windows - Install the required Python packages using pip:
pip install -r requirements.txt
- rename the example.env to .env
- Set the environment variables
OPENAI_API_KEY
andOPENAI_ORG_ID
. - Run the application:
flask run
- Enjoy ;-)
- Open a web browser and navigate to
http://localhost:8080
. - Enter a message in the input box and click the "Send" button. The message will be sent to the server and a response will be displayed in the chat window.
The first questions will take long as the application will first generate the vector store locally. Then after the indexation of the data, the chatbot will be able to answer questions based on the data provided by the user.
- On the right side of the chatbot, you can find a dropdown with all the current bpmn stored in you file system
- Select the BPMN diagram you want to display (if the diagram is correct it should be displaed)
- Ask the bot to generate a diagram by asking "Peux tu me générer tu générer le fichier xml de la procédure "Préparer les plats" en te basant sur la spécification BPMN 2.0 ?"
- The bot will generate the diagram and store it in the ./static/data folder
- If you refresh the page, you will see the new diagram in the dropdown
- "Connais tu Monsieur Paul Amiral ?"
- "Peux tu me numéroter les étapes du processus "Préparer les plats"
- "Connais tu la spécification BPMN 2.0 ? de l'OMG ?"
- "Peux tu me dire de quoi parle le chapitre 12.2 de "Spécification BPMN 2.0" ?"
- "Peux tu me générer un diagramm"