Skip to main content

An SDK for managing prompts via github

Project description

Manage prompts via github

Usage

from promptSDK import prompts
print(prompts.my_folder.myprompt)
# this expects a repo with repo/my_folder/myprompt.md

When your code accesses a prompt it fetches that file from your prompt repo. This allows iterating on prompts while your server is running. Prompts are cached, so the SDK does not fetch from the web everytime you accesss a prompt. The default cache lifetime is 10 seconds for dev and 300 for production

Install

pip install promptSDK

Setup

Information on how to generate a token can be found here

If your prompt repo is public just leave the token empty. Required env variables (see env.sample) are

BASE_URL=https://github.com/username/repo
TOKEN=your_github_personal_access_token

Limitations

Currently only supports reading .md files in the prompt repo

Example Prompt Repo

https://github.com/ottozastrow/sample-prompts

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

promptsdk-0.1.3.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

promptsdk-0.1.3-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page