public interface ChatMemory
ChatMemory
helps with keeping track of the conversation and ensuring that messages fit within language model's context window.Modifier and Type | Method and Description |
---|---|
void |
add(ChatMessage message)
Adds a message to the chat memory.
|
void |
clear()
Clears the chat memory.
|
Object |
id() |
List<ChatMessage> |
messages()
Retrieves messages from the chat memory.
|
Object id()
ChatMemory
.void add(ChatMessage message)
message
- The ChatMessage
to add.List<ChatMessage> messages()
ChatMessage
objects that represent the current state of the chat memory.void clear()
Copyright © 2023. All rights reserved.