Bedlessbot-API is an API that handles all machine-learning related stuff for Bedlessbot
- Clone the repository:
git clone https://github.com/MesterMan03/Bedlessbot-API.git
cd Bedlessbot-API- Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install the required packages:
pip install -r requirements.txt- Configure the secret:
You need to create a secret file of arbitrary data represented as hex which the clients will have to provide in the Authorization header. You can use the following command to generate a random secret:
python -c "import secrets; print(secrets.token_hex(64))"This will generate a 64-byte hex string which you can use as the secret. Save this string in a file named secret in the root directory of the project. You may use more or less bytes as needed.
- Start the API:
python main.py- API Endpoints:
- POST
/: The main endpoint for the API. This endpoint requires theAuthorizationheader with the secret as the value. The body is expected to be a JSON object with the following keys:text?: When this is provided, a sentence transformer will be executed on the text and the result will be returned. The training file isqa_pairs.txt.
- POST
Contributions are welcome! If you find any issues or have suggestions, feel free to open an issue or submit a pull request.