Skip to content
Prompty

Renderer

Renders a template string with input values to produce the final prompt text.

---
title: Renderer
config:
  look: handDrawn
  theme: colorful
  class:
    hideEmptyMembersBox: true
---
classDiagram
    class Renderer {
      <<protocol>>
        +render(agent: Agent, template: string, inputs: Record<unknown>) string [async-capable]
        +renderSegments(agent: Agent, template: string, inputs: Record<unknown>) RenderSegment[] [async-capable]
    }

The following helper methods are declared via @method and must be implemented by every runtime. The schema declares the logical protocol contract; each runtime maps async-capable methods to idiomatic sync/async shapes for that language.

Name Signature Runtime shape Description
render render(agent: Agent, template: string, inputs: Record<unknown>) -> string async-capable Render the template string with input values
renderSegments renderSegments(agent: Agent, template: string, inputs: Record<unknown>) -> RenderSegment[] async-capable Render the template into a provenance-tagged segment tree