| llm_request_from_log | R Documentation |
Turns one parsed log record (the rec element of a llm_log_read() entry)
back into the config and messages an experiments row needs, so an archived
call can be re-issued live or matched against a config-driven call. The
provider-specific request body is canonicalized to provider-neutral
role/content turns and its generation parameters are recovered onto a
reconstructed llm_config().
llm_request_from_log(record, on_unsupported = c("error", "warn", "quiet"))
record |
A parsed log record: a list with at least |
on_unsupported |
What to do when the request body uses a shape this
reconstructor does not cover (so the rebuilt messages would be empty or
lossy) – chiefly the OpenAI Responses API ( |
A list with config (an llm_config()), messages (a named
character vector of role/content turns), and complete (a logical: TRUE
when the body was fully reconstructed, FALSE when content was dropped).
NULL when the record carries no request body.
llm_log_read(), llm_request_hash()
rec <- list(provider = "openai", model = "gpt-4o-mini",
request = list(
messages = list(list(role = "user", content = "Hi")),
temperature = 0))
req <- llm_request_from_log(rec)
req$messages
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.