This project is designed to manage a collection of Prompt templates for multiple versions, scenarios, and applicable models. It is developed based on Python and Flask framework, providing a set of RESTful APIs and an admin backend for operations such as creating, retrieving, updating, and deleting Prompt templates.
- Python
- Flask
- MongoDB (using MongoEngine as ODM)
- Install Python3 and MongoDB
- Clone the project code
git clone https://github.com/worldwonderer/promptdoc.git
- Install project dependencies
pip install -r requirements.txt
- Configure environment variables
Generate Google Authenticator App QR code and secret for the admin backend
export MONGODB_HOST=<mongodb://> export SECRET_KEY=<flask secret>
python tool.py export ADMIN_SECRET=<admin secret> export AUTH_SECRET=<api secret>
- Run Flask application
python debug.py
Login Page: http://127.0.0.1:5000/admin/login
By default, dynamic verification code authentication is enabled. You need to open the Google Authenticator App, scan the QR code in admin_auth.png
, and then enter the dynamic password to log in.
List Page: http://127.0.0.1:5000/admin/prompts
curl --location 'http://127.0.0.1:5000/api/prompts' \
--header 'Authorization: Bearer {AUTH_SECRET}'
For complete API examples, please refer to .\tests\test_api.py
.
Contributions to the Prompt Doc project are welcome! If you find any issues or have suggestions for improvement, please submit an Issue or Pull Request on GitHub.
The Prompt Doc project is licensed under the MIT License. For more information, please refer to the LICENSE file.
If you have any questions or suggestions, feel free to contact me via the following channels: Email: xtchen.pitt@gmail.com