adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
119 lines • 3.5 kB
TypeScript
/**
* Enhanced AI Processor with Tailored Prompt Engineering
*
* Advanced AI processor that leverages the new prompt management system
* to provide tailored, document-specific content generation.
*
* @version 1.0.0
* @author Requirements Gathering Agent Team
* @created 2024
*
* Key Features:
* - Document-type-specific prompt selection
* - Context-aware content generation
* - Performance monitoring and optimization
* - Backward compatibility with existing processors
*
* @filepath src/modules/ai/EnhancedAIProcessor.ts
*/
import { PromptBuildOptions, PromptMetrics } from './prompts/PromptManager.js';
export interface EnhancedGenerationOptions extends PromptBuildOptions {
/** Maximum tokens for AI response */
maxResponseTokens?: number;
/** Enable performance monitoring */
enableMetrics?: boolean;
/** Retry configuration */
retryOptions?: {
maxRetries: number;
backoffMultiplier: number;
};
/** Quality validation options */
qualityValidation?: {
minLength: number;
requiredSections?: string[];
forbiddenPhrases?: string[];
};
}
export interface EnhancedGenerationResult {
/** Generated content */
content: string;
/** Success status */
success: boolean;
/** Error message if failed */
error?: string;
/** Performance metrics */
metrics?: PromptMetrics;
/** AI response metadata */
aiMetadata?: {
provider: string;
responseTime: number;
tokensUsed?: number;
};
/** Quality validation results */
qualityScore?: number;
/** Warnings or suggestions */
warnings?: string[];
}
/**
* Enhanced AI processor with tailored prompt engineering capabilities
*/
export declare class EnhancedAIProcessor {
private static instance;
private aiProcessor;
private promptManager;
private generationHistory;
private constructor();
static getInstance(): EnhancedAIProcessor;
/**
* Generate document content using tailored prompts
*/
generateDocumentContent(documentType: string, projectContext: string, options?: EnhancedGenerationOptions): Promise<EnhancedGenerationResult>;
/**
* Generate content with retry logic
*/
private generateWithRetry;
/**
* Validate content quality
*/
private validateContentQuality;
/**
* Add result to generation history
*/
private addToHistory;
/**
* Get generation history for analysis
*/
getGenerationHistory(documentType?: string): Map<string, EnhancedGenerationResult[]> | EnhancedGenerationResult[];
/**
* Get performance analytics
*/
getPerformanceAnalytics(): {
totalGenerations: number;
successRate: number;
averageQualityScore: number;
averageResponseTime: number;
topPerformingDocumentTypes: string[];
commonWarnings: string[];
};
/**
* Get available document types
*/
getAvailableDocumentTypes(): string[];
/**
* Test prompt for document type
*/
testPromptForDocumentType(documentType: string, sampleContext?: string): Promise<{
promptFound: boolean;
promptDetails?: any;
testGeneration?: EnhancedGenerationResult;
}>;
/**
* Clear generation history
*/
clearHistory(): void;
/**
* Export configuration for backup/restore
*/
exportConfiguration(): any;
}
//# sourceMappingURL=EnhancedAIProcessor.d.ts.map