A block of context the model receives in user messages: provide(ctx, budget) returns text (or
NULL to skip). placement puts it in the first message, in later turns, or both; turn blocks
equal to their previous text are skipped. authority = "operator" is accepted only from user,
plugin and built-in records.
Usage
gptr_context_block(
name,
provide,
placement = c("turn", "first", "both"),
authority = c("data", "operator"),
budget = 300L,
order = 650L
)
Arguments
- name
Block name (the tag it is wrapped in).
- provide
function(ctx, budget).
- placement
"turn", "first" or "both".
- authority
"data" or "operator".
- budget
Token budget; longer text is truncated.
- order
Position among blocks.
Value
A spec of class c("gptr_context_block", "gptr_spec").
Examples
gptr_context_block("lab_notebook", function(ctx, budget) "Experiment 12: cohort B only.",
placement = "first", order = 650L)
#> <gptr_context_block lab_notebook>
#> provide: <fn>
#> placement: first
#> authority: data
#> budget: 300
#> order: 650
#> api_version: 1.0