Merge branch 'feature/liujian-1.8' into 'main'

Log information returns the newly added Body

See merge request apipark/APIPark!352
This commit is contained in:
刘健
2025-04-29 19:28:04 +08:00
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,
},
}