style_chat_history: Style Chat History

View source: R/app_chat_style.R

style_chat_historyR Documentation

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())

Arguments

history

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

ide_colors

List containing the colors of the IDE theme.

Value

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

Examples

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?")
)

## Not run: 
style_chat_history(chat_history_example)

## End(Not run)

gptstudio documentation built on May 29, 2024, 12:30 p.m.