Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prompt-builder

Part of the GENIA Americas AI Toolkit — repo #8. Reusable prompt templates with variable substitution, used across the other tools day-to-day.

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Run

uvicorn app.main:app --reload

Docs at http://127.0.0.1:8000/docs

Test

pytest tests/ -v

7/7 tests pass as of last verified run.

Auth

Reads and rendering are open (GET /prompts, GET /prompts/{id}, POST /prompts/{id}/render) — this is a shared template library other tools consult freely, and rendering is pure compute with no database mutation. POST /prompts (creating a template) requires an X-Admin-Key header, configured via the ADMIN_API_KEYS env var as a comma-separated list of valid keys — otherwise any anonymous caller on the public internet could pollute the shared library with junk or malicious templates.

API

  • POST /prompts — create a template with {variable} placeholders. Requires X-Admin-Key.
  • GET /prompts — list all. Open.
  • GET /prompts/{id} — retrieve one. Open.
  • POST /prompts/{id}/render — fill in values; any variable you didn't supply comes back in missing_variables and stays as {literal} text in the rendered output, rather than raising an error. Open.
  • GET /health

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages