In Memory Conversation
Simple in-memory implementation of Conversation for testing and ephemeral use cases.
Constructors
Link copied to clipboard
constructor(messages: List<Message> = emptyList(), id: String = MobyNameGenerator.generateName(), persistent: Boolean = false, assets: AssetTracker = InMemoryAssetTracker())
Functions
Link copied to clipboard
Modify the state of this conversation Return the newly added message for convenience
Link copied to clipboard
Link copied to clipboard
Create a nonpersistent conversation with the last n messages from this conversation.
Link copied to clipboard
Non-null if the conversation has messages and the last message is from the user.
Link copied to clipboard
Link copied to clipboard
open fun promptContributor(conversationFormatter: ConversationFormatter = WindowingConversationFormatter()): <Error class: unknown class>
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