Python libraries for parsing and using PromptPacks.
This monorepo contains the following packages:
Base library for parsing PromptPack JSON files. No framework dependencies.
pip install promptpackfrom promptpack import PromptPack, parse_promptpack
# Parse from file
pack = parse_promptpack("path/to/pack.json")
# Access prompts
prompt = pack.prompts["support"]
print(prompt.system_template)
# Render template with variables
rendered = prompt.render({"role": "support agent", "company": "Acme"})LangChain integration for PromptPacks.
pip install promptpack-langchainfrom promptpack_langchain import PromptPackTemplate, convert_tools
# Create LangChain prompt template
template = PromptPackTemplate.from_promptpack(pack, "support")
# Convert tools to LangChain format
tools = convert_tools(pack)# Install development dependencies
pip install hatch
# Run tests
hatch run test
# Run tests with coverage
hatch run test-cov
# Lint and format
hatch run lint
hatch run format
# Type checking
hatch run typecheckApache License 2.0