-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 配置文件优化,去掉非官方api支持以及非通用能力支持,前端配置简化去掉后端proxy地址配置
- Loading branch information
Showing
19 changed files
with
460 additions
and
794 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
# Server Port | ||
# Server Port, eg: 3000 | ||
SERVER_PORT=3000 | ||
|
||
# TIMEOUT Time | ||
CHATGPT_REQUEST_TIMEOUT=2 * 60 * 1000 | ||
# TIMEOUT Time,eg: 2 * 60 * 1000 | ||
CHATGPT_REQUEST_TIMEOUT= | ||
|
||
# Default is OpenAI API Base URL Or use a third-party self-built service address, such as the `endpoint` of api2d | ||
# Default is OpenAI API Base URL Or use a third-party self-built service address, | ||
# such as the `endpoint` of api2d | ||
# eg: https://openai.api2d.net/v1 | ||
OPENAI_API_BASE_URL= | ||
|
||
# Default is OpenAI API Key Or use a third-party self-built service address, such as the `endpoint` of api2d | ||
# Default is OpenAI API Key Or use a third-party self-built service address, | ||
# such as the `endpoint` of api2d | ||
# eg: fkxxx | ||
OPENAI_API_KEY= | ||
|
||
# PROXY_ADDRESS represents an http proxy. If left blank or not passed any value, it means that the http proxy is not enabled. | ||
PROXY_ADDRESS= | ||
|
||
# change this to an `accessToken` extracted from the ChatGPT site's `https://chat.openai.com/api/auth/session` response | ||
OPENAI_ACCESS_TOKEN= | ||
|
||
# Reverse Proxy - Available on accessToken | ||
# Default: https://ai.fakeopen.com/api/conversation | ||
# More: https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy | ||
API_REVERSE_PROXY= | ||
|
||
# Third-party service API address | ||
CUSTOM_API_URL= | ||
# Third-party service API may need cookie | ||
CUSTOM_COOKIE= | ||
|
||
# CUSTOM_PROXY represents an http proxy. If left blank or not passed any value, | ||
# it means that the http proxy is not enabled. | ||
# eg: http://127.0.0.1:7890 | ||
CUSTOM_PROXY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
interface IRes { | ||
id: string | ||
text: string | ||
conversationId: string | ||
response_first: boolean | ||
stream: boolean | ||
} | ||
|
||
type chatResponse = { | ||
id: string | ||
text: string | ||
} & { | ||
data?: null | ||
message?: string | ||
status?: string | ||
} | ||
|
||
type IResponseGptCallbacks = { | ||
onData?: (data: any) => void | ||
onEnd?: () => void | ||
onError?: (e: any) => void | ||
} | ||
|
||
type IResponseChatGptCallbacks = { | ||
onData?: (data: ChatMessage) => void | ||
onEnd?: (data: ChatMessage) => void | ||
onError?: (e: any) => void | ||
} | ||
|
||
type ISendChatGptDataProps = { | ||
res: IRes | ||
finish_reason: string | null | ||
msg?: string | ||
tojson?: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.