mirror of
https://github.com/coaidev/coai.git
synced 2025-05-28 17:30:15 +09:00
update docs
This commit is contained in:
parent
6577e54a2e
commit
a96aeb462d
29
README.md
29
README.md
@ -46,6 +46,20 @@
|
||||
- 🍎 Theme switching
|
||||
|
||||
|
||||
## 🔨 模型 | Models
|
||||
- ChatGPT
|
||||
- GPT-3.5-Turbo (_0613_, _0301_)
|
||||
- GPT-3.5-Turbo-16k (_0613_, _0301_)
|
||||
- GPT-3.5-Reverse (_text-davincci-002-render-sha_, _text-davincci-002-render-paid_)
|
||||
- GPT-4 (_0314_, _0613_)
|
||||
- GPT-4-32k (_0314_, _0613_)
|
||||
- GPT-4-Reverse (_gpt-4_)
|
||||
- DALL-E
|
||||
- Claude
|
||||
- Claude-2
|
||||
- Claude-2-100k
|
||||
- More models are under development...
|
||||
|
||||
## 📚 预览 | Screenshots
|
||||

|
||||

|
||||
@ -106,6 +120,11 @@ openai:
|
||||
gpt4: sk-xxxxxx|sk-xxxxxx|sk-xxxxxx
|
||||
gpt4_endpoint: https://api.openai.com/v1
|
||||
|
||||
reverse: gpt-4 # cf reverse
|
||||
pro: ey...|ey...|ey...
|
||||
pro_endpoint: .../imitate/v1
|
||||
|
||||
|
||||
mysql:
|
||||
host: localhost
|
||||
port: 3306
|
||||
@ -127,5 +146,15 @@ auth:
|
||||
- 应用技术: PWA + HTTP2 + WebSocket + Stream Buffer
|
||||
|
||||
|
||||
## 🎈 感谢 | Thanks
|
||||
感谢这些开源项目提供的思路:
|
||||
- Claude API 转换: [claude-to-chatgpt](https://github.com/jtsang4/claude-to-chatgpt)
|
||||
- ChatGPT 逆向工程: [go-chatgpt-api](https://github.com/linweiyuan/go-chatgpt-api)
|
||||
|
||||
## 🎃 开发团队 | Team
|
||||
- [@ProgramZmh](https://github.com/zmh-program) (全栈开发)
|
||||
- [@Sh1n3zz](https://github.com/sh1n3zz) (全栈开发)
|
||||
- [@一個小果冻](https://b23.tv/XjdZ4DN) (美工、UI 设计)
|
||||
|
||||
## 📄 开源协议 | License
|
||||
Apache License 2.0
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
const defaultErrorMessage = "There was something wrong... Please try again later."
|
||||
const defaultQuotaMessage = "You have run out of GPT-4 usage. Please keep your nio points above **5**."
|
||||
const defaultQuotaMessage = "You have run out of GPT-4 usage. Please keep your nio points above **5**. (**GPT-4-32K** requires **50** nio points)"
|
||||
const defaultImageMessage = "Please provide description for the image (e.g. /image an apple)."
|
||||
const maxThread = 5
|
||||
|
||||
|
@ -77,13 +77,15 @@ func NativeStreamRequest(model string, endpoint string, apikeys string, messages
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req.Header.Set("Authorization", "Bearer "+GetRandomKey(apikeys))
|
||||
|
||||
res, err := client.Do(req)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
fmt.Println(fmt.Sprintf("[stream] error: %s (status: %d)", err.Error(), res.StatusCode))
|
||||
return
|
||||
} else if res.StatusCode >= 400 || res.StatusCode < 200 || res == nil {
|
||||
fmt.Println(fmt.Sprintf("[stream] request failed (status: %d)", res.StatusCode))
|
||||
return
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
@ -1,6 +1,6 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const version: string = "2.6.0";
|
||||
export const version: string = "2.7.0";
|
||||
export const deploy: boolean = true;
|
||||
export let rest_api: string = "http://localhost:8094";
|
||||
export let ws_api: string = "ws://localhost:8094";
|
||||
|
@ -20,6 +20,10 @@ openai:
|
||||
pro: ey...|ey...|ey...
|
||||
pro_endpoint: .../imitate/v1
|
||||
|
||||
claude:
|
||||
key: ...
|
||||
endpoint: ...
|
||||
|
||||
mysql:
|
||||
host: localhost
|
||||
port: 3306
|
||||
|
@ -14,6 +14,8 @@ const (
|
||||
GPT432k0314 = "gpt-4-32k-0314"
|
||||
GPT432k0613 = "gpt-4-32k-0613"
|
||||
Dalle = "dalle"
|
||||
Claude2 = "claude-2"
|
||||
Claude2100k = "claude-2-100k"
|
||||
)
|
||||
|
||||
var GPT3TurboArray = []string{
|
||||
|
@ -100,3 +100,11 @@ func Multi[T comparable](condition bool, tval, fval T) T {
|
||||
return fval
|
||||
}
|
||||
}
|
||||
|
||||
func MultiF[T comparable](condition bool, tval, fval func() T) T {
|
||||
if condition {
|
||||
return tval()
|
||||
} else {
|
||||
return fval()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user