chat_history.data.frame: Method for 'chat_history()' when the input is a 'data.frame'

View source: R/chat_history.R

chat_history.data.frameR Documentation

Method for chat_history() when the input is a data.frame

Description

Creates a chat_history object from a data frame.

Usage

## S3 method for class 'data.frame'
chat_history(chat_history)

Arguments

chat_history

A data frame with 'role' and 'content' columns, where 'role' is either 'user', 'assistant', or 'system', and 'content' is a character string representing a chat message

Value

A valid chat history data.frame (of class chat_history), with the 'role' and 'content' columns as specified in the input data frame


tidyprompt documentation built on April 4, 2025, 12:24 a.m.