InMemoryConversation

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)

Properties

Link copied to clipboard
open val id: String
Link copied to clipboard
open override val messages: List<Message>

Functions

Link copied to clipboard
open override fun addMessage(message: Message): Message

Modify the state of this conversation Return the newly added message for convenience

Link copied to clipboard
open fun infoString(verbose: Boolean?, indent: Int): String
Link copied to clipboard

Non-null if the conversation has messages and the last message is from the user.

Link copied to clipboard
open fun persistent(): Boolean
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 instead of formatting the conversation