Skip to main content

A dynamic prompt building library with CLI support.

Project description

Prompter

A dynamic prompt building library for LLM applications. It allows you to define prompts in YAML, manage variables, tags, and inheritance, and build them dynamically at runtime.

Installation

Requires Python >= 3.12.

pip install prompt-config

Development Setup

python3.12 -m venv venv
source venv/bin/activate
pip install -e .

Usage

CLI

Initialize a new configuration:

promptcfg init

This creates a promptcfg.yaml file in your current directory.

Build a prompt from the CLI:

promptcfg build --tags python,web --vars user=Alice

Python API

from promptcfg.config import PromptConfig
from promptcfg.builder import PromptBuilder

# Load config
config = PromptConfig.load("promptcfg.yaml")

# Create builder
builder = PromptBuilder(config)

# Build prompt
prompt = builder.build(
    tags=["python", "web"], 
    variables={"user": "Alice"}
)

print(prompt)

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

prompt_config-0.1.4.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prompt_config-0.1.4-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file prompt_config-0.1.4.tar.gz.

File metadata

  • Download URL: prompt_config-0.1.4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for prompt_config-0.1.4.tar.gz
Algorithm Hash digest
SHA256 bbfe32bb9203dcebfce95d5eb5f00f91136eea6bc647fd28d8355bff0ade8b49
MD5 6680cea3baf5eb10031ba6ee70e2f36c
BLAKE2b-256 f55e695cb1a48ba481795bd30b27508ffefab69bdf189a3ab5f913e9a920be30

See more details on using hashes here.

File details

Details for the file prompt_config-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: prompt_config-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for prompt_config-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 23fb7af9218a7392f54e8b8d94d20004185d51f8b5524725cfd4bb8f14ea350c
MD5 4efd8689d7f4add40f97e25ef50eed50
BLAKE2b-256 ba60e9973441bc5da2cf14b571733d949ee4c2ea5b3957596a841c25064e7380

See more details on using hashes here.

Supported by

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