Skip to content

Commit

Permalink
chore: default API_REVERSE_PROXY
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanzhaoyu committed Apr 3, 2023
1 parent 553e239 commit c2b25a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion service/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OPENAI_API_DISABLE_DEBUG=
# Reverse Proxy - Available on accessToken
# Default: https://bypass.churchless.tech/api/conversation
# More: https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy
API_REVERSE_PROXY=https://bypass.churchless.tech/api/conversation
API_REVERSE_PROXY=

# timeout
TIMEOUT_MS=100000
Expand Down
6 changes: 4 additions & 2 deletions service/src/chatgpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
accessToken: process.env.OPENAI_ACCESS_TOKEN,
debug: !disableDebug,
}

if (isNotEmptyString(OPENAI_API_MODEL))
options.model = OPENAI_API_MODEL

if (isNotEmptyString(process.env.API_REVERSE_PROXY))
options.apiReverseProxyUrl = process.env.API_REVERSE_PROXY
options.apiReverseProxyUrl = isNotEmptyString(process.env.API_REVERSE_PROXY)
? process.env.API_REVERSE_PROXY
: 'https://bypass.churchless.tech/api/conversation'

setupProxy(options)

Expand Down

0 comments on commit c2b25a8

Please sign in to comment.