Skip to main content

Module prompt_optimizer

Module prompt_optimizer 

Source
Expand description

§Prompt Optimizer

Prompt variant testing and automatic improvement tracking using bandit algorithms: UCB1, Epsilon-Greedy, Thompson Sampling, and BestFirst.

Structs§

AbExperimentResult
Result of one A/B experiment run (legacy).
AbOptimizerConfig
Configuration for the legacy prompt A/B optimizer.
ChainOfThoughtInjector
Wraps a prompt with chain-of-thought scaffolding.
FewShotExample
A single input/output example for few-shot prompting.
FewShotSelector
Selects the most relevant few-shot examples that fit within a token budget.
PromoterRegistry
Maps intent strings to the best known prompt variant (legacy).
PromptAbOptimizer
Orchestrates prompt A/B testing (legacy).
PromptCompressionOptimizer
Unified facade that combines compression, few-shot selection, and CoT injection into a single optimisation pipeline.
PromptCompressor
Applies lossless and near-lossless text compression to reduce token count.
PromptMutator
Applies simple transformations to prompt templates.
PromptOptimizer
Tracks prompt variants and selects the best using bandit algorithms.
PromptVariant
A single prompt variant being tracked by the optimizer.
ScoringEngine
Computes a weighted aggregate quality score from multiple metrics (legacy).
VariantGenerator
Generates N prompt variants from a base prompt (legacy).
VariantScore
Score for a single prompt variant (legacy).

Enums§

CompressionGoal
High-level objective that guides how the compression optimizer applies its tools.
OptimizationStrategy
Strategy for selecting the next variant to evaluate.
PromptOptimizerError
Errors returned by the legacy prompt optimizer.
QualityMetric
A configurable quality metric used to score an inference response (legacy).
VariantStrategy
Strategies for generating prompt variants (legacy).