Returns a tibble of recent LLM calls across all modules and dsp() calls.
Similar to DSPy's dspy.inspect_history(n).
Value
A tibble with one row per LLM call containing:
timestamp: When the call was madesource: Where the call originated ("dsp()" or module class name)model: The model usedtokens_in: Input tokenstokens_out: Output tokenscost: Cost in USD (if available)duration_s: Duration in seconds (if available)prompt: Full prompt text (ifinclude_prompts = TRUE)response: Full response text (ifinclude_responses = TRUE)
Examples
if (FALSE) { # \dontrun{
# View last 5 LLM calls
inspect_history(n = 5)
# Get history as tibble for analysis
history <- inspect_history(n = 20)
sum(history$cost) # Total cost
} # }
