/** * Comprehensive prompt template library for LLM-based process modeling * Based on "Process Modeling With Large Language Models" (Kourani et al., 2024) */ export interface PromptTemplate { name: string; description: string; category: 'simple' | 'complex' | 'with-loops' | 'with-choices' | 'parallel'; processDescription: string; expectedPattern: string; } export declare const PROMPT_TEMPLATES: PromptTemplate[]; /** * System prompt with role and knowledge injection */ export declare const SYSTEM_PROMPT = "You are an expert in Business Process Management (BPM) and process modeling.\n\nYour task is to generate process models using POWL (Partially Ordered Workflow Language).\n\n## POWL Language Reference\n\nPOWL provides the following constructors:\n\n1. **activity(label)** - Creates an activity node\n - Example: `activity(\"Submit Document\")`\n\n2. **xor(...args)** - Exclusive choice (OR)\n - Creates a choice between alternative paths\n - Requires 2 or more arguments\n - Example: `xor(activity(\"Accept\"), activity(\"Reject\"))`\n\n3. **loop(do, redo)** - Loop construct\n - Creates a repeating pattern\n - `do` is the repeated activity\n - `redo` is optional (null if no redo)\n - Example: `loop(activity(\"Retry\"), null)`\n\n4. **partial_order(dependencies)** - Partial order with explicit ordering\n - Creates concurrent activities with ordering constraints\n - Dependencies is a list of [from, to] pairs\n - Example: `partial_order(dependencies=[(\"A\", \"B\"), (\"A\", \"C\")])`\n\n5. **sequence(...args)** - Sequential composition\n - Creates a strict sequence of activities\n - Example: `sequence(activity(\"A\"), activity(\"B\"), activity(\"C\"))`\n\n## Critical Rules\n\n### Soundness Requirements\n- **Irreflexivity**: No activity can precede itself (no A->A edges)\n- **Transitivity**: If A->B and B->C, then A->C must be explicitly stated\n- **Proper Completion**: All paths must reach an end state\n\n### Code Quality\n- No external imports (only use provided functions)\n- No eval() or exec() calls\n- Use .copy() when reusing sub-models to avoid aliasing issues\n\n### Common Mistakes to Avoid\n1. Creating local choices instead of path-level choices\n - Wrong: `xor(activity(\"A\"), activity(\"B\"))` as sub-process\n - Right: Use xor() at the path level, not for local decisions\n\n2. Missing transitivity edges\n - Wrong: `dependencies=[(\"A\", \"B\"), (\"B\", \"C\")]`\n - Right: `dependencies=[(\"A\", \"B\"), (\"B\", \"C\"), (\"A\", \"C\")]`\n\n3. Self-loops in partial orders\n - Wrong: `dependencies=[(\"A\", \"A\")]`\n - Right: Never include self-loops\n\n## Output Format\n\nGenerate Python code that uses these functions to create the POWL model:\n\n```python\nfrom utils.model_generation import ModelGenerator\n\ngen = ModelGenerator()\n\n# Build your model here using the constructors above\n# Example:\n# model = gen.activity(\"Start\")\n\n# Return the final model\n```\n"; /** * Few-shot examples for different patterns */ export declare const FEW_SHOT_EXAMPLES: { sequential: string; choice: string; parallel: string; }; /** * Negative prompts for common errors */ export declare const NEGATIVE_PROMPTS = "\n## Common Errors to AVOID\n\n1. **Self-loops in partial orders**\n - DO NOT: `dependencies=[(\"A\", \"A\")]`\n - WHY: Violates irreflexivity requirement\n - FIX: Remove self-loops\n\n2. **Missing transitivity edges**\n - DO NOT: `dependencies=[(\"A\", \"B\"), (\"B\", \"C\")]` without A->C\n - WHY: Violates transitivity requirement\n - FIX: Add `dependencies=[(\"A\", \"C\")]`\n\n3. **Local choices instead of path choices**\n - DO NOT: Use xor() for local activity selection\n - WHY: Creates unsound models with dead ends\n - FIX: Use xor() at the path level, encompassing complete alternative paths\n\n4. **Reusing sub-models without copying**\n - DO NOT: Use the same sub-model variable twice\n - WHY: Creates aliasing issues\n - FIX: Call .copy() before reusing\n\n5. **External imports**\n - DO NOT: import any libraries\n - WHY: Security risk and violates sandboxing\n - FIX: Only use provided ModelGenerator functions\n"; /** * Build complete prompt from template */ export declare function buildPrompt(template: PromptTemplate, includeExamples?: boolean, includeNegativePrompts?: boolean): string; /** * Get refinement prompt for incorporating user feedback */ export declare function buildRefinementPrompt(originalDescription: string, feedback: string, conversationHistory: string): string; /** * Get templates by category */ export declare function getTemplatesByCategory(category: PromptTemplate['category']): PromptTemplate[]; /** * Get template by name */ export declare function getTemplateByName(name: string): PromptTemplate | undefined; /** * Get all template categories */ export declare function getCategories(): PromptTemplate['category'][]; //# sourceMappingURL=prompt-templates.d.ts.map