LLMMessage
is an S7 class for managing a conversation history intended for use with large language models (LLMs). Please use
llm_message()
to create or modify LLMMessage
objects.
Details
The LLMMessage
class includes the following features:
Stores message history in a structured format.
Supports attaching media and metadata to messages.
Provides generics like
add_message()
,has_image()
, andremove_message()
for interaction.Enables API-specific formatting through the
to_api_format()
generic.message_history
: A list containing messages. Each message is a named list with keys likerole
,content
,media
, etc.system_prompt
: A character string representing the default system prompt used for the conversation.