Welcome to the Isekai project! This repository is a FastAPI-based backend designed for generating randomized "isekai" scenarios. It leverages datasets and algorithms to create imaginative settings, characters, and attributes.
- Dynamic API Endpoints: Versioned API endpoints (
v1,v2) for generating scenarios. - Customizable Data: Scenarios are generated from CSV datasets, making it easy to expand or customize.
- Authentication: Basic HTTP authentication for API endpoints.
/api/health: Returns the health status of the server./api/privacy: Displays the privacy agreement in plain text./api/v1/generate: Generates random isekai scenarios using thev1dataset.- Parameters:
k: Number of selections per attribute (default: 3).p_zero: Probability of excluding attributes (default: 0.4).
- Parameters:
/api/v2/generate: Generates scenarios using thev2dataset with metadata-driven selection logic.- Parameters:
k: Scaling factor for selections (default: 1).n: Number of items to select per attribute (default: 1).p_zero: Probability of excluding attributes (default: 0.4).
- Parameters:
-
Health Check
curl http://localhost:8000/api/health
-
Generate Scenarios (v1)
curl -u user:password "http://localhost:8000/api/v1/generate?k=3&p_zero=0.4" -
Generate Scenarios (v2)
curl -u user:password "http://localhost:8000/api/v2/generate?k=2&n=1&p_zero=0.3"
- Python 3.12+
- Docker (optional)
-
Clone the repository:
git clone https://github.com/iashchak/isekai.git cd isekai -
Install dependencies:
pip install -r requirements.txt
-
Start the application:
python main.py
-
Build the image:
docker build -t isekai-app . -
Run the container:
docker run -p 8080:8080 isekai-app
See CONTRIBUTING.md for guidelines.
See LICENSE.md for details.