BaseChatMessageHistory class abstract base

Base interface for chat message history.

See ChatMessageHistory for an in-memory implementation.

Constructors

BaseChatMessageHistory()
Base interface for chat message history.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAIChatMessage(String message) Future<void>
Add an AI message to the history.
addChatMessage(ChatMessage message) Future<void>
Add ChatMessage to the history.
addHumanChatMessage(String message) Future<void>
Add a human message to the history.
addToolChatMessage({required String toolCallId, required String content}) Future<void>
Add a Tool response message to the history.
clear() Future<void>
Clear the history.
getChatMessages() Future<List<ChatMessage>>
Return a list of messages.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeFirst() Future<ChatMessage>
Removes and returns the first (oldest) element of the history.
removeLast() Future<ChatMessage>
Removes and returns the last (newest) element of the history.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited