Draft a copy-paste prompt asking an LLM to write a new type detector
Source:R/00-llm-prompts.R
draft_detector_prompt.RdTurns a handful of example values for a new data type into a self-contained prompt: the versioned detector contract (see `inst/prompts/detector-contract.md`) followed by the type's positive examples and machine-generated hard negatives. Paste or attach the result into any LLM; feed the function it returns to [evaluate_detector()].
Usage
draft_detector_prompt(
examples,
type_name,
n_negatives = 15,
seed = 514,
file = NULL,
contract_path = NULL,
quiet = FALSE
)Arguments
- examples
A character vector of 10-25 valid example values for the new type.
- type_name
A single lower_snake_case type name, e.g. `"iso_country"`. The LLM is asked to write `is_<type_name>()`.
- n_negatives
Max hard negatives to include per mutation tier (keeps the prompt readable; the file still captures everything you pass).
- seed
Integer seed for reproducible test-case generation.
- file
Output path for the prompt `.md`; `NULL` writes to `tempdir()`.
- contract_path
Optional override for the bundled contract (path or URL).
- quiet
If `TRUE`, only write the file (no console print).