ProgramPromptResult

Models & Types · AiDotNet.Evolution.Prompts

One rendered prompt: the messages to send, plus the record of how they were assembled.

For Beginners

This is the finished message ready to send to the model, together with a short receipt of how it was built: which wording was picked, whether the model was asked for a patch or a whole new file, and whether anything had to be cut to fit the size limit. Send Messages to your chat client; keep the rest if you want to be able to explain later what the model was shown.

How It Works

The result carries more than the messages because reproducing a run means reproducing the decisions, not just the text. Mode records whether this prompt asked for edits or a rewrite, UserTemplateKey records which wording was used, and VariationChoices records which alternative phrasing was drawn from the random stream. Persist those alongside the candidate and a later investigation can explain why one proposal differed from another, which is not possible upstream where the variation is drawn from the process-global generator and never recorded.

WasTruncated is a first-class signal rather than a silent event. A prompt that lost its tail to the character ceiling may have dropped the very example that mattered, and the caller deserves to know.

Constructors

Constructor Summary
ProgramPromptResult(string systemText, string userText, ProgramPromptEvolutionMode mode, ProgramPromptTemplateKey userTemplateKey, IReadOnlyDictionary<string, string> variationChoices, bool wasTruncated) Initializes a rendered prompt.

Properties

Property Summary
IReadOnlyDictionary<string, string> VariationChoices { get; } Gets the alternative wording drawn for each variation placeholder; empty when none applied.
IReadOnlyList<ChatMessage> Messages { get; } Gets the messages to send, a system message (when non-empty) followed by the user message.
ProgramPromptEvolutionMode Mode { get; } Gets whether this prompt asked for edit blocks or a complete replacement program.
ProgramPromptTemplateKey UserTemplateKey { get; } Gets the template the user message was rendered from.
bool WasTruncated { get; } Gets whether the user message was cut to fit the configured character ceiling.
int TotalLength { get; } Gets the combined character length of both messages.
string SystemText { get; } Gets the system message text.
string UserText { get; } Gets the user message text.

Methods

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