Learn R Programming

tidyllm (version 0.2.0)

df_llm_message: Convert a Data Frame to an LLMMessage Object

Description

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.

Usage

df_llm_message(.df)

Value

An LLMMessage object containing the structured messages as per the input data frame.

Arguments

.df

A data frame with at least two rows and columns role and content. The column role should contain values from "user", "assistant", or "system", and content should be of type character.