Commit 3e58aa1
feat(prompt-engineering): add comprehensive prompt engineering features
Implements Issue #420 with 7 phases of prompt engineering enhancements:
Phase 1: Core infrastructure
- PredictionModelResultOptions for configurable prompt features
- Updated PredictionModelResult and PredictionModelBuilder
Phase 2: Advanced example selectors
- SemanticSimilarityExampleSelector (embedding-based similarity)
- DiversityExampleSelector (maximizes example diversity)
- MMRExampleSelector (maximal marginal relevance)
- ClusterBasedExampleSelector (k-means clustering)
Phase 3: Advanced chains
- RouterChain (routes to different chains based on classification)
- MapReduceChain (parallel processing with reduce)
- LoopChain (iterative processing with termination)
- ParallelChain (concurrent execution)
- ConditionalChain (branching logic)
Phase 4: Token compression
- StopWordRemovalCompressor, SentenceCompressor
- RedundancyRemovalCompressor, LLMSummarizationCompressor
- CachingCompressor, CompositeCompressor
Phase 5: Prompt analysis and metrics
- PromptMetrics, PromptAnalyzerBase
- ComplexityAnalyzer, TokenCountAnalyzer
- PatternDetectionAnalyzer, PromptValidator
Phase 6: Advanced optimizers
- GeneticOptimizer (evolutionary algorithm)
- BeamSearchOptimizer (multiple candidates)
- SimulatedAnnealingOptimizer (escapes local optima)
- EnsembleOptimizer (combines strategies)
- GreedyHillClimbingOptimizer
Phase 7: Advanced templates
- ChainOfThoughtTemplate (step-by-step reasoning)
- StructuredOutputTemplate (JSON/XML/CSV/YAML)
- RolePlayingTemplate (persona-based prompts)
- InstructionFollowingTemplate (structured instructions)
- CompositePromptTemplate, ConditionalPromptTemplate
All code compiles for net8.0 and net471 with zero warnings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent d942a17 commit 3e58aa1
40 files changed
Lines changed: 11452 additions & 0 deletions
File tree
- src
- Interfaces
- Models
- Options
- Results
- PromptEngineering
- Analysis
- Chains
- Compression
- FewShot
- Optimization
- Templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
0 commit comments