Chat History Print
chat.history.print

R Package "GenAI" Documentation

CRAN Open in GitHub Open In Colab

Last update: 2024/02/15


Usage

chat.history.print(genai.object, from = 1, to = NULL)

Arguments

  • genai.object: A generative AI object containing necessary and correct information.
  • from: Optional. Default to 1. An integer representing the first message in the chat history that needs to be printed.
  • to: Optional. Default to NULL, prints until the last message in the chat history. An integer representing the last message in the chat history that needs to be printed.

Description

This function prints out the chat history along with a generative AI object.


Details

Providing accurate and valid information for each argument is crucial for successful chat generation by the generative AI model. If any parameter is incorrect, the function responds with an error message based on the API feedback. To view all supported generative AI models, use the function available.models.


Examples

Open In Colab
# Method 1 (recommended): use the pipe operator "%>%"
genai.model %>%
  chat.history.print()

# Method 2: use the reference operator "$"
genai.model$chat.history.print(from = 3)

# Method 3: use the function chat.history.print() directly
chat.history.print(genai.object = genai.model,
                   from = 3,
                   to = 5)