Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
fetch arkose token for each request
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jun 24, 2023
1 parent df2fb77 commit 09303a9
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ func init() {
}
}()
}
go func() {
for {
var err error
arkose_token, err = get_arkose_token()
if err != nil {
println(err.Error())
time.Sleep(10 * time.Second)
}
time.Sleep(15 * time.Second)
}
}()
}

func main() {
Expand Down Expand Up @@ -178,6 +167,10 @@ func proxy(c *gin.Context) {
return
}
if strings.HasPrefix(request_body["model"].(string), "gpt-4") {
token, err := get_arkose_token()
if err == nil {
arkose_token = token
}
request_body["arkose_token"] = arkose_token
println("GPT-4!")
}
Expand Down

0 comments on commit 09303a9

Please sign in to comment.