df_llm_message | R Documentation |
This function takes a data frame and converts it into an LLMMessage object
representing a conversation history. The data frame should contain specific
columns (role
and content
) with each row representing a message in the
conversation.
df_llm_message(.df)
.df |
A data frame with at least two rows and columns |
An LLMMessage object containing the structured messages as per the input data frame.
# Example data frame with role and content
df_example <- data.frame(
role = c("system", "user", "assistant","user"),
content = c("You allways only answer with two words",
"Why is the sky blue?",
"Rayleigh scattering",
"Why is the sun yellow?"),
stringsAsFactors = FALSE
)
df_llm_message(df_example)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.