Skip to content

VictorHueni/process-analyst-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Chatbot Application

This is a Flask-based chatbot application that uses a GET request to the /query endpoint to process user input and return a response.

Project Structure

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 indexation
    • agent.py: Contains the code for the agent that interacts with the OpenAI API and use our custom tools
    • static/: 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.

Setup

  1. Clone the repository.
  2. Create a virtual environment: python -m venv venv
  3. Activate the virtual environment: source venv/bin/activate on Linux or venv\Scripts\activate on Windows
  4. Install the required Python packages using pip: pip install -r requirements.txt
  5. rename the example.env to .env
  6. Set the environment variables OPENAI_API_KEY and OPENAI_ORG_ID.
  7. Run the application: flask run
  8. Enjoy ;-)

Features

Chat Usage

  1. Open a web browser and navigate to https://localhost:8080.
  2. 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.

BPMN Diagram Display

  1. On the right side of the chatbot, you can find a dropdown with all the current bpmn stored in you file system
  2. Select the BPMN diagram you want to display (if the diagram is correct it should be displaed)

BPMN Diagram Generation

  1. 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 ?"
  2. The bot will generate the diagram and store it in the ./static/data folder
  3. If you refresh the page, you will see the new diagram in the dropdown

Prompt Examples (FR)

  • "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"

Contributing

License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published