| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package consume
- import (
- "time"
- "github.com/labring/aiproxy/core/model"
- "github.com/labring/aiproxy/core/relay/meta"
- )
- func recordConsume(
- now time.Time,
- meta *meta.Meta,
- code int,
- firstByteAt time.Time,
- usage model.Usage,
- modelPrice model.Price,
- content string,
- ip string,
- requestDetail *model.RequestDetail,
- amount float64,
- retryTimes int,
- downstreamResult bool,
- user string,
- metadata map[string]string,
- ) error {
- return model.BatchRecordLogs(
- now,
- meta.RequestID,
- meta.RequestAt,
- meta.RetryAt,
- firstByteAt,
- meta.Group.ID,
- code,
- meta.Channel.ID,
- meta.OriginModel,
- meta.Token.ID,
- meta.Token.Name,
- meta.Endpoint,
- content,
- int(meta.Mode),
- ip,
- retryTimes,
- requestDetail,
- downstreamResult,
- usage,
- modelPrice,
- amount,
- user,
- metadata,
- )
- }
|