Skip to content

Add Flask prompts-bot scaffold and prompts index - #15

Open
jasperphipps wants to merge 1 commit into
Exocija:mainfrom
jasperphipps:jasperphipps-musical-waddle
Open

Add Flask prompts-bot scaffold and prompts index#15
jasperphipps wants to merge 1 commit into
Exocija:mainfrom
jasperphipps:jasperphipps-musical-waddle

Conversation

@jasperphipps

Copy link
Copy Markdown

Why

Provide a lightweight HTTP API to browse and search the repository's prompts so the content library can be used as a local prompts-serving bot.

What it does

  • Adds a minimal Flask app under bot/ with endpoints:
    • GET /health
    • GET /prompts?q=&category=
    • GET /prompts/
  • Includes requirements.txt, PROMPTS_BOT_README.md (run instructions), .gitignore
  • Adds the generated zetalib_prompts_index.csv and zetalib_prompts_index.json used by the service

Approach

The Flask app loads zetalib_prompts_index.json at startup and performs simple substring searches over path, excerpt, and category. The /prompts/ endpoint returns the prompt file content for convenience. This is intentionally small and easy to run locally.

Notes and considerations

  • For production use: add pagination, input sanitization, rate limiting, authentication, and caching.
  • The index file is generated by tooling; re-run the indexer if prompts change.
  • Origin was not writable from this environment; the PR creation flow will create/push to an appropriate fork if required.

Testing

  1. python3 -m venv .venv && source .venv/bin/activate
  2. pip install -r requirements.txt
  3. export FLASK_APP=bot.app
  4. flask run --host=0.0.0.0 --port=5000
  5. Visit /prompts and /prompts?q=your+term

Adds a minimal Flask-based prompts API (bot) under bot/ with endpoints to list, search, and fetch prompt contents. Includes requirements and usage README. The app reads the generated zetalib_prompts_index.json to power search and browsing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant