MetaGPT
MetaGPT copied to clipboard
TypeError: issubclass() arg 1 must be a class
(base) dope@dope:~/Documents/metagpt$ python startup.py "Write a cli snake game"
2023-07-12 19:22:49.402 | INFO | metagpt.config:init:43 - Config loading done.
2023-07-12 19:22:49.402 | INFO | metagpt.config:init:49 - Set OPENAI_API_BASE in case of network issues
Traceback (most recent call last):
File "/home/dope/Documents/metagpt/startup.py", line 5, in
Pull again and retry. I've removed langchain.
Thanks! There still seemed to be an error.
My environment details: Created a conda environment named mgpt with python 3.9 installed cause it just dont work with the latest 3.10/11
GPT version: 3.5-turbo MAX_TOKENS: 1500 RPM: 10
Output: (mgpt) dope@dope:~/Documents/MetaGPT$ python startup.py "Create a cli snake game" 2023-07-13 02:46:38.155 | INFO | metagpt.config:init:43 - Config loading done. 2023-07-13 02:46:38.155 | INFO | metagpt.config:init:49 - Set OPENAI_API_BASE in case of network issues 2023-07-13 02:46:38.981 | INFO | metagpt.software_company:invest:39 - Investment: $3.0. 2023-07-13 02:46:38.982 | INFO | metagpt.roles.role:_act:155 - Alice(Product Manager): ready to WritePRD 2023-07-13 02:46:38.982 | WARNING | metagpt.actions.search_and_summarize:run:114 - Configure SERPAPI_API_KEY to unlock full feature
Original Requirements:
The boss wants you to create a command-line snake game.
Product Goals:
- Create a fun and engaging snake game.
- Provide a user-friendly command-line interface.
- Ensure smooth and responsive gameplay.
User Stories:
- As a player, I want to control the snake using arrow keys.
- As a player, I want to see my score and the length of the snake on the screen.
- As a player, I want the game to end if the snake hits the wall or itself.
- As a player, I want the speed of the snake to increase as I score more points.
- As a player, I want to be able to pause and resume the game.
Competitive Analysis:
- Python Snake Game: A simple snake game implemented in Python with basic features.
- CLI Snake: A command-line snake game with customizable settings and high scores.
- Terminal Snake: A snake game with a retro-style interface and challenging gameplay.
- Snake CLI: A snake game with power-ups and different game modes.
- Snake Terminal: A snake game with colorful graphics and smooth controls.
- Snake Game: A classic snake game with multiple levels and obstacles.
- Snake Console: A snake game with customizable settings and leaderboard.
Competitive Quadrant Chart:
quadrantChart
title Reach and engagement of snake games
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 Simple and basic
quadrant-2 Customizable and feature-rich
quadrant-3 Retro-style and challenging
quadrant-4 Colorful and smooth
"Python Snake Game": [0.2, 0.3]
"CLI Snake": [0.4, 0.5]
"Terminal Snake": [0.3, 0.6]
"Snake CLI": [0.5, 0.7]
"Snake Terminal": [0.6, 0.8]
"Snake Game": [0.7, 0.4]
"Snake Console": [0.5, 0.6]
"Our Target Product": [0.6, 0.7]
Requirement Analysis:
The product should be a command-line snake game with smooth controls, responsive gameplay, and a user-friendly interface. It should have basic features such as controlling the snake with arrow keys, displaying the score and snake length, and ending the game if the snake hits the wall or itself. The game should also increase the speed of the snake as the player scores more points and allow pausing and resuming the game.
Requirement Pool:
[
("End game if snake hits the wall or itself", "P0"),
("Display score and snake length on the screen", "P1"),
("Increase snake speed as the player scores more points", "P1"),
("Allow pausing and resuming the game", "P2")
]
Anything UNCLEAR:
There are no unclear points. Warning: gpt-3.5-turbo may change over time. Returning num tokens assuming gpt-3.5-turbo-0301. 2023-07-13 02:46:54.571 | INFO | metagpt.provider.openai_api:update_cost:89 - Total running cost: $0.003 | Max budget: $3.000 | Current cost: $0.003, prompt_tokens=800, completion_tokens=622
Original Requirements:
The boss wants us to create a command-line interface (CLI) snake game.
Product Goals:
- Create a fun and engaging snake game that can be played in the command line.
- Provide a smooth and responsive user experience.
- Implement various game modes and difficulty levels to cater to different players.
User Stories:
- As a user, I want to be able to control the snake using the arrow keys.
- As a user, I want to see my score and the length of the snake displayed on the screen.
- As a user, I want to be able to pause and resume the game at any time.
- As a user, I want to be able to choose different game modes and difficulty levels.
- As a user, I want to be able to restart the game after losing.
Competitive Analysis:
- Python Snake Game: A simple snake game implemented in Python with basic features.
- CLI Snake: A command-line snake game with additional power-ups and obstacles.
- Terminal Snake: A snake game with a minimalist design and smooth controls.
- Snake CLI: A snake game with customizable colors and different game modes.
- Retro Snake: A classic snake game with retro graphics and sound effects.
- Snake Terminal: A snake game with a customizable play area and adjustable speed.
- ASCII Snake: A snake game with ASCII art graphics and multiple difficulty levels.
Competitive Quadrant Chart:
quadrantChart
title Reach and engagement of snake games
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
"Python Snake Game": [0.3, 0.6]
"CLI Snake": [0.45, 0.23]
"Terminal Snake": [0.57, 0.69]
"Snake CLI": [0.78, 0.34]
"Retro Snake": [0.40, 0.34]
"Snake Terminal": [0.35, 0.78]
"ASCII Snake": [0.6, 0.7]
"Our Target Product": [0.5, 0.6]
Requirement Analysis:
The product should be a command-line snake game with smooth controls, multiple game modes, and difficulty levels. It should display the score and length of the snake on the screen. The game should allow the user to pause and resume at any time and provide the option to restart after losing. The design should be simple and intuitive, providing a smooth and responsive user experience.
Requirement Pool:
[
("End game condition when the snake collides with the wall or itself", "P0"),
("Implement different game modes (e.g., classic, timed, endless)", "P1"),
("Implement different difficulty levels (e.g., easy, medium, hard)", "P1"),
("Display the current score and length of the snake on the screen", "P2"),
("Allow the user to pause and resume the game at any time", "P2")
]
Anything UNCLEAR:
There are no unclear points. Warning: gpt-3.5-turbo may change over time. Returning num tokens assuming gpt-3.5-turbo-0301. 2023-07-13 02:47:12.651 | INFO | metagpt.provider.openai_api:update_cost:89 - Total running cost: $0.006 | Max budget: $3.000 | Current cost: $0.003, prompt_tokens=800, completion_tokens=674 Traceback (most recent call last): File "/home/dope/anaconda3/envs/mgpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "/home/dope/Documents/MetaGPT/metagpt/actions/action.py", line 60, in _aask_v1 instruct_content = output_class(**parsed_data) File "pydantic/main.py", line 331, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 3 validation errors for prd Product Goals value is not a valid list (type=type_error.list) User Stories value is not a valid list (type=type_error.list) Competitive Analysis value is not a valid list (type=type_error.list)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/dope/Documents/MetaGPT/startup.py", line 29, in
This problem stems from the fact that gpt-3.5-turbo instruction follow is not stable enough (the success rate is about 30% visually, but it changes with the demand), gpt-4 will be much more stable (almost 100%)
we're working in progress to improve the succ rate of gpt-3.5-turbo, but it still need time. https://github.com/geekan/MetaGPT/pull/37
meanwhile, another issue is we cannot call browser / browser core in the docker and the mermaid graph is not generating @voidking
https://github.com/geekan/MetaGPT/pull/41 and https://github.com/geekan/MetaGPT/pull/43 almost fix this issue. pull & retry.