From e5f0423a90dc460a74d03cdc024e1508cbdaf95f Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Tue, 29 Apr 2025 19:23:35 +0800 Subject: [PATCH] Log information returns the newly added Body --- module/service/dto/output.go | 4 ++-- module/service/iml.go | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/service/dto/output.go b/module/service/dto/output.go index 055fa19f..eb334397 100644 --- a/module/service/dto/output.go +++ b/module/service/dto/output.go @@ -291,10 +291,10 @@ type AILogInfo struct { type OriginRequest struct { Header string `json:"header"` Origin string `json:"origin"` + Body string `json:"body"` } type OriginAIRequest struct { OriginRequest - Body string `json:"body"` - Token int64 `json:"token"` + Token int64 `json:"token"` } diff --git a/module/service/iml.go b/module/service/iml.go index 70ea3c69..3028c19f 100644 --- a/module/service/iml.go +++ b/module/service/iml.go @@ -131,10 +131,12 @@ func (i *imlServiceModule) RestLogInfo(ctx context.Context, serviceId string, lo Request: service_dto.OriginRequest{ Header: formatHeader(info.RequestHeader), Origin: info.RequestBody, + Body: info.RequestBody, }, Response: service_dto.OriginRequest{ Header: formatHeader(info.ResponseHeader), Origin: info.ResponseBody, + Body: info.ResponseBody, }, } @@ -178,16 +180,18 @@ func (i *imlServiceModule) AILogInfo(ctx context.Context, serviceId string, logI OriginRequest: service_dto.OriginRequest{ Header: formatHeader(info.RequestHeader), Origin: info.RequestBody, + Body: parseAIRequest(info.RequestBody), }, - Body: parseAIRequest(info.RequestBody), + Token: info.InputToken, }, Response: service_dto.OriginAIRequest{ OriginRequest: service_dto.OriginRequest{ Header: formatHeader(info.ResponseHeader), Origin: info.ResponseBody, + Body: response, }, - Body: response, + Token: info.OutputToken, }, }