| hal_history | R Documentation |
Display or return the conversation turns from the active session.
hal_history(
role = NULL,
pattern = NULL,
format = c("console", "data.frame", "text"),
n = NULL
)
role |
Filter by role: |
pattern |
Optional regex to filter turn content. |
format |
Output format: |
n |
Maximum number of turns to return (most recent). |
Depends on format: invisible NULL for console, a data.frame, or
a character vector.
# with no active session this returns an empty data frame
hal_history(format = "data.frame")
## Not run:
hal_history() # print all turns
hal_history(role = "user", n = 5) # last five user prompts
hal_history(pattern = "ggplot") # turns mentioning ggplot
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.