A specialized chatbot for the window manufacturing industry, built with FastAPI and Groq's LLM API.
Key features:
- FastAPI backend for API handling
- LangChain integration for LLM interactions
- Groq's LLM API for responses
- Conversation context management
- Simple web interface
- Dockerized setup for easy deployment
-
app/: Contains the core application code.
- api/: Handles API endpoints.
- models/: Defines data models.
- services/: Contains business logic and services.
- utils/: Utility functions and helpers.
- main.py: Entry point of the application.
-
tests/: Holds test cases.
-
docs/: Documentation files.
-
webapp/: Web application components.
- templates/: HTML templates for the web interface.
- app.py: Main file for the web application.
-
Clone the repository:
git clone https://github.com/gedasv/windows-chatbot.git
cd windows-chatbot
-
Set up the environment variables: Create a .env file in the root directory with the following content:
GROQ_API_KEY=[groq_key_here]
MODEL_NAME=llama3-8b-8192
-
Build and run the Docker containers:
docker-compose up --build
This will start both the backend API server and the web application.
You should be able to accesss the web interface in http://127.0.0.1:5000/
in your browser.
To run the services separately for development, create a separate Python env,
install requirements.txt
in both app and webapp, and then:
-
Start the backend:
uvicorn app.main:app --host 0.0.0.0 --port 8000
-
In a separate terminal, start the web application:
python webapp/app.py
- POST /api/chat: Send a message to the chatbot
- GET /api/conversation: Retrieve the current conversation history with context
- POST /api/clear: Clear the current conversation history
There is also a little testing suite. You can run the tests using pytest (when in root folder):
pytest tests
You can view the full HTML documentation online at https://gedasv.github.io/windows-chatbot/