Learn R Programming

gptstudio (version 0.4.0)

style_chat_history: Style Chat History

Description

This function processes the chat history, filters out system messages, and formats the remaining messages with appropriate styling.

Usage

style_chat_history(history, ide_colors = get_ide_theme_info())

Value

A list of formatted chat messages with styling applied, excluding system messages.

Arguments

history

A list of chat messages with elements containing 'role' and 'content'.

ide_colors

List containing the colors of the IDE theme.

Examples

Run this code
chat_history_example <- list(
  list(role = "user", content = "Hello, World!"),
  list(role = "system", content = "System message"),
  list(role = "assistant", content = "Hi, how can I help?")
)

if (FALSE) {
style_chat_history(chat_history_example)
}

Run the code above in your browser using DataLab