Skip to content

iashchak/isekai

Isekai Project

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.

Features

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

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 the v1 dataset.
    • Parameters:
      • k: Number of selections per attribute (default: 3).
      • p_zero: Probability of excluding attributes (default: 0.4).
  • /api/v2/generate: Generates scenarios using the v2 dataset 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).

Example Usage

  1. Health Check

    curl http://localhost:8000/api/health
  2. Generate Scenarios (v1)

    curl -u user:password "http://localhost:8000/api/v1/generate?k=3&p_zero=0.4"
  3. Generate Scenarios (v2)

    curl -u user:password "http://localhost:8000/api/v2/generate?k=2&n=1&p_zero=0.3"

Installation

Prerequisites

  • Python 3.12+
  • Docker (optional)

Steps

  1. Clone the repository:

    git clone https://github.com/iashchak/isekai.git
    cd isekai
  2. Install dependencies:

    pip install -r requirements.txt
  3. Start the application:

    python main.py

Deployment

Using Docker

  1. Build the image:

    docker build -t isekai-app .
  2. Run the container:

    docker run -p 8080:8080 isekai-app

Contributing

See CONTRIBUTING.md for guidelines.


License

See LICENSE.md for details.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors