Converts dsprrr module traces to a tibble format compatible with vitals
Task$get_samples() output. This enables viewing dsprrr traces in
vitals' Inspect viewer or combining with vitals samples using vitals_bind().
Arguments
- traces
A traces tibble from
export_traces()or module$get_traces().- input_column
Column name containing the input prompts. If
NULL, attempts to extract from the prompt field.- include_chats
Logical; if
TRUEand solver_chat column exists, include chat objects. Defaults toFALSE.
Value
A tibble with columns matching vitals samples format:
id: Unique identifier for each traceinput: Input prompt textresult: Model outputsolver_metadata: List column with trace metadata (latency, tokens, cost)model: Model name usedepoch: Always 1 (dsprrr doesn't use epochs)
Examples
if (FALSE) { # \dontrun{
# Export traces from a module and convert
traces <- export_traces(my_module, include_outputs = TRUE)
samples <- as_vitals_samples(traces)
# Use with vitals_bind for combined analysis
vitals::vitals_bind(
task1 = task1,
dsprrr = samples
)
} # }
