These functions manage the turn history of the active LLM conversation so that sessions can be saved, restored, listed, or reset.

  • save_chat() snapshots the current conversation under a name.

  • restore_chat() replaces the current conversation with a saved snapshot.

  • list_chats() returns the names of all saved snapshots.

  • reset_chat() clears the current conversation turn history.

save_chat(name = format(Sys.time(), "%Y%m%d_%H%M%S"))

restore_chat(name)

list_chats()

reset_chat()

Arguments

name

Name under which to save or from which to restore the snapshot. Defaults to a timestamp ("YYYYMMDD_HHMMSS").

Value

save_chat() and reset_chat() return invisible(NULL). restore_chat() returns invisible(NULL). list_chats() returns a character vector of snapshot names (or an empty vector if none exist).