View source: R/chat.history.convert.R
chat.history.convert | R Documentation |
This function converts the chat history along with a generative AI object to a valid format for another generative AI object.
chat.history.convert(from.genai.object, to.genai.object)
from.genai.object |
A source generative AI object containing necessary and correct information. |
to.genai.object |
A target generative AI object containing necessary and correct information. |
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
. Moreover, you can print out the chat history using the
function chat.history.print
or simply use verbose = TRUE
during the chat.
If successful, the converted chat history list will be returned.
GenAI - R Package "GenAI" Documentation
## Not run:
# Assuming there are two GenAI objects named 'genai.model' and 'another.genai.model'
# supporting this function, please refer to the "Live Demo in Colab" above for
# real examples. The following examples are just some basic guidelines.
# Method 1 (recommended): use the pipe operator "%>%"
converted.history = genai.model %>%
chat.history.convert(to.genai.object = another.genai.model)
# Method 2: use the reference operator "$"
converted.history = genai.model$chat.history.convert(to.genai.object = another.genai.model)
# Method 3: use the function chat.history.convert() directly
converted.history = chat.history.convert(from.genai.object = genai.model,
to.genai.object = another.genai.model)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.