geekan / MetaGPT

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
https://deepwisdom.ai/
MIT License
43.59k stars 5.19k forks source link

Regarding Zhipu, API usage error message, unable to run normally #781

Open xiaodidiyou opened 7 months ago

xiaodidiyou commented 7 months ago

PS D:\MetaGPT-0.6.4> metagpt "写一个贪吃蛇游戏"
2024-01-21 10:49:54.444 | INFO | metagpt.const:get_metagpt_package_root:32 - Package root set to d:\metagpt-0.6.4 2024-01-21 10:49:54.510 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI 2024-01-21 10:49:55.727 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI 2024-01-21 10:49:55.735 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI 2024-01-21 10:49:55.737 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI 2024-01-21 10:49:55.737 | INFO | metagpt.config:get_default_llm_provider_enum:126 - API: LLMProviderEnum.ZHIPUAI 2024-01-21 10:49:55.737 | INFO | metagpt.team:invest:86 - Investment: $3.0. 2024-01-21 10:49:55.737 | INFO | metagpt.roles.role:_act:357 - Alice(Product Manager): to do PrepareDocuments(PrepareDocuments) 2024-01-21 10:49:55.989 | INFO | metagpt.utils.file_repository:save:60 - save to: D:\MetaGPT-0.6.4\workspace\20240121104955\docs\requirement.txt 2024-01-21 10:49:56.001 | INFO | metagpt.roles.role:_act:357 - Alice(Product Manager): to do WritePRD(WritePRD) [CONTENT] { "Language": "en_us", "Programming Language": "Python", "Original Requirements": "Create a snake game", "Project Name": "snake_game", "Product Goals": [ "Create an engaging and addictive game", "Ensure the game is responsive and accessible", "Design a beautiful and intuitive user interface" ], "User Stories": [ "As a player, I want to be able to control the snake with ease", "As a player, I want to see my score after each game", "As a player, I want to start a new game with a simple click", "As a player, I want to be able to choose different skin for the snake", "As a player, I want to play the game on my mobile device" ], "Competitive Analysis": [ "Snake Game A: Basic gameplay, poor graphics", "Snake Game B: Beautiful graphics, but difficult to control", "Snake Game C: Simple and intuitive interface, but lack of customization options", "Snake Game D: Responsive design, but ads are annoying", "Snake Game E: High score tracking, but difficult to play on mobile" ], "Competitive Quadrant Chart": "quadrantChart\n title \"Snake Game Competitive Analysis\"\n x-axis \"User Experience\"\n y-axis \"Gameplay and Control\"\n quadrant-1 \"Strong Player Engagement\"\n quadrant-2 \"Need Improvement: Gameplay\"\n quadrant-3 \"Need Improvement: User Experience\"\n quadrant-4 \"May be improved: Ads and Customization\"\n \"Snake Game A\": [0.5, 0.3]\n \"Snake Game B\": [0.8, 0.5]\n \"Snake Game C\": [0.7, 0.6]\n \"Snake Game D\": [0.9, 0.4]\n \"Snake Game E\": [0.6, 0.5]", "Requirement Analysis": "", "Requirement Pool": [ [ "P0", "The main game loop and controls ..." ], [ "P1", "The snake's movement and collision detection ..." ], [ "P2", "The user interface, including score display and game restart button ..." ], [ "P3", "The snake skin customization feature ..." ], [ "P4", "The game's responsiveness and accessibility on different devices ..." ] ], "UI Design draft": "A simple and intuitive interface with a clear layout. The snake will be represented by a rectangle, and the food will be a circle. The background color can be changed to match the selected skin. The score will be displayed on the top center of the screen, and a restart button will be placed on the bottom center.", "Anything UNCLEAR": "" } [/2024-01-21 10:50:35.640 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1115, completion_tokens: 753 2024-01-21 10:50:35.646 | INFO | metagpt.utils.git_repository:rename_root:200 - Delete directory D:\MetaGPT-0.6.4\workspace\snake_game 2024-01-21 10:50:35.683 | WARNING | metagpt.utils.git_repository:rename_root:208 - Move D:\MetaGPT-0.6.4\workspace\20240121104955 to D:\MetaGPT-0.6.4\workspace\snake_game error: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'D:\MetaGPT-0.6.4\workspace\20240121104955' 2024-01-21 10:50:35.684 | INFO | metagpt.utils.git_repository:rename_root:213 - Rename directory D:\MetaGPT-0.6.4\workspace\20240121104955 to D:\MetaGPT-0.6.4\workspace\snake_game 2024-01-21 10:50:35.794 | INFO | metagpt.utils.file_repository:save:60 - save to: D:\MetaGPT-0.6.4\workspace\snake_game\docs\prds\20240121105035.json C:\Users\陈成\AppData\Roaming\npm\mmdc C:\Users\陈成\AppData\Roaming\npm\mmdc.cmd 2024-01-21 10:50:35.917 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\competitive_analysis\20240121105035.pdf.. 2024-01-21 10:50:37.223 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:50:37.223 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\competitive_analysis\20240121105035.svg.. 2024-01-21 10:50:38.373 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:50:38.373 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\competitive_analysis\20240121105035.png.. 2024-01-21 10:50:39.643 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:50:39.643 | INFO | metagpt.utils.file_repository:save:60 - save to: D:\MetaGPT-0.6.4\workspace\snake_game\resources\prd\20240121105035.md 2024-01-21 10:50:39.643 | INFO | metagpt.roles.role:_act:357 - Bob(Architect): to do WriteDesign(WriteDesign) CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": [ "main.py", "game.py", "ui.py", "skins.py" ], "Data structures and interfaces": "\nclass SnakeGame:\n def init(self):\n self.screen = pygame.display.set_mode((800, 600))\n self.clock = pygame.time.Clock()\n self.snake = Snake()\n self.food = Food()\n self.skin_manager = SkinManager()\n def run(self):\n while True:\n self.update()\n self.draw()\n pygame.display.flip()\n self.clock.tick(10)\n def update(self):\n self.snake.move()\n self.food.spawn()\n if self.snake.collide(self.food):\n self.score += 1\n self.snake.grow()\n def draw(self):\n self.screen.fill((0, 0, 0))\n self.snake.draw(self.screen)\n self.food.draw(self.screen)\n font = pygame.font.Font(None, 36)\n score_text = font.render(f"Score: {self.score}", True, (255, 255, 255))\n self.screen.blit(score_text, (10, 10))\n def change_skin(self):\n self.skin_manager.change_skin()\n class Snake:\n def init(self):\n self.positions = [(400, 300)]\n self.direction = (0, -10)\n def move(self):\n
new_position = (self.positions[0][0] + self.direction[0], self.positions[0][1] + self.direction[1])\n self.positions.insert(0, new_position)\n
self.positions.pop()\n def draw(self, screen):\n for position in self.positions:\n pygame.draw.rect(screen, (255, 255, 255), (position[0], position[1], 50, 50))\n class Food:\n def init(self):\n self.position = (random.randint(0, 799), random.randint(0, 599))\n def draw(self, screen):\n pygame.draw.rect(screen, (255, 0, 0), (self.position[0], self.position[1], 50, 50))\n class SkinManager:\n def init(self):\n self.skins = ["default", "blue", "green", "red"]\n self.current_skin = 0\n def change_skin(self):\n self.current_skin = (self.current_skin + 1) % len(self.skins)\n self.snake.skin = self.skins[self.current_skin]\n "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant SG as SnakeGame\n participant F as Food\n participant SM as SkinManager\n M->>SG: run()\n SG->>F: spawn()\n SG->>SM: change_skin()\n", "Anything UNCLEAR": "None" } [/2024-01-21 10:51:29.414 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 1457, completion_tokens: 950 2024-01-21 10:51:29.424 | WARNING | metagpt.utils.repair_llm_raw_output:run_and_passon:235 - parse json from content inside [CONTENT][/CONTENT] failed at retry 1, try to fix it, exp: Expecting ',' delimiter: line 9 column 839 (char 1155) 2024-01-21 10:51:29.427 | INFO | metagpt.utils.repair_llm_raw_output:repair_invalid_json:204 - repair_invalid_json, raw error: Expecting ',' delimiter: line 9 column 839 (char 1155) 2024-01-21 10:51:30.439 | WARNING | metagpt.utils.repair_llm_raw_output:run_and_passon:235 - parse json from content inside [CONTENT][/CONTENT] failed at retry 2, try to fix it, exp: Expecting ',' delimiter: line 9 column 835 (char 1151) 2024-01-21 10:51:30.448 | INFO | metagpt.utils.repair_llm_raw_output:repair_invalid_json:204 - repair_invalid_json, raw error: Expecting ',' delimiter: line 9 column 835 (char 1151) 2024-01-21 10:51:31.454 | WARNING | metagpt.utils.repair_llm_raw_output:run_and_passon:235 - parse json from content inside [CONTENT][/CONTENT] failed at retry 3, try to fix it, exp: Expecting ',' delimiter: line 9 column 835 (char 1151) 2024-01-21 10:51:31.458 | INFO | metagpt.utils.repair_llm_raw_output:repair_invalid_json:204 - repair_invalid_json, raw error: Expecting ',' delimiter: line 9 column 835 (char 1151) 2024-01-21 10:51:31.458 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 51.500(s), this was the 1st time calling it. exp: RetryError[<Future at 0x294c4e7d930 state=finished raised JSONDecodeError>] CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": [ "main.py", "game.py", "ui.py", "skins.py" ], "Data structures and interfaces": "\nclass SnakeGame:\n def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0 \nclass Snake:\n def init(self): self.body = [(20, 200), (20, 210), (20, 220)] self.direction = (0, -10) \nclass Food:\n def init(self): self.position = (randint(1, (800-20)//20) 20, randint(1, (600-20)//20) 20) \ndef main():\n game = SnakeGame()\n while True:\n game.update()\n game.draw()\n pygame.display.flip()\n if game.check_collision():\n game.reset()\nif name == 'main':\n main()\n", "Program call flow": "\nsequenceDiagram\n participant M as Main\n participant S as Snake\n participant F as Food\n participant UI as UserInterface\n participant SC as SkinChooser\n M->>S: start_game()\n S->>F: generate_food()\n S->>UI: set_ui()\n S->>M: update()\n S->>UI: draw_ui()\n M->>S: check_collision()\n S->>F: check_eat()\n S->>UI: update_ui()\n S->>M: reset()\n UI->>M: handle_events()\n SC->>UI: get_skin()\n UI->>S: set_skin()\n", "Anything UNCLEAR": "None" } [/2024-01-21 10:52:04.394 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.002 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1457, completion_tokens: 620 2024-01-21 10:52:04.415 | INFO | metagpt.utils.file_repository:save:60 - save to: D:\MetaGPT-0.6.4\workspace\snake_game\docs\system_design\20240121105035.json 2024-01-21 10:52:04.419 | INFO | metagpt.utils.file_repository:save:65 - update dependency: D:\MetaGPT-0.6.4\workspace\snake_game\docs\system_design\20240121105035.json:{'docs\prds\20240121105035.json'} C:\Users\陈成\AppData\Roaming\npm\mmdc C:\Users\陈成\AppData\Roaming\npm\mmdc.cmd 2024-01-21 10:52:04.541 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\data_api_design\20240121105035.pdf.. 2024-01-21 10:52:05.705 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:52:05.710 | WARNING | metagpt.utils.mermaid:mermaid_to_file:76 - Error: Evaluation failed: UnknownDiagramError: No diagram type detected matching given configuration for text: class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake: def init(self): self.body = [(20, 200), (20, 210), (20, 220)] self.direction = (0, -10)

class Food: def init(self): self.position = (randint(1, (800-20)//20) 20, randint(1, (600-20)//20) 20)

def main(): game = SnakeGame() while True: game.update() game.draw() pygame.display.flip() if game.check_collision(): game.reset() if name == 'main': main()

at w0A (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:11:76)
at GjA (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:64:685)
at Object.N2e [as render] (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:87:1152)
at file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:538
at new Promise (<anonymous>)
at Q (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:515)
at obt (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:190)
at file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:674
at new Promise (<anonymous>)
at Object.abt [as render] (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:483)
at pptr://__puppeteer_evaluation_script__:14:46
at ExecutionContext._ExecutionContext_evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:254:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:143:16)
at async CDPJSHandle.evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js:56:16)
at async CDPElementHandle.$eval (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ElementHandle.js:86:24)
at async renderMermaid (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:246:22)
at async parseMMD (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:218:20)
at async run (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:479:20)
at async cli (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:184:3)

2024-01-21 10:52:05.714 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\data_api_design\20240121105035.svg.. 2024-01-21 10:52:06.874 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:52:06.875 | WARNING | metagpt.utils.mermaid:mermaid_to_file:76 - Error: Evaluation failed: UnknownDiagramError: No diagram type detected matching given configuration for text: class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake: def init(self): self.body = [(20, 200), (20, 210), (20, 220)] self.direction = (0, -10)

class Food: def init(self): self.position = (randint(1, (800-20)//20) 20, randint(1, (600-20)//20) 20)

def main(): game = SnakeGame() while True: game.update() game.draw() pygame.display.flip() if game.check_collision(): game.reset() if name == 'main': main()

at w0A (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:11:76)
at GjA (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:64:685)
at Object.N2e [as render] (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:87:1152)
at file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:538
at new Promise (<anonymous>)
at Q (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:515)
at obt (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:190)
at file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:674
at new Promise (<anonymous>)
at Object.abt [as render] (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:483)
at pptr://__puppeteer_evaluation_script__:14:46
at ExecutionContext._ExecutionContext_evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:254:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:143:16)
at async CDPJSHandle.evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js:56:16)
at async CDPElementHandle.$eval (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ElementHandle.js:86:24)
at async renderMermaid (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:246:22)
at async parseMMD (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:218:20)
at async run (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:479:20)
at async cli (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:184:3)

2024-01-21 10:52:06.875 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\data_api_design\20240121105035.png.. 2024-01-21 10:52:08.013 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:52:08.013 | WARNING | metagpt.utils.mermaid:mermaid_to_file:76 - Error: Evaluation failed: UnknownDiagramError: No diagram type detected matching given configuration for text: class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake: def init(self): self.body = [(20, 200), (20, 210), (20, 220)] self.direction = (0, -10)

class Food: def init(self): self.position = (randint(1, (800-20)//20) 20, randint(1, (600-20)//20) 20)

def main(): game = SnakeGame() while True: game.update() game.draw() pygame.display.flip() if game.check_collision(): game.reset() if name == 'main': main()

at w0A (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:11:76)
at GjA (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:64:685)
at Object.N2e [as render] (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:87:1152)
at file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:538
at new Promise (<anonymous>)
at Q (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:515)
at obt (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:190)
at file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:674
at new Promise (<anonymous>)
at Object.abt [as render] (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/dist/index.html:89:483)
at pptr://__puppeteer_evaluation_script__:14:46
at ExecutionContext._ExecutionContext_evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:254:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:143:16)
at async CDPJSHandle.evaluate (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js:56:16)
at async CDPElementHandle.$eval (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ElementHandle.js:86:24)
at async renderMermaid (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:246:22)
at async parseMMD (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:218:20)
at async run (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:479:20)
at async cli (file:///C:/Users/%E9%99%88%E6%88%90/AppData/Roaming/npm/node_modules/@mermaid-js/mermaid-cli/src/index.js:184:3)

2024-01-21 10:52:08.013 | INFO | metagpt.actions.design_api:_save_data_api_design:117 - Save class view to D:\MetaGPT-0.6.4\workspace\snake_game\resources\data_api_design\20240121105035 C:\Users\陈成\AppData\Roaming\npm\mmdc C:\Users\陈成\AppData\Roaming\npm\mmdc.cmd 2024-01-21 10:52:08.148 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\seq_flow\20240121105035.pdf.. 2024-01-21 10:52:09.378 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:52:09.379 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\seq_flow\20240121105035.svg.. 2024-01-21 10:52:10.559 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:52:10.559 | INFO | metagpt.utils.mermaid:mermaid_to_file:50 - Generating D:\MetaGPT-0.6.4\workspace\snake_game\resources\seq_flow\20240121105035.png.. 2024-01-21 10:52:11.847 | INFO | metagpt.utils.mermaid:mermaid_to_file:74 - Generating single mermaid chart

2024-01-21 10:52:11.849 | INFO | metagpt.actions.design_api:_save_seq_flow:127 - Saving sequence flow to D:\MetaGPT-0.6.4\workspace\snake_game\resources\seq_flow\20240121105035 2024-01-21 10:52:11.850 | INFO | metagpt.utils.file_repository:save:60 - save to: D:\MetaGPT-0.6.4\workspace\snake_game\resources\system_design\20240121105035.md 2024-01-21 10:52:11.850 | INFO | metagpt.roles.role:_act:357 - Eve(Project Manager): to do WriteTasks(WriteTasks) CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": ["main.py", "game.py", "ui.py", "skins.py"], "Data structures and interfaces": """ class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake:
    def __init__(self):
        self.body = [(20, 200), (20, 210), (20, 220)]
        self.direction = (0, -10)

class Food:
    def __init__(self):
        self.position = (randint(1, (800-20)//20) * 20, randint(1, (600-20)//20) * 20)

def main():
    game = SnakeGame()
    while True:
        game.update()
        game.draw()
        pygame.display.flip()
        if game.check_collision():
            game.reset()

if __name__ == '__main__':
    main()
""",
"Program call flow": """
sequenceDiagram
    participant M as Main
    participant S as Snake
    participant F as Food
    participant UI as UserInterface
    participant SC as SkinChooser
    M->>S: start_game()
    S->>F: generate_food()
    S->>UI: set_ui()
    S->>M: update()
    S->>UI: draw_ui()
    M->>S: check_collision()
    S->>F: check_eat()
    S->>UI: update_ui()
    S->>M: reset()
    UI->>M: handle_events()
    SC->>UI: get_skin()
    UI->>S: set_skin()
""",
"Anything UNCLEAR": "None"

} [/2024-01-21 10:52:42.217 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.002 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1137, completion_tokens: 589 2024-01-21 10:52:42.224 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 30.000(s), this was the 1st time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": ["main.py", "game.py", "ui.py", "skins.py"], "Data structures and interfaces": """ class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake:
    def __init__(self):
        self.body = [(20, 200), (20, 210), (20, 220)]
        self.direction = (0, -10)

class Food:
    def __init__(self):
        self.position = (randint(1, (800-20)//20) * 20, randint(1, (600-20)//20) * 20)

def main():
    game = SnakeGame()
    while True:
        game.update()
        game.draw()
        pygame.display.flip()
        if game.check_collision():
            game.reset()

if __name__ == '__main__':
    main()
""",
"Program call flow": """
sequenceDiagram
    participant M as Main
    participant S as Snake
    participant F as Food
    participant UI as UserInterface
    participant SC as SkinChooser
    M->>S: start_game()
    S->>F: generate_food()
    S->>UI: set_ui()
    S->>M: update()
    S->>UI: draw_ui()
    M->>S: check_collision()
    S->>F: check_eat()
    S->>UI: update_ui()
    S->>M: reset()
    UI->>M: handle_events()
    SC->>UI: get_skin()
    UI->>S: set_skin()
""",
"Anything UNCLEAR": "None"

} [/2024-01-21 10:53:15.468 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.002 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1137, completion_tokens: 589 2024-01-21 10:53:15.472 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 63.250(s), this was the 2nd time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": ["main.py", "game.py", "ui.py", "skins.py"], "Data structures and interfaces": """ class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake:
    def __init__(self):
        self.body = [(20, 200), (20, 210), (20, 220)]
        self.direction = (0, -10)

class Food:
    def __init__(self):
        self.position = (randint(1, (800-20)//20) * 20, randint(1, (600-20)//20) * 20)

def main():
    game = SnakeGame()
    while True:
        game.update()
        game.draw()
        pygame.display.flip()
        if game.check_collision():
            game.reset()

if __name__ == '__main__':
    main()
""",
"Program call flow": """
sequenceDiagram
    participant M as Main
    participant S as Snake
    participant F as Food
    participant UI as UserInterface
    participant SC as SkinChooser
    M->>S: start_game()
    S->>F: generate_food()
    S->>UI: set_ui()
    S->>M: update()
    S->>UI: draw_ui()
    M->>S: check_collision()
    S->>F: check_eat()
    S->>UI: update_ui()
    S->>M: reset()
    UI->>M: handle_events()
    SC->>UI: get_skin()
    UI->>S: set_skin()
""",
"Anything UNCLEAR": "None"

} [/2024-01-21 10:53:47.788 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.003 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1137, completion_tokens: 589 2024-01-21 10:53:47.802 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 95.578(s), this was the 3rd time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": ["main.py", "game.py", "ui.py", "skins.py"], "Data structures and interfaces": """ class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake:
    def __init__(self):
        self.body = [(20, 200), (20, 210), (20, 220)]
        self.direction = (0, -10)

class Food:
    def __init__(self):
        self.position = (randint(1, (800-20)//20) * 20, randint(1, (600-20)//20) * 20)

def main():
    game = SnakeGame()
    while True:
        game.update()
        game.draw()
        pygame.display.flip()
        if game.check_collision():
            game.reset()

if __name__ == '__main__':
    main()
""",
"Program call flow": """
sequenceDiagram
    participant M as Main
    participant S as Snake
    participant F as Food
    participant UI as UserInterface
    participant SC as SkinChooser
    M->>S: start_game()
    S->>F: generate_food()
    S->>UI: set_ui()
    S->>M: update()
    S->>UI: draw_ui()
    M->>S: check_collision()
    S->>F: check_eat()
    S->>UI: update_ui()
    S->>M: reset()
    UI->>M: handle_events()
    SC->>UI: get_skin()
    UI->>S: set_skin()
""",
"Anything UNCLEAR": "None"

} [/2024-01-21 10:54:20.126 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.003 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1137, completion_tokens: 589 2024-01-21 10:54:20.132 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 127.906(s), this was the 4th time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": ["main.py", "game.py", "ui.py", "skins.py"], "Data structures and interfaces": """ class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake:
    def __init__(self):
        self.body = [(20, 200), (20, 210), (20, 220)]
        self.direction = (0, -10)

class Food:
    def __init__(self):
        self.position = (randint(1, (800-20)//20) * 20, randint(1, (600-20)//20) * 20)

def main():
    game = SnakeGame()
    while True:
        game.update()
        game.draw()
        pygame.display.flip()
        if game.check_collision():
            game.reset()

if __name__ == '__main__':
    main()
""",
"Program call flow": """
sequenceDiagram
    participant M as Main
    participant S as Snake
    participant F as Food
    participant UI as UserInterface
    participant SC as SkinChooser
    M->>S: start_game()
    S->>F: generate_food()
    S->>UI: set_ui()
    S->>M: update()
    S->>UI: draw_ui()
    M->>S: check_collision()
    S->>F: check_eat()
    S->>UI: update_ui()
    S->>M: reset()
    UI->>M: handle_events()
    SC->>UI: get_skin()
    UI->>S: set_skin()
""",
"Anything UNCLEAR": "None"

} [/2024-01-21 10:54:55.562 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.004 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1137, completion_tokens: 589 2024-01-21 10:54:55.576 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 163.359(s), this was the 5th time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error CONTENT] [CONTENT] { "Implementation approach": "We will use Python's Pygame library to create the snake game, ensuring the main game loop, movement, collision detection, user interface, and customization options are implemented.", "File list": ["main.py", "game.py", "ui.py", "skins.py"], "Data structures and interfaces": """ class SnakeGame: def init(self): self.screen = pygame.display.set_mode((800, 600)) self.clock = pygame.time.Clock() self.snake = Snake() self.food = Food() self.skin_choice = 0

class Snake:
    def __init__(self):
        self.body = [(20, 200), (20, 210), (20, 220)]
        self.direction = (0, -10)

class Food:
    def __init__(self):
        self.position = (randint(1, (800-20)//20) * 20, randint(1, (600-20)//20) * 20)

def main():
    game = SnakeGame()
    while True:
        game.update()
        game.draw()
        pygame.display.flip()
        if game.check_collision():
            game.reset()

if __name__ == '__main__':
    main()
""",

"Program call flow": """ sequenceDiagram participant M as Main participant S as Snake participant F as Food participant UI as UserInterface participant SC as SkinChooser M->>S: start_game() S->>F: generate_food() S->>UI: set_ui() S->>M: update() S->>UI: draw_ui() M->>S: check_collision() S->>F: check_eat() S->>UI: update_ui() S->>M: reset() UI->>M: handle_events() SC->>UI: get_skin() UI->>S: set_skin() """, "Anything UNCLEAR": "None" } [/2024-01-21 10:55:35.129 | INFO | metagpt.utils.cost_manager:update_cost:48 - Total running cost: $0.004 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 1137, completion_tokens: 589 2024-01-21 10:55:35.137 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 202.922(s), this was the 6th time calling it. exp: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error 2024-01-21 10:55:35.137 | WARNING | metagpt.utils.common:wrapper:506 - There is a exception in role's execution, in order to resume, we delete the newest role communication message in the role's memory. 2024-01-21 10:55:35.148 | ERROR | metagpt.utils.common:wrapper:488 - Exception occurs, start to serialize the project, exp: Traceback (most recent call last): File "C:\Users\陈成\AppData\Roaming\Python\Python310\site-packages\tenacity_asyncio.py", line 50, in call result = await fn(*args, kwargs) File "d:\metagpt-0.6.4\metagpt\actions\action_node.py", line 280, in _aask_v1 instruct_content = output_class(parsed_data) pydantic_core._pydantic_core.ValidationError: 1 validation error for PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "d:\metagpt-0.6.4\metagpt\utils\common.py", line 497, in wrapper return await func(self, *args, **kwargs) File "d:\metagpt-0.6.4\metagpt\roles\role.py", line 482, in run rsp = await self.react() tenacity.RetryError: RetryError[<Future at 0x294c79daf20 state=finished raised ValidationError>]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\metagpt-0.6.4\metagpt\utils\common.py", line 483, in wrapper result = await func(self, *args, *kwargs) File "d:\metagpt-0.6.4\metagpt\team.py", line 133, in run await self.env.run() Exception: Traceback (most recent call last): File "C:\Users\陈成\AppData\Roaming\Python\Python310\site-packages\tenacity_asyncio.py", line 50, in call result = await fn(args, kwargs) File "d:\metagpt-0.6.4\metagpt\actions\action_node.py", line 280, in _aask_v1 instruct_content = output_class(parsed_data) File "C:\Users\陈成\AppData\Roaming\Python\Python310\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 PM_NODE_AN Value error, Missing fields: {'Required Other language third-party packages', 'Task list', 'Shared Knowledge', 'Logic Analysis', 'Required Python packages', 'Full API spec'} [type=value_error, input_value={'Implementation approach...ything UNCLEAR': 'None'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "d:\metagpt-0.6.4\metagpt\utils\common.py", line 497, in wrapper return await func(self, *args, *kwargs) File "d:\metagpt-0.6.4\metagpt\roles\role.py", line 482, in run rsp = await self.react() File "d:\metagpt-0.6.4\metagpt\roles\role.py", line 450, in react rsp = await self._react() File "d:\metagpt-0.6.4\metagpt\roles\role.py", line 429, in _react rsp = await self._act() # 这个rsp是否需要publish_message? File "d:\metagpt-0.6.4\metagpt\roles\role.py", line 358, in _act response = await self.rc.todo.run(self.rc.history) File "d:\metagpt-0.6.4\metagpt\actions\project_management.py", line 53, in run task_doc = await self._update_tasks( File "d:\metagpt-0.6.4\metagpt\actions\project_management.py", line 79, in _update_tasks rsp = await self._run_new_tasks(context=system_design_doc.content) File "d:\metagpt-0.6.4\metagpt\actions\project_management.py", line 91, in _run_new_tasks node = await PM_NODE.fill(context, self.llm, schema) File "d:\metagpt-0.6.4\metagpt\actions\action_node.py", line 338, in fill return await self.simple_fill(schema=schema, mode=mode, timeout=timeout, exclude=exclude) File "d:\metagpt-0.6.4\metagpt\actions\action_node.py", line 303, in simple_fill content, scontent = await self._aask_v1(prompt, class_name, mapping, schema=schema, timeout=timeout) File "C:\Users\陈成\AppData\Roaming\Python\Python310\site-packages\tenacity_asyncio.py", line 88, in async_wrapped return await fn(args, **kwargs) File "C:\Users\陈成\AppData\Roaming\Python\Python310\site-packages\tenacity_asyncio.py", line 47, in call do = self.iter(retry_state=retry_state) File "C:\Users\陈成\AppData\Roaming\Python\Python310\site-packages\tenacity__init__.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x294c79daf20 state=finished raised ValidationError>]

C:\Users\陈成\AppData\Roaming\Python\Python310\site-packages\pydantic\functional_serializers.py:272: UserWarning: Pydantic serializer warnings: Expected str but got dict - serialized value may not be as expected lambda x, h: h(x), schema=core_schema.any_schema() d:\metagpt-0.6.4\metagpt\schema.py:93: UserWarning: Pydantic serializer warnings: Expected str but got dict - serialized value may not be as expected ret = handler(value) CONTENT]

dd183e1e507a444e8d8f2b6c497ee08
voidking commented 7 months ago

试试在配置文件中加上 REPAIR_LLM_OUTPUT: true

xiaodidiyou commented 7 months ago

尝试在配置文件中加上REPAIR_LLM_OUTPUT: true

添加了 没用依然报错,上面的报错就是添加过的

voidking commented 7 months ago

是能够稳定复现的吗?注意到了两个问题:

  1. 报错中出现了 D:\MetaGPT-0.6.4\workspace\snake_game error: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'D:\MetaGPT-0.6.4\workspace\20240121104955' 。这个需要重启电脑后重新跑一下试试
  2. 使用的是 MetaGPT-0.6.4 版本,这个版本里是不支持 ZHIPUAI_API_MODEL 参数的,可以使用最新版的main分支尝试下(同时需要更新依赖)。