Skip to contents

A section of the frozen system prompt, rendered once per session in ascending order: T0 sections form the stable prefix, T1 sections follow. text may be a function of ctx; parent makes the section a fragment of another section.

Usage

gptr_prompt_section(
  name,
  text,
  tier = c("T0", "T1"),
  order = 500L,
  budget = 300L,
  parent = NULL
)

Arguments

name

Section name (the tag it is wrapped in).

text

A string or function(ctx) returning a string or NULL.

tier

"T0" or "T1".

order

Position among sections.

budget

Token budget of the section.

parent

Name of the section this fragment belongs to, or NULL.

Value

A spec of class c("gptr_prompt_section", "gptr_spec").

Examples

gptr_prompt_section("house_rules", "Use SI units in every table.", tier = "T1", order = 780L)
#> <gptr_prompt_section house_rules>
#>   text: Use SI units in every table.
#>   tier: T1
#>   order: 780
#>   budget: 300
#>   api_version: 1.0