mckaywrigley / chatbot-ui

AI chat for every model.
https://chatbotui.com
MIT License
27.48k stars 7.63k forks source link

Some environment variables from compose are ignored #535

Closed Xav-Pe closed 6 months ago

Xav-Pe commented 1 year ago

Hi,

I try to edit NEXT_PUBLIC_DEFAULT_TEMPERATURE and NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT (as renamed in this commit) in compose.yaml :

services:
  chat:
    container_name: chatbot-ui
    image: ghcr.io/mckaywrigley/chatbot-ui:main
    environment:
      TZ: 'Europe/Paris'
      OPENAI_API_KEY: "${OPENAI_API_KEY}"
      OPENAI_ORGANIZATION: MYORG
      NEXT_PUBLIC_DEFAULT_TEMPERATURE: 0.5
      NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT: Answer as if you were a duck

The OPENAI_API_KEY variable is correctly read, but NEXT_PUBLIC_DEFAULT_TEMPERATURE and NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT are ignored.

I thinks it was supposed to be fixed by this issue https://github.com/mckaywrigley/chatbot-ui/issues/388 but it seems it's still broken.

Thanks for the good work anyway.

Xav-Pe commented 1 year ago

Note that the environment variable is present in the container:

❯ docker exec chatbot-ui env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=7xxxxx
OPENAI_ORGANIZATION=org-xxxxx
NEXT_PUBLIC_DEFAULT_TEMPERATURE=0.5
NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT=Answer as if you were a duck
TZ=Europe/Paris
OPENAI_API_KEY=sk-xxxx
NODE_VERSION=19.9.0
YARN_VERSION
BakaKiller commented 1 year ago

Same problem here. I can't set the initial prompt with NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT ...

red-avtovo commented 11 months ago

Same here

newmedicine commented 10 months ago

+1

johnbui92 commented 10 months ago

+1

ThomasOrlita commented 8 months ago

Not a fix, but you can monkey patch it using the following command:

find / -type f -name '*.js' -exec sed -i 's/You are ChatGPT, a large language model trained by OpenAI. Follow the user'\''s instructions carefully. Respond using markdown./MY CUSTOM PROMPT HERE /g' {} \;