DRYL COMPONENTS
Color mode: System — switch to light
2.20.1
Agents

Collaborative Build

AI-aware

StartBuild<T> lets an agent and the user co-author a typed artifact, round by round, until it settles.

How it works

Runner.StartBuild<T> auto-injects an update_<T> tool. The agent alternates between asking you (via the human-in-the-loop dialogs) and refining the artifact through that tool. DrylAiBuild renders the current snapshot — Artifact, Round, State — which grows with a guided reveal each round.

Where the innovation lies: it fuses the two tool directions — the agent asking the human, and the agent producing structured output — into one loop, so a typed object emerges from an actual back-and-forth rather than a single prompt.

csharp
// StartBuild auto-injects an update_campaignbrief tool the agent refines the artifact through.
var run = Runner.StartBuild<CampaignBrief>(agent, session,
    "Help me write a marketing campaign brief.", aiKey: "build");
razor
<DrylAiBuild T="CampaignBrief" Run="run" Key="build">
    <ChildContent Context="snap">
        <h4>@(snap.Artifact?.Headline ?? "Drafting…")</h4>
        <DrylBadge Kind="DrylBadge.BadgeKind.Accent">Round @snap.Round</DrylBadge>
    </ChildContent>
</DrylAiBuild>

Collaborative artifact build

StartBuild auto-injects an update_<T> tool. The agent alternates asking you (via the dialogs) and refining a typed artifact, which grows round by round with a guided reveal until it settles.

An unhandled error has occurred. Reload x

Reconnecting to the server…

Attempt /

Next try in s