Log information returns the newly added Body

This commit is contained in:
Liujian
2025-04-29 19:23:35 +08:00
parent 7dc8d65235
commit e5f0423a90
2 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -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"`
}
+6 -2
View File
@@ -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,
},
}