dotneet / smart-chatbot-ui

An open source ChatGPT UI.
https://smart-chatbot-ui.vercel.app/
MIT License
468 stars 99 forks source link

Is environment variable NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT working ? #111

Open Dessoul opened 1 year ago

Dessoul commented 1 year ago

Hi !

Thank you for the nice tool.

I am settting custom value for NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT environement variable (in .env.local).

But it has no effect. When I am running the docker I get always the exact same standard pre-prompt. Is is normal ?

iguy0 commented 1 year ago

Not normal. Docker-compose is not picking up the envs. This ended up "working" for me: (I'm still running into other issues)

`version: '3.6'

services: chatbot: container_name: chatbot build: . ports:

volumes: mongodb-data: name: chatui-mongodb-data mongodb-configdb: name: chatui-mongodb-configdb `

Please note the .env file being picked up here:

env_file:
  - .env.local

Cheers! Good luck.

Dessoul commented 1 year ago

Hi !

Thank you for your anwser.

I edited my post becasue indeed I was confusing.

I modified the NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT in the .env.local file.

And still it has no effect.

If you modifiy it in the .env.local file, do you see any effect after you deploy it on the default prompt ?

jerkstorecaller commented 1 year ago

@iguy0 , do you actually see a modified prompt when you load the webpage? It uses the default even when I use your compose file.

1h8fulkat commented 12 months ago

"The issue with next js build not having the environment variables is caused by how next js looks up environment variables. It requires a .env.local to be present, which is not present in the docker build step. The reason is that it's included in the .dockerignore, so the context doesn't have a .env.local."

See this issue for the original repo for the solution to the docker container not getting the NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT env variable:

https://github.com/mckaywrigley/chatbot-ui/pull/904