Examples Overview
This section contains practical examples demonstrating how to use PromptPack Python in real-world scenarios.
Available Examples
Section titled “Available Examples”Learn the fundamentals of loading PromptPacks, creating templates, and formatting prompts with variables and fragments.
Discover how to convert PromptPack tools to LangChain format, bind custom handlers, and use tools with agents.
Explore the validation system including banned words, length limits, and regex pattern matching.
Running the Examples
Section titled “Running the Examples”All examples are located in the examples/ directory of the repository. To run them:
# Clone the repositorygit clone https://github.com/AltairaLabs/promptpack-python.gitcd promptpack-python
# Install dependenciespip install -e packages/promptpackpip install -e packages/promptpack-langchain
# Run an examplepython examples/basic_usage.pypython examples/tools_example.pypython examples/validation_example.pyExample Packs
Section titled “Example Packs”The examples use PromptPack JSON files located in examples/packs/:
- customer-support.json - Customer support prompts with fragments, validators, and multiple prompt types
- sales-assistant.json - Sales assistant with CRM tools (customer lookup, inventory, orders)