df_llm_message: Convert a Data Frame to an LLMMessage Object

View source: R/llm_message.R

df_llm_messageR Documentation

Convert a Data Frame to an LLMMessage Object

Description

This function converts a data frame into an LLMMessage object representing a conversation history. The data frame must have specific columns (role and content), with each row representing a message.

Usage

df_llm_message(.df)

Arguments

.df

A data frame with at least two rows and columns role and content. The role column should contain "user", "assistant", or "system". The content column should contain the corresponding message text.

Value

An LLMMessage object representing the structured conversation.

See Also

llm_message()

Other Message Creation Utilities: llm_message()


tidyllm documentation built on Aug. 22, 2025, 5:21 p.m.