ProgramPromptAttempt

Models & Types · AiDotNet.Evolution.Prompts

One earlier attempt summarized for the prompt: what it changed, what it measured, how it compared.

For Beginners

This is one line of history: “on attempt 7 we tried caching the results, the score went from 0.61 to 0.58, so it was a step backwards”. Feeding a few of these into the next prompt is what keeps the AI from suggesting the same thing again. You supply the numbers from the attempt and the numbers from whatever it was derived from, and the library works out the verdict.

How It Works

The previous-attempts section is what stops a search from proposing the same failed idea repeatedly. Each entry pairs the change that was made with the numbers it produced and the numbers its own parent produced, so the prompt can state the outcome — everything improved, everything regressed, or a mix — rather than leaving the model to diff two lists of floating-point values in its head.

Carrying ParentMetrics explicitly is what makes that verdict correct. The comparison is against the attempt’s own parent, not against the current program, which are different baselines whenever the search has moved on since the attempt was made.

Constructors

Constructor Summary
ProgramPromptAttempt(int attemptNumber, string changesDescription, IReadOnlyDictionary<string, double> metrics, IReadOnlyDictionary<string, double> parentMetrics) Initializes an attempt summary.

Properties

Property Summary
IReadOnlyDictionary<string, double> Metrics { get; } Gets the values the attempt measured; empty when none were supplied.
IReadOnlyDictionary<string, double> ParentMetrics { get; } Gets the values the attempt’s parent measured; empty when unknown.
int AttemptNumber { get; } Gets the one-based position of this attempt in the run.
string ChangesDescription { get; } Gets what the attempt changed, or null when it was not recorded.

Methods

Method Summary
string ToString() Returns a description that never echoes the change text.

Fields

Field Summary
int MaxChangesLength The longest change description accepted, in characters.