feat(router): capture latency + tokens on ROUTER ChatTurnEvent
ChatTurnEvent gains nullable latencyMs and tokensUsed fields (defaults preserve backward-compat; legacy JSON without them deserializes cleanly). emitChatTurn accepts optional metrics; the ROUTER emit site passes inferenceResponse values through; the USER emit site leaves both null.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.correx.core.events.events
|
||||
|
||||
import com.correx.core.events.types.SessionId
|
||||
import com.correx.core.inference.TokenUsage
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -12,6 +13,8 @@ data class ChatTurnEvent(
|
||||
val role: ChatTurnRole,
|
||||
val content: String,
|
||||
val timestampMs: Long,
|
||||
val latencyMs: Long? = null,
|
||||
val tokensUsed: TokenUsage? = null,
|
||||
) : EventPayload
|
||||
|
||||
@Serializable
|
||||
|
||||
Reference in New Issue
Block a user