Expand description
The system prompt: named sections the transcript holds and later patches.
Port of packages/coding-agent/src/core/system-prompt.ts in pi v1.0.0. The
preamble and the documentation section name yapi, and the section points
to the local docs, or to the published ones without a local copy.
Functions§
- build_
sections - The prompt’s sections in order, with
docsin the documentation section.preambleis plain text. Every other section is wrapped in a tag of its name. - diff_
sections - The section patch from what the model has to what it should have: changed or
new sections, and
Nonefor removed ones.Nonewhen nothing changed. - render
- The prompt as plain text, as the transcript renders it.
- valid_
section_ name - Whether a custom section name is valid: a lowercase letter, then lowercase
letters, digits,
_or-, and notpreamble.