浏览代码

Merge branch 'feature/671-huaguo-credits' into debug

jimmyyem 15 小时之前
父节点
当前提交
64fb81cb02
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      internal/utils/compapi/func.go

+ 10 - 1
internal/utils/compapi/func.go

@@ -36,7 +36,16 @@ type ServiceContext struct {
 func AppendUsageDetailLog(ctx context.Context, svcCtx *ServiceContext,
 func AppendUsageDetailLog(ctx context.Context, svcCtx *ServiceContext,
 	authToken string, req *types.CompApiReq, resp *types.CompOpenApiResp) error {
 	authToken string, req *types.CompApiReq, resp *types.CompOpenApiResp) error {
 
 
-	rawReqResp := custom_types.OriginalData{Request: req, Response: resp}
+	tmp0 := make([]custom_types.VResponseData, 0)
+	for _, tmp1 := range resp.ResponseData {
+		tmp21, _ := tmp1["id"].(string)
+		tmp22, _ := tmp1["model"].(string)
+		tmp2 := custom_types.VResponseData{ID: tmp21, Model: tmp22}
+		tmp0 = append(tmp0, tmp2)
+	}
+	tmp3 := custom_types.VResponse{ID: resp.ID, Model: resp.Model, ResponseData: tmp0}
+
+	rawReqResp := custom_types.OriginalData{Request: req, Response: resp, VResponse: &tmp3}
 	orgId := uint64(0)
 	orgId := uint64(0)
 	apiKeyObj, ok := contextkey.AuthTokenInfoKey.GetValue(ctx)
 	apiKeyObj, ok := contextkey.AuthTokenInfoKey.GetValue(ctx)
 	if ok {
 	if ok {