/** * LLM Prompting Framework for POWL Model Generation * * Implementation of prompting strategies from: * "Process Modeling With Large Language Models" (Kourani et al., 2024) * * Four key strategies: * 1. Role Prompting - Assign LLM the role of process modeling expert * 2. Knowledge Injection - Provide POWL language knowledge * 3. Few-Shot Learning - Provide input/output examples * 4. Negative Prompting - Specify what to avoid */ /** * Message format for LLM conversation history */ export interface LLMMessage { role: "system" | "user" | "assistant"; content: string; } /** * Prompt templates for LLM-based POWL generation */ export declare const PROMPT_TEMPLATES: { /** * System prompt combining role assignment + knowledge injection * * Strategy 1 (Role) + Strategy 2 (Knowledge Injection) */ SYSTEM_PROMPT: string; /** * Few-shot examples from the Kourani et al. paper * * Strategy 3: Few-Shot Learning */ EXAMPLES: string; /** * Negative prompting - common errors to avoid * * Strategy 4: Negative Prompting */ COMMON_ERRORS: string; /** * Generate a complete prompt for process model generation * * @param processDescription Natural language description of the process * @param conversationHistory Previous messages in the conversation (for error refinement) * @returns Complete prompt as a user message */ generatePrompt(processDescription: string, conversationHistory?: LLMMessage[]): string; /** * Generate error refinement prompt * * @param error The error message or validation failure * @param conversationHistory Full conversation history * @returns Refinement prompt message */ ERROR_REFINEMENT(error: string, conversationHistory: LLMMessage[]): string; /** * Generate validation feedback prompt * * @param validationResult Result from POWL validation * @param modelCode The generated model code * @returns Feedback prompt */ VALIDATION_FEEDBACK(validationResult: { isValid: boolean; errors: string[]; warnings: string[]; }): string; /** * Extract model code from LLM response * * @param response The raw LLM response text * @returns Extracted Python code or null if not found */ extractModelCode(response: string): string | null; }; /** * Process model generation request */ export interface ModelGenerationRequest { processDescription: string; conversationHistory?: LLMMessage[]; } /** * Process model generation response */ export interface ModelGenerationResponse { modelCode: string | null; rawResponse: string; conversationHistory: LLMMessage[]; } /** * Main interface for LLM-based POWL generation */ export declare class LLMPowLGenerator { private conversationHistory; constructor(); /** * Generate a prompt for the given process description */ generatePrompt(processDescription: string): string; /** * Handle an error and generate refinement prompt */ handleError(error: string): string; /** * Process LLM response and extract model code * * Note: This assumes the user prompt was already added to history via generatePrompt() * or was sent separately. If you need to track the user prompt, call generatePrompt() * and manually add it to history before calling this method. */ processResponse(llmResponse: string): ModelGenerationResponse; /** * Reset conversation history (start fresh) */ reset(): void; /** * Get current conversation history */ getHistory(): LLMMessage[]; /** * Add a user message to conversation history * * This is typically used after generating a prompt to track what was sent to the LLM * * @param content The user message content (typically the prompt) */ addUserMessage(content: string): void; /** * Add an assistant message to conversation history * * This is typically used after receiving an LLM response * * @param content The assistant message content (typically the LLM response) */ addAssistantMessage(content: string): void; /** * Generate validation feedback message */ generateValidationFeedback(validationResult: { isValid: boolean; errors: string[]; warnings: string[]; }): string; } //# sourceMappingURL=llm-prompts.d.ts.map