This commit is contained in:
2023-07-10 18:22:21 +08:00
commit 7f0e0b8a9d
12 changed files with 691 additions and 0 deletions

17
structure.go Normal file
View File

@@ -0,0 +1,17 @@
package main
import (
"time"
"gorm.io/gorm"
)
// one openai upstream contain a pair of key and endpoint
type OPENAI_UPSTREAM struct {
gorm.Model
SK string `gorm:"index:idx_sk_endpoint,unique"` // key
Endpoint string `gorm:"index:idx_sk_endpoint,unique"` // endpoint
SuccessCount int64
FailedCount int64
LastCallSuccessTime time.Time
}