dragon_map_prompts: Map columns for reinforcement learning

View source: R/reinforce.R

dragon_map_promptsR Documentation

Map columns for reinforcement learning

Description

For dragon_reinforce(). Each row is a prompt the model will practise on, with an optional reference answer that reward functions such as "exact" and "numeric" compare against. Every other column travels along as fields, available to custom reward functions.

Usage

dragon_map_prompts(dataset, prompt, reference = NULL, system = NULL)

Arguments

dataset

A dragon_dataset.

prompt

Column name or template for the user turn.

reference

Optional column name or template for the reference answer.

system

Optional column name or template for the system prompt. A template with no braces and no matching column is used as a constant system prompt for every row.

Value

The dataset with the mapping attached.

Examples

df <- data.frame(question = c("12 * 12?", "Capital of Peru?"), answer = c("144", "Lima"))
ds <- dragon_map_prompts(dragon_dataset(df), prompt = "question", reference = "answer")
dragon_preview(ds, n = 1)

dragonfarm documentation built on Oct. 12, 2026, 5:07 p.m.