Skip to main content

OptimizationResult

Returned by PromptOptimizer.run(). Contains the optimized prompt, scores, iteration history, and analysis.

Properties

Computed properties

Methods

summary()

Returns a formatted string with scores, trajectory, strategy analysis, prompt diff, and before/after example.

to_dict()

Serialize to a dictionary.

to_json(path)

Save full results to a JSON file.

save_best_prompt(path)

Write the optimized prompt to a text file.

IterationRecord

A single optimization iteration.

EvalSnapshot

Scores from a single eval run (baseline or final).

SampleSnapshot

A single sample’s input, output, and score.