Skip to contents

Each argument is either a column name or a glue::glue() template that combines several columns, such as "{subject}\n\n{body}". Templates are rendered per row when the training files are written.

Usage

dragon_map(dataset, prompt, response, system = NULL)

Arguments

dataset

A dragon_dataset.

prompt

Column name or template for the user turn.

response

Column name or template for the assistant turn.

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

ds <- dragon_dataset(dragon_example_data())
ds <- dragon_map(ds, prompt = "{subject}\n\n{body}", response = "reply")
dragon_preview(ds, n = 1)
#> 
#> ── Row 1 
#> user:
#> Ember thermostat keeps dropping off Wi-Fi
#> 
#> I've tried setting up my Ember thermostat three times and it never gets past the Wi-Fi step. The app just says 'connection failed'. My phone is on the same 2.4 GHz network.
#> assistant:
#> Thanks for the details. Wi-Fi drops on the Ember thermostat are almost always a 2.4 GHz band-steering issue with mesh routers. Please try these steps: (1) In your router app, create a dedicated 2.4 GHz network or temporarily disable band steering. (2) Hold the reset button on the Ember thermostat for 10 seconds until the light blinks amber. (3) Set it up again in the app on that 2.4 GHz network. If it still drops after 24 hours, reply with your router model and we will escalate to our network team.