InMemoryChatHistoryProvider

A simple in-memory implementation of ChatHistoryProvider.

Stores conversation histories in a map keyed by conversation ID. Thread-safe via a coroutine Mutex. Useful for testing, prototyping, and short-lived applications where persistence across process restarts is not required.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend override fun load(conversationId: String): List<Message>

Load previously stored conversation history.

Link copied to clipboard
open suspend override fun store(conversationId: String, messages: List<Message>)

Store a list of messages as conversation history.