Skip to content

Instantly share code, notes, and snippets.

@mberman84
Last active April 17, 2024 17:16
Show Gist options
  • Save mberman84/c565061fef57b692919d8856f8e30ffa to your computer and use it in GitHub Desktop.
Save mberman84/c565061fef57b692919d8856f8e30ffa to your computer and use it in GitHub Desktop.
ChatDev Installation
# need to have conda installed
# these are instructions for macOS
git clone https://github.com/OpenBMB/ChatDev.git
conda create -n ChatDev_conda_env python=3.9 -y
conda activate ChatDev_conda_env
cd ChatDev
pip3 install -r requirements.txt
set OPENAI_API_KEY=your_key
python run.py --task "[description_of_your_idea]" --name "[project_name]"
python3 online_log/app.py
@roguecamp
Copy link

I have windows 10 and have verified the OPEN_AI_KEY variable is set correctly but consistently get the error message:
result = fn(*args, **kwargs)
File "C:\Users\Campbell\ChatDev\camel\utils.py", line 147, in wrapper
raise ValueError('OpenAI API key not found.')

@Korner83
Copy link

I have windows 10 and have verified the OPEN_AI_KEY variable is set correctly but consistently get the error message: result = fn(*args, **kwargs) File "C:\Users\Campbell\ChatDev\camel\utils.py", line 147, in wrapper raise ValueError('OpenAI API key not found.')

setx OPENAI_API_KEY “” or set OPENAI_API_KEY=
after that:
echo %OPENAI_API_KEY%
to check your key's visibility. also on win10 you might need a restart

@roguecamp
Copy link

Thanks @Korner83 for the advice... yup tried all that successfully echo the key and restarted. The error persists... it's a mystery.

@Korner83
Copy link

Thanks @Korner83 for the advice... yup tried all that successfully echo the key and restarted. The error persists... it's a mystery.

If you use conda with virtual environment then you might need to set it in that environment as well.

@roguecamp
Copy link

It turned out to be much simpler... I had the env var set as OPEN_API_KEY instead of OPENAI_API_KEY doh! thanks so much tho

@Korner83
Copy link

It turned out to be much simpler... I had the env var set as OPEN_API_KEY instead of OPENAI_API_KEY doh! thanks so much tho

Yeyy I'm glad you solved it!

@jermaine-24x7
Copy link

jermaine-24x7 commented Oct 9, 2023

For line 8, I had to use:

export OPENAI_API_KEY=<your_key>

On MacOs(11.6.1) Terminal.

Ps - Great video. Thank you.

@MoNarchEnterprises
Copy link

If you are in your conda environment for windows use
conda env config vars set OPENAI_API_KEY="API_KEY"
to set the environment variables

@jez120
Copy link

jez120 commented Nov 2, 2023

anyone is getting this error(mac m1), tried installation 10 times already 3 hrs of googling with AI help how to solve this and still there :
(ChatDev_conda_env) adam@adam ChatDev % python run.py --task "[a todo app where users can add todo items, change todo items to complete them and delete and edit todo items]" --name "[todo]"
Traceback (most recent call last):
File "/Users/adam/ChatDev/run.py", line 82, in
chat_chain = ChatChain(config_path=config_path,
File "/Users/adam/ChatDev/chatdev/chat_chain.py", line 70, in init
incremental_develop=check_bool(self.config["incremental_develop"]))
KeyError: 'incremental_develop'
(ChatDev_conda_env) adam@adam ChatDev %

@yunwushanhe
Copy link

anyone is getting this error(mac m1), tried installation 10 times already 3 hrs of googling with AI help how to solve this and still there : (ChatDev_conda_env) adam@adam ChatDev % python run.py --task "[a todo app where users can add todo items, change todo items to complete them and delete and edit todo items]" --name "[todo]" Traceback (most recent call last): File "/Users/adam/ChatDev/run.py", line 82, in chat_chain = ChatChain(config_path=config_path, File "/Users/adam/ChatDev/chatdev/chat_chain.py", line 70, in init incremental_develop=check_bool(self.config["incremental_develop"])) KeyError: 'incremental_develop' (ChatDev_conda_env) adam@adam ChatDev %

I have also encountered this error and haven't found a solution yet. Have you resolved it?

@f-elephant
Copy link

Hello there I have an issue with a (I'm absolutely new) "conda create -n ChatDev_conda_env python=3.9 -y
conda activate ChatDev_conda_env" (conda create -n ChatDev_conda_env python=3.9 -y
'conda' is not recognized as an internal or external command,
operable program or batch file.) what should I do?

@DiegoRenau
Copy link

just an update: python3 visualizer/app.py to load the server and access to the website.
Great video!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment