Skip to content

Commit

Permalink
Merge pull request babaohuang#25 from antergone/feature/env_variable
Browse files Browse the repository at this point in the history
replace openai_api_base_url to api_base_url
  • Loading branch information
babaohuang authored Dec 19, 2023
2 parents 2581e02 + b1f42c2 commit 2850aa3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Your API Key for GEMINI_API
GEMINI_API_KEY=
# Custom base url for OpenAI API. default: https://api.openai.com
# Custom base url for OpenAI API. default: https://generativelanguage.googleapis.com
API_BASE_URL=
# Inject analytics or other scripts before </head> of the page
HEAD_SCRIPTS=
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
environment:
- GEMINI_API_KEY=YOUR_GEMINI_API_KEY
# - HTTPS_PROXY=YOUR_HTTPS_PROXY
# - OPENAI_API_BASE_URL=YOUR_OPENAI_API_BASE_URL
# - API_BASE_URL=YOUR_GEMINI_API_BASE_URL
# - HEAD_SCRIPTS=YOUR_HEAD_SCRIPTS
# - PUBLIC_SECRET_KEY=YOUR_SECRET_KEY
# - SITE_PASSWORD=YOUR_SITE_PASSWORD
Expand Down
6 changes: 3 additions & 3 deletions hack/docker-env-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
gemini_api_key=$GEMINI_API_KEY
# Provide proxy for OpenAI API. e.g. http://127.0.0.1:7890
https_proxy=$HTTPS_PROXY
# Custom base url for OpenAI API. default: https://api.openai.com
openai_api_base_url=$OPENAI_API_BASE_URL
# Custom base url for OpenAI API. default: https://generativelanguage.googleapis.com
api_base_url=$API_BASE_URL
# Inject analytics or other scripts before </head> of the page
head_scripts=$HEAD_SCRIPTS
# Secret string for the project. Use for generating signatures for API calls
Expand All @@ -18,7 +18,7 @@ openai_api_model=$OPENAI_API_MODEL
for file in $(find ./dist -type f -name "*.mjs"); do
sed "s|({}).GEMINI_API_KEY|\"$gemini_api_key\"|g;
s|({}).HTTPS_PROXY|\"$https_proxy\"|g;
s|({}).OPENAI_API_BASE_URL|\"$openai_api_base_url\"|g;
s|({}).API_BASE_URL|\"$api_base_url\"|g;
s|({}).HEAD_SCRIPTS|\"$head_scripts\"|g;
s|({}).PUBLIC_SECRET_KEY|\"$public_secret_key\"|g;
s|({}).OPENAI_API_MODEL|\"$openai_api_model\"|g;
Expand Down
2 changes: 1 addition & 1 deletion src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
interface ImportMetaEnv {
readonly GEMINI_API_KEY: string
readonly HTTPS_PROXY: string
readonly OPENAI_API_BASE_URL: string
readonly API_BASE_URL: string
readonly HEAD_SCRIPTS: string
readonly PUBLIC_SECRET_KEY: string
readonly SITE_PASSWORD: string
Expand Down

0 comments on commit 2850aa3

Please sign in to comment.