mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-12 17:13:43 +08:00
fix: openai response time
This commit is contained in:
@@ -17,6 +17,7 @@ type RelayInfo struct {
|
||||
TokenUnlimited bool
|
||||
StartTime time.Time
|
||||
FirstResponseTime time.Time
|
||||
setFirstResponse bool
|
||||
ApiType int
|
||||
IsStream bool
|
||||
RelayMode int
|
||||
@@ -83,6 +84,13 @@ func (info *RelayInfo) SetIsStream(isStream bool) {
|
||||
info.IsStream = isStream
|
||||
}
|
||||
|
||||
func (info *RelayInfo) SetFirstResponseTime() {
|
||||
if !info.setFirstResponse {
|
||||
info.FirstResponseTime = time.Now()
|
||||
info.setFirstResponse = true
|
||||
}
|
||||
}
|
||||
|
||||
type TaskRelayInfo struct {
|
||||
ChannelType int
|
||||
ChannelId int
|
||||
|
||||
Reference in New Issue
Block a user