Selaa lähdekoodia

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

jimmyyem 15 tuntia sitten
vanhempi
commit
64fb81cb02
1 muutettua tiedostoa jossa 10 lisäystä ja 1 poistoa
  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,
 	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)
 	apiKeyObj, ok := contextkey.AuthTokenInfoKey.GetValue(ctx)
 	if ok {