In Memory Conversation
Simple in-memory implementation of Conversation for testing and ephemeral use cases.
Constructors
Functions
Modify the state of this conversation. Return the newly added message for convenience.
Add a message with explicit author attribution. Useful for group chats or when the author differs per message.
Add a message with explicit author and recipient. Use this for multi-party chats where both sender and receiver need to be specified.
Create a nonpersistent conversation with the last n messages from this conversation.
Non-null if the conversation has messages and the last message is from the user.
The most recently timestamped assets
The most recently added assets
Prompt contributor that represents the conversation so far. Usually we will want to add messages from the conversation to a prompt instead of formatting the conversation
Convenience method to return references. References will be converted to matryoshka tools