This function clears a chat log, leaving only its system messages (none,
if it has none). To remove the log altogether, use delete_chatlog().
Arguments
- chatlog_id
character string indicating the name of the chat log to clear, or a chatlog object. Default is
".__CURRENTCHAT__", the log ofchat().
Examples
start_chat(initial_content = "You are terse.", chatlog_id = "demo")
#> Chatlog ID: demo
#> role content
#> 1 system You are terse.
add_to_chatlog(data.frame(role = c("user", "assistant"),
content = c("Hi", "Hello.")), chatlog_id = "demo")
#> Chatlog ID: demo
#> role content
#> 1 system You are terse.
#> 2 user Hi
#> 3 assistant Hello.
cleared <- clear_chatlog("demo")
cleared@messages
#> role content
#> 1 system You are terse.
