Examples
Complete, runnable examples showing how to use PromptC for various tasks. Each example demonstrates different features and best practices.
Running Examples
All examples are available in the
examples/ directory. Run them with npx tsx examples/[name].tsName Extractor
Complete workflow: define schema → compile → save → use in production
ChainOfThoughtBootstrapFewShotexactMatchSaving/Loading
QA System
Build a question-answering system with Chain of Thought reasoning
ChainOfThoughtpartialMatchContext-based QA
Multi-Provider
Test the same program across different LLM providers
PredictProvider comparisonLatency benchmarking
Load Compiled
Load a previously compiled program from JSON for production use
loadCompiledProgramProduction deploymentVersion control
Ready to try it yourself? Open the Playground →