mirror of
https://github.com/alibaba/higress.git
synced 2026-06-07 19:57:34 +08:00
feat(ai-statistics): add session ID tracking for multi-turn agent conversations (#3420)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
--- a/main.go
|
||||
+++ b/main.go
|
||||
@@ -790,6 +790,14 @@
|
||||
buffer = extractStreamingToolCalls(body, buffer)
|
||||
ctx.SetContext(CtxStreamingToolCallsBuffer, buffer)
|
||||
|
||||
+ // Also set tool_calls to user attributes so they appear in ai_log
|
||||
+ toolCalls := getToolCallsFromBuffer(buffer)
|
||||
+ if len(toolCalls) > 0 {
|
||||
+ ctx.SetUserAttribute(BuiltinToolCallsKey, toolCalls)
|
||||
+ return toolCalls
|
||||
+ }
|
||||
}
|
||||
} else if source == ResponseBody {
|
||||
if value := gjson.GetBytes(body, ToolCallsPathNonStreaming).Value(); value != nil {
|
||||
Reference in New Issue
Block a user