Open universeroc opened 1 year ago
did you actually deploy an model instance named "gpt-35-turbo" in your account? in azure you need to deploy them before you can use them, the name can be anything you want
did you actually deploy an model instance named "gpt-35-turbo" in your account? in azure you need to deploy them before you can use them, the name can be anything you want
Yes, thanks for your reply. It's the key to this error. And after I correct it, and run into this error:
2023-08-20 11:58:51.660 | INFO | metagpt.software_company:invest:39 - Investment: $3.0.
2023-08-20 11:58:51.661 | INFO | metagpt.roles.role:_act:166 - Alice(Product Manager): ready to WritePRD
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in __call__
result = await fn(*args, **kwargs)
File "/app/metagpt/metagpt/actions/action.py", line 62, in _aask_v1
instruct_content = output_class(**parsed_data)
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
## Original Requirements:
The boss wants you to create a command-line interface (CLI) snake game.
## Product Goals:
- Create a fun and engaging snake game that can be played on the command-line interface.
- Provide a simple and intuitive user interface that allows users to easily control the snake.
- Ensure that the game is challenging enough to keep users engaged and coming back for more.
## User Stories:
- As a player, I want to be able to control the snake using simple keyboard commands so that I can focus on playing the game.
- As a player, I want the game to be challenging enough to keep me engaged, but not so difficult that it becomes frustrating.
- As a player, I want to be able to see my score and high score so that I can track my progress.
- As a player, I want the game to be visually appealing so that it is more enjoyable to play.
- As a player, I want the game to have sound effects so that it is more immersive.
## Competitive Analysis:
- Python Snake Game: A simple snake game that can be played on the command-line interface.
- Snake VS Block: A popular mobile game where players control a snake and try to break blocks to score points.
- Slither.io: A multiplayer online game where players control a snake and try to eat as many pellets as possible while avoiding other snakes.
- Snake Game: A classic snake game that can be played on a web browser.
- Snake '97: A mobile game that emulates the classic snake game from the Nokia 3310.
- Snake Mania: A mobile game that adds power-ups and other features to the classic snake game.
- Snake Rattle 'n' Roll: A classic snake game for the Nintendo Entertainment System.
## Competitive Quadrant Chart:
```mermaid
quadrantChart
title Reach and engagement of command-line snake games
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 Nostalgia
quadrant-2 Classic
quadrant-3 Innovative
quadrant-4 Experimental
"Python Snake Game": [0.3, 0.6]
"Our Target Product": [0.5, 0.8]
"Snake Game": [0.4, 0.4]
"Snake '97": [0.6, 0.3]
"Snake Mania": [0.7, 0.5]
"Snake Rattle 'n' Roll": [0.2, 0.2]
"Slither.io": [0.9, 0.9]
The product should be a command-line interface (CLI) snake game that is fun and engaging to play. It should have simple and intuitive controls, and be challenging enough to keep players engaged. The game should have a visual design that is appealing to players, and should include sound effects to enhance the playing experience.
The game will have a simple layout with the game board taking up most of the screen. The snake will be represented by a series of characters that move across the board. The food will be represented by a different character that appears randomly on the board. The player's score and high score will be displayed at the top of the screen. The game will have a simple color scheme with contrasting colors for the snake, food, and background. The controls will be displayed at the bottom of the screen and will be simple arrow keys for movement.
There are no unclear points.
The boss wants you to create a command-line interface (CLI) snake game.
quadrantChart
title Reach and engagement of CLI snake games
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 Rust Snake CLI
quadrant-2 C++ Snake Game CLI
quadrant-3 Python Snake Game
quadrant-4 Our Target Product
"Snake Game": [0.8, 0.8]
"Snake Zone": [0.7, 0.6]
"Snake VS Block": [0.6, 0.5]
"Slither.io": [0.9, 0.9]
The product should be a CLI snake game that is easy to play and challenging enough to keep users engaged. The game should have a simple interface that allows users to control the snake using keyboard commands. The game should also keep track of the user's score and progress and allow them to start a new game easily.
The game will be displayed in the command line interface. The snake will be represented by a series of characters, and the food will be represented by a different character. The user will control the snake using the arrow keys on their keyboard. The score and game status will be displayed at the top of the screen. The game will have a simple and clean design, with a black background and white characters.
There are no unclear points. pydantic.error_wrappers.ValidationError: 5 validation errors for prd Requirement Pool -> 0 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 1 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 2 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 3 value is not a valid tuple (type=type_error.tuple) Requirement Pool -> 4 value is not a valid tuple (type=type_error.tuple)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/metagpt/startup.py", line 36, in
For key.yaml
OPENAI_API_TYPE: "azure"
OPENAI_API_BASE: "https://****.openai.azure.com/"
OPENAI_API_KEY: "*****"
OPENAI_API_VERSION: "0613"
DEPLOYMENT_ID: "gpt-35-turbo"
run python examples/llm_hello_world.py
(ml-env) ➜ MetaGPT git:(main) ✗ python examples/llm_hello_world.py
2023-08-23 10:38:18.759 | INFO | metagpt.config:__init__:44 - Config loading done.
Traceback (most recent call last):
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/examples/llm_hello_world.py", line 31, in <module>
asyncio.run(main())
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/examples/llm_hello_world.py", line 17, in main
logger.info(await claude.aask('你好,请进行自我介绍'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/metagpt-0.1-py3.11.egg/metagpt/provider/anthropic_api.py", line 29, in aask
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 253, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/resources/completions.py", line 225, in create
return self._post(
^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/_base_client.py", line 925, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/_base_client.py", line 724, in request
return self._request(
^^^^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/_base_client.py", line 742, in _request
request = self._build_request(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/_base_client.py", line 394, in _build_request
headers = self._build_headers(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/_base_client.py", line 368, in _build_headers
self._validate_headers(headers_dict, custom_headers)
File "/Users/elvizlai/workspace/elvizlai/MetaGPT/ml-env/lib/python3.11/site-packages/anthropic/_client.py", line 159, in _validate_headers
raise TypeError(
TypeError: "Could not resolve authentication method. Expected either api_key or auth_token to be set. Or for one of the `X-Api-Key` or `Authorization` headers to be explicitly omitted"
DEPLOYMENT_ID: "gpt-35-turbo"
check it, make sure your deployment id is "gpt-35-turbo"
This problem actually comes from the poor Instruction Following of gpt-3.5-turbo. gpt-4 basically does not have this problem
(metagpt) D:\AI\metagpt>python startup.py "Write a cli snake game based on pygame" --code_review True 2023-09-19 16:54:26.078 | INFO | metagpt.config:init:44 - Config loading done. 2023-09-19 16:54:28.107 | INFO | metagpt.software_company:invest:39 - Investment: $3.0. 2023-09-19 16:54:28.108 | INFO | metagpt.roles.role:_act:167 - Alice(Product Manager): ready to WritePRD
The boss has requested the creation of a command-line interface (CLI) snake game based on pygame.
[
"Create a simple and fun CLI snake game using pygame",
"Ensure the game runs smoothly and efficiently",
"Make the game easy to install and play"
]
[
"As a user, I want to be able to easily install the game so that I can start playing quickly",
"As a player, I want the game to run smoothly so that I can enjoy the gameplay",
"As a player, I want the controls to be intuitive and responsive so that I can effectively control the snake",
"As a player, I want to be able to see my score so that I can track my progress",
"As a player, I want the game to increase in difficulty as my score increases so that the game remains challenging"
]
[
"Python Snake Game: A simple CLI snake game. It lacks smooth gameplay and advanced features",
"Pygame Snake: A more advanced snake game with a graphical interface. It may be too complex for our target audience",
"CLI Snake: A CLI snake game with a high score feature. It lacks the smooth gameplay we aim for",
"Snake Game: A popular online snake game with a graphical interface. It may be too complex and not CLI-based",
"Terminal Snake: A CLI snake game with smooth gameplay but lacks advanced features"
]
quadrantChart
title Reach and engagement of campaigns
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.2, 0.3]
"Pygame Snake": [0.7, 0.6]
"CLI Snake": [0.3, 0.4]
"Snake Game": [0.8, 0.7]
"Terminal Snake": [0.4, 0.5]
"Our Target Product": [0.5, 0.6]
The product should be a CLI-based snake game developed using pygame. It should offer smooth gameplay, intuitive controls, and a scoring system. The game should also increase in difficulty as the player's score increases. The game should be easy to install and play.
[
("Develop a CLI-based snake game using pygame", "P0"),
("Ensure smooth and responsive gameplay", "P0"),
("Implement intuitive controls for the snake", "P0"),
("Include a scoring system", "P0"),
("Increase game difficulty as score increases", "P1"),
("Ensure easy installation and play", "P0")
]
The game will be a CLI-based application. The game area will be represented as a grid in the terminal. The snake will be represented by a line of characters that moves around the grid. The food for the snake will be represented by a different character. The score will be displayed at the top of the terminal. The controls will be the arrow keys.
There are no unclear points. Warning: gpt-4 may update over time. Returning num tokens assuming gpt-4-0613. 2023-09-19 16:54:50.546 | INFO | metagpt.provider.openai_api:update_cost:89 - Total running cost: $0.068 | Max budget: $3.000 | Current cost: $0.068, prompt_tokens: 845, completion_tokens: 717 2023-09-19 16:54:50.577 | INFO | metagpt.roles.role:_act:167 - Bob(Architect): ready to WriteDesign
We will use the open-source library pygame for creating the game. The game will be developed in a modular manner with separate classes for the game, the snake, and the food. The game will be controlled via the keyboard arrow keys. The game will start with a single food item and a snake of length one. The snake will grow in length each time it eats food. The game will end when the snake hits the boundary or itself. The score will be displayed on the terminal and will increase each time the snake eats food. The difficulty level will increase as the score increases by reducing the delay between each move of the snake.
"cli_snake_game"
[
"main.py",
"game.py",
"snake.py",
"food.py"
]
classDiagram
class Game{
+int score
+int level
+bool game_over
+Snake snake
+Food food
+start_game()
+end_game()
+increase_difficulty()
}
class Snake{
+list body
+str direction
+move()
+grow()
+check_collision()
}
class Food{
+tuple position
+generate_food()
}
Game "1" -- "1" Snake: has
Game "1" -- "1" Food: has
sequenceDiagram
participant M as Main
participant G as Game
participant S as Snake
participant F as Food
M->>G: create game
G->>S: create snake
G->>F: create food
M->>G: start game
loop game not over
G->>S: move snake
G->>S: check collision
G->>F: check if food eaten
G->>G: increase score
G->>G: increase difficulty
end
G->>M: end game
The requirement is clear to me.
Warning: gpt-4 may update over time. Returning num tokens assuming gpt-4-0613.
2023-09-19 16:55:08.392 | INFO | metagpt.provider.openai_api:update_cost:89 - Total running cost: $0.133 | Max budget: $3.000 | Current cost: $0.065, prompt_tokens: 1240, completion_tokens: 463
C:\Program Files\nodejs\mmdc
C:\Program Files\nodejs\mmdc.cmd
2023-09-19 16:55:08.472 | INFO | metagpt.utils.mermaid:mermaid_to_file:44 - Generating D:\AI\metagpt\workspace\cli_snake_game\resources\competitive_analysis.pdf..
Traceback (most recent call last):
File "D:\AI\metagpt\startup.py", line 72, in
I getting this type of error
i have tested with gpt 4 and gpt 4-32k
I configure the key.yaml as follows:
and run as:
but run into this error in Windows 11 WSL: