Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydantic_core._pydantic_core.ValidationError: 1 validation error for Config #1220

Closed
1027548366 opened this issue Apr 23, 2024 · 1 comment
Closed

Comments

@1027548366
Copy link

D:\MetaGPT-main\venv\Scripts\python.exe D:/MetaGPT-main/test.py
2024-04-23 17:14:39.661 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to D:\MetaGPT-main
Traceback (most recent call last):
File "D:\MetaGPT-main\test.py", line 3, in
repo: ProjectRepo = generate_repo("Create a 2048 game") # or ProjectRepo("")
File "D:\MetaGPT-main\metagpt\software_company.py", line 30, in generate_repo
from metagpt.config2 import config
File "D:\MetaGPT-main\metagpt\config2.py", line 164, in
config = Config.default()
File "D:\MetaGPT-main\metagpt\config2.py", line 106, in default
return Config(**final)
File "D:\MetaGPT-main\venv\lib\site-packages\pydantic\main.py", line 164, in init
pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Config
llm.api_key
Value error, Please set your API key in config2.yaml [type=value_error, input_value='YOUR_API_KEY', input_type=str]
For further information visit https://errors.pydantic.dev/2.5/v/value_error

I've written the config as to why this is still the case???
微信图片_20240423172525

@seehi
Copy link
Contributor

seehi commented Apr 23, 2024

Try to create .metagpt in the user's root directory, such as C:\Users\x\.metagpt\config2.yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants