Files

class Files(directory: File) : AgUiEventLog(source)

One JSON file per thread in directory (<threadId>.json, a JSON array of events).

Constructors

Link copied to clipboard
constructor(directory: File)

Functions

Link copied to clipboard
open suspend override fun append(threadId: String, events: List<JsonObject>)
Link copied to clipboard
open suspend override fun delete(threadId: String)

Forgets threadId's events, e.g. when its conversation is deleted.

Link copied to clipboard
open suspend override fun load(threadId: String): List<JsonObject>
Link copied to clipboard
open fun replayOf(message: Message, speed: Float = 1.0f): Flow<ChatEvent>?

The recorded run of message (the runs named in its metadata, see runsOf) played back through the event parser, or null when this log has no runs for it. For Chat(replay = …).