rmscript-demo / backend /README.md
dlouapre's picture
dlouapre HF Staff
First commit
65da30d
|
Raw
History Blame Contribute Delete
879 Bytes

RMScript Web Demo - Backend

FastAPI backend for compiling and validating rmscript code.

Installation

# Install dependencies with uv
uv sync

Running

uv run python app.py

Or with uvicorn directly:

uv run uvicorn app:app --reload --port 8001

The API will be available at http://localhost:8001

API Endpoints

  • GET / - API information
  • POST /api/verify - Verify rmscript syntax (returns errors/warnings)
  • POST /api/compile - Compile rmscript to IR (returns IR actions)

Example Usage

# Verify a script
curl -X POST http://localhost:8001/api/verify \
  -H "Content-Type: application/json" \
  -d '{"source": "look left\nwait 1s\nlook right"}'

# Compile a script
curl -X POST http://localhost:8001/api/compile \
  -H "Content-Type: application/json" \
  -d '{"source": "look left\nwait 1s\nlook right"}'