pai AI & Intelligence
ai-prompts
Prompt template library for PascalAI. Load .prompt files, render with variables, compose chains, create few-shot examples, and define system prompts.
Install ppm install ai-prompts
Usage Example
uses ai_prompts; // Load a prompt template from file var p := LoadPrompt('prompts/classify.prompt'); // Render with variables var vars := Dictionary(); vars['input'] := 'This is a product review'; vars['categories'] := 'positive, negative, neutral'; var rendered := RenderPrompt(p, vars); // Use in LLM call var result := LLM.Complete(rendered); // Few-shot example var fewshot := FewShot([ ('Input: apple', 'Category: fruit'), ('Input: chair', 'Category: furniture'), ], 'Input: laptop'); // System prompt + chain var sys := SystemPrompt('You are a helpful assistant.'); var full := ChainPrompts([sys, fewshot]);
Features
LoadPrompt: load .prompt template files from disk
RenderPrompt: fill template variables before sending
ChainPrompts: compose multiple prompts in sequence
FewShot: build few-shot learning examples
SystemPrompt: create a formatted system message
VersionedPrompt: load a specific prompt version
Compatible with all PascalAI LLM providers
← Back to Package Index