Compare commits
4 Commits
9c5ac69024
...
c135d1c022
| Author | SHA1 | Date | |
|---|---|---|---|
| c135d1c022 | |||
| bf373c79ae | |||
| c9b763b9ed | |||
| ec31eba72f |
@@ -69,8 +69,8 @@ wget https://github.com/mirrors2/opencatd-open/raw/main/docker/docker-compose.ym
|
||||
使用Nginx + Docker部署
|
||||
- [使用Nginx + Docker部署](./doc/deploy.md)
|
||||
|
||||
pandola for team
|
||||
- [pandola for team](./doc/pandola.md)
|
||||
pandora for team
|
||||
- [pandora for team](./doc/pandora.md)
|
||||
# License
|
||||
|
||||
[GNU General Public License v3.0](License)
|
||||
+2
-1
@@ -115,8 +115,9 @@ Resp:
|
||||
### 重置用户 Token
|
||||
|
||||
- URL: `/1/users/:id/reset`
|
||||
- URL: `/1/users/:id/reset?token={new user token}`
|
||||
- Method: `POST`
|
||||
- Description: 重置用户 Token
|
||||
- Description: 重置用户 Token 默认生成新 Token 也可以指定
|
||||
- Headers:
|
||||
- Authorization: Bearer {token}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
| model name | deployment name |
|
||||
| --- | --- |
|
||||
|gpt-35-turbo | gpt-35-turbo |
|
||||
|gpt-35-turbo-16k | gpt-35-turbo-16k |
|
||||
| gpt-4 | gpt-4 |
|
||||
|
||||
## How to use
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# pandola for team
|
||||
# pandora for team
|
||||
|
||||
pandola是一个把ChatGPT(web/App)接口化的项目,可以看做是第三方 OpenAI API 提供方(接口和OpenAI一致)
|
||||
[pandora](https://github.com/pengzhile/pandora)是一个把ChatGPT(web/App)接口化的项目,可以看做是第三方 OpenAI API 提供方(接口和OpenAI一致)
|
||||
|
||||
## 准备
|
||||
- https://ai.fakeopen.com/auth1 获取accesstoken
|
||||
+8
-6
@@ -378,8 +378,12 @@ func HandleDelUser(c *gin.Context) {
|
||||
|
||||
func HandleResetUserToken(c *gin.Context) {
|
||||
id := to.Int(c.Param("id"))
|
||||
newtoken := c.Query("token")
|
||||
if newtoken == "" {
|
||||
newtoken = uuid.NewString()
|
||||
}
|
||||
|
||||
if err := store.UpdateUser(uint(id), uuid.NewString()); err != nil {
|
||||
if err := store.UpdateUser(uint(id), newtoken); err != nil {
|
||||
c.JSON(http.StatusForbidden, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
@@ -768,11 +772,9 @@ func NumTokensFromStr(messages string, model string) (num_tokens int) {
|
||||
}
|
||||
|
||||
func modelmap(in string) string {
|
||||
switch in {
|
||||
case "gpt-3.5-turbo":
|
||||
return "gpt-35-turbo"
|
||||
case "gpt-4":
|
||||
return "gpt-4"
|
||||
// gpt-3.5-turbo -> gpt-35-turbo
|
||||
if strings.HasSuffix(in, ".") {
|
||||
return strings.ReplaceAll(in, ".", "")
|
||||
}
|
||||
return in
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user