feat(audit): persist message source and token usage
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package event
|
||||
|
||||
import "github.com/Tencent/WeKnora/internal/types"
|
||||
|
||||
// EventData contains common event data structures for different stages
|
||||
|
||||
// QueryData represents query-related event data
|
||||
@@ -142,6 +144,7 @@ type AgentCompleteData struct {
|
||||
TotalDurationMs int64 `json:"total_duration_ms"`
|
||||
MessageID string `json:"message_id,omitempty"` // Assistant message ID
|
||||
RequestID string `json:"request_id,omitempty"`
|
||||
TokenUsage *types.TokenUsage `json:"token_usage,omitempty"`
|
||||
Extra map[string]interface{} `json:"extra,omitempty"`
|
||||
}
|
||||
|
||||
@@ -184,9 +187,10 @@ type AgentReferencesData struct {
|
||||
|
||||
// AgentFinalAnswerData represents final answer streaming data
|
||||
type AgentFinalAnswerData struct {
|
||||
Content string `json:"content"`
|
||||
Done bool `json:"done"`
|
||||
IsFallback bool `json:"is_fallback,omitempty"` // True when response is a fallback (no knowledge base match)
|
||||
Content string `json:"content"`
|
||||
Done bool `json:"done"`
|
||||
IsFallback bool `json:"is_fallback,omitempty"` // True when response is a fallback (no knowledge base match)
|
||||
TokenUsage *types.TokenUsage `json:"token_usage,omitempty"`
|
||||
}
|
||||
|
||||
// AgentReflectionData represents agent reflection data
|
||||
|
||||
Reference in New Issue
Block a user