mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-14 12:23:41 +08:00
Merge branch 'upstream/main'
This commit is contained in:
@@ -178,3 +178,4 @@ var UserContentRequestTimeout = env.Int("USER_CONTENT_REQUEST_TIMEOUT", 30)
|
||||
|
||||
// EnforceIncludeUsage is used to determine whether to include usage in the response
|
||||
var EnforceIncludeUsage = env.Bool("ENFORCE_INCLUDE_USAGE", false)
|
||||
var TestPrompt = env.String("TEST_PROMPT", "Print your model name exactly and do not output without any other text.")
|
||||
|
||||
@@ -14,3 +14,8 @@ func GetTimeString() string {
|
||||
now := time.Now()
|
||||
return fmt.Sprintf("%s%d", now.Format("20060102150405"), now.UnixNano()%1e9)
|
||||
}
|
||||
|
||||
// CalcElapsedTime return the elapsed time in milliseconds (ms)
|
||||
func CalcElapsedTime(start time.Time) int64 {
|
||||
return time.Now().Sub(start).Milliseconds()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user