ProgramPromptArtifact

Models & Types · AiDotNet.Evolution.Prompts

One named piece of output an evaluation produced, offered back to the model as evidence.

For Beginners

When your program runs, it usually prints something — results, warnings, or an error. This holds one of those outputs together with a name such as stderr. Passing it into the next prompt lets the AI see what went wrong instead of guessing, which is by far the fastest way for it to fix a broken program. You do not have to worry about the output being huge or containing secrets: it is trimmed and cleaned before it is sent.

How It Works

Artifacts are what a candidate program actually printed when it ran: standard output, an error stream, a profiler summary, a failing assertion. Showing them to the model is the difference between “your program scored 0.2” and “your program scored 0.2 and here is the exception it threw”, and it is usually the single most useful thing a prompt can carry.

The content is untrusted. It was produced by code a model wrote, running against data the library did not choose, and it may contain terminal escape sequences, credentials scraped from the environment, or megabytes of noise. The prompt builder therefore scrubs and truncates every artifact before it reaches a request; this type stores what was captured, unmodified, and leaves that decision to the point of use.

Constructors

Constructor Summary
ProgramPromptArtifact(string name, string content) Initializes an artifact.

Properties

Property Summary
string Content { get; } Gets the captured text exactly as produced, before scrubbing or truncation.
string Name { get; } Gets the artifact’s label.

Methods

Method Summary
string ToString() Returns a description that names the artifact and its size but never echoes its content.

Fields

Field Summary
int MaxNameLength The longest artifact name accepted, in characters.