Skip to content

Commit 864fcfa

Browse files
committed
Add GEMINI_MODEL_NAME environment variable and update related scripts
- Introduced GEMINI_MODEL_NAME to .env.example and src/env.d.ts for customizable model selection. - Updated docker-env-replace.sh to utilize the new GEMINI_MODEL_NAME variable in the environment setup.
1 parent 326a6d1 commit 864fcfa

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ HEAD_SCRIPTS=
88
PUBLIC_SECRET_KEY=
99
# Set password for site, support multiple password separated by comma. If not set, site will be public
1010
SITE_PASSWORD=
11+
# Customize the Gemini model to use. Defaults to gemini-2.5-flash if not set
12+
GEMINI_MODEL_NAME=
1113
# Set the maximum number of historical messages used for contextual contact
1214
PUBLIC_MAX_HISTORY_MESSAGES=

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ services:
1515
# - PUBLIC_SECRET_KEY=YOUR_SECRET_KEY
1616
# - SITE_PASSWORD=YOUR_SITE_PASSWORD
1717
# - OPENAI_API_MODEL=YOUR_OPENAI_API_MODEL
18+
# - GEMINI_MODEL_NAME=gemini-2.5-flash
1819

hack/docker-env-replace.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public_secret_key=$PUBLIC_SECRET_KEY
1414
site_password=$SITE_PASSWORD
1515
# ID of the model to use. https://platform.openai.com/docs/api-reference/models/list
1616
openai_api_model=$OPENAI_API_MODEL
17+
# Customize the Gemini model to use
18+
gemini_model_name=$GEMINI_MODEL_NAME
1719

1820
for file in $(find ./dist -type f -name "*.mjs"); do
1921
sed "s|({}).GEMINI_API_KEY|\"$gemini_api_key\"|g;
@@ -22,6 +24,7 @@ for file in $(find ./dist -type f -name "*.mjs"); do
2224
s|({}).HEAD_SCRIPTS|\"$head_scripts\"|g;
2325
s|({}).PUBLIC_SECRET_KEY|\"$public_secret_key\"|g;
2426
s|({}).OPENAI_API_MODEL|\"$openai_api_model\"|g;
27+
s|({}).GEMINI_MODEL_NAME|\"$gemini_model_name\"|g;
2528
s|({}).SITE_PASSWORD|\"$site_password\"|g" $file > tmp
2629
mv tmp $file
2730
done

src/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface ImportMetaEnv {
88
readonly PUBLIC_SECRET_KEY: string
99
readonly SITE_PASSWORD: string
1010
readonly OPENAI_API_MODEL: string
11+
readonly GEMINI_MODEL_NAME: string
1112
readonly PUBLIC_MAX_HISTORY_MESSAGES: string
1213
}
1314

0 commit comments

Comments
 (0)