ProgramDiffParseResult
Models & Types · AiDotNet.Evolution.Programs
The blocks recovered from one model response together with every block that was rejected.
For Beginners
After reading a model’s answer, this object says which edit instructions were
understood and which were not. IsSuccess is true only when at least one instruction was
understood and nothing was rejected. If it is false, look at Failures to see what went
wrong; each entry is short enough to paste straight back into a follow-up prompt.
How It Works
Parsing is deliberately total: a response with three well-formed blocks and one truncated block yields three
entries in Blocks and one entry in Failures, so a caller can apply what is usable
and still tell the model precisely what to fix. That is the difference from the reference implementation, whose
regular expression simply does not match a malformed block and reports “no valid diffs found” for the whole
response.
Properties
| Property | Summary |
|---|---|
IReadOnlyList<ProgramDiffBlock> Blocks { get; } |
Gets the well-formed edit blocks, in the order they appeared in the response. |
IReadOnlyList<ProgramDiffFailure> Failures { get; } |
Gets every block that could not be parsed, with a typed reason. |
bool HasBlocks { get; } |
Gets whether at least one usable block was recovered, even if others failed. |
bool IsSuccess { get; } |
Gets whether at least one block parsed and nothing was rejected. |