feat(chat): display token usage and tps in message footers (#1094)

This commit is contained in:
M57 authored and GitHub committed 2026-09-12 16:04:13 +03:00
1 parent 0bb087c41e
commit 065c7fd75f
24 files changed
+448 -3

No files matched your search

@@ -87,7 +87,7 @@ object EventParser {
"message.complete" -> {
val text = payload?.get("text") as? String ?: ""
val reasoning = payload?.get("reasoning") as? String
WsEvent.MessageComplete(text, sessionId, reasoning)
WsEvent.MessageComplete(text, sessionId, reasoning, rawPayload = payload)
}
"message.done" -> {
@@ -61,6 +61,8 @@ sealed class WsEvent {
val reasoning: String? = null,
/** Stored session id captured before background disconnect clears the active mapping. */
val storedSessionId: String? = null,
/** Full raw payload map (including usage/avg_tps) emitted with message.complete. */
val rawPayload: Map<String, Any?>? = null,
) : WsEvent()
data class MessageDone(