mirror of
https://github.com/alibaba/higress.git
synced 2026-02-28 22:50:57 +08:00
16 lines
525 B
Diff
16 lines
525 B
Diff
--- 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 {
|