Learn R Programming

aisdk (version 1.1.0)

load_chat_session: Load a Chat Session

Description

Load a previously saved ChatSession from a file.

Usage

load_chat_session(path, tools = NULL, hooks = NULL, registry = NULL)

Value

A ChatSession object with restored state.

Arguments

path

File path to load from (.rds or .json).

tools

Optional list of Tool objects (tools are not saved, must be re-provided).

hooks

Optional HookHandler object.

registry

Optional ProviderRegistry.

Examples

Run this code
# \donttest{
if (interactive()) {
  # Load a saved session
  chat <- load_chat_session("my_session.rds", tools = my_tools)

  # Continue where you left off
  response <- chat$send("Let's continue our discussion")
}
# }

Run the code above in your browser using DataLab