LlamaLibraryChatHistory class
Manages a collection of chat messages
Constructors
- LlamaLibraryChatHistory()
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
-
LlamaLibraryChatHistory.fromJson(Map<
String, dynamic> json) -
Creates a ChatHistory from JSON
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
Returns the number of messages in the chat history
no setter
-
messages
→ List<
LlamaLibraryMessage> -
General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addMessage(
{required LlamaLibraryRole role, required String content}) → void - Adds a new message to the chat history
-
clear(
) → void - Clears all messages from the chat history
-
exportFormat(
LlamaLibraryChatFormat format) → String - Exports chat history in the specified format
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts ChatHistory to JSON
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited