Skip to contents

Validate a list of messages to ensure they have the required fields and the correct data types for the chat() function.

Usage

validate_messages(messages)

Arguments

messages

A list of messages, each of list class.

Value

TRUE if all messages are valid, otherwise warning messages are printed and FALSE is returned.

Examples

validate_messages(create_messages(
   create_message("Be friendly", "system"),
   create_message("Hello")
))
#> [1] TRUE