MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

MetaGPT+Zhipu glm-4 generated the cli_blackjack game can not run

Open xiaotiancd opened this issue 1 year ago • 1 comments

Bug description

looks like the generated code has dependency issues among the classes.

% python main.py Do you want to play a game of Blackjack? [Y/n] Y Traceback (most recent call last): File "/Users/xuxiaotian/project/metaGPT/MetaGPT/workspace/cli_blackjack/cli_blackjack/main.py", line 98, in main() File "/Users/xuxiaotian/project/metaGPT/MetaGPT/workspace/cli_blackjack/cli_blackjack/main.py", line 94, in main game.play() File "/Users/xuxiaotian/project/metaGPT/MetaGPT/workspace/cli_blackjack/cli_blackjack/main.py", line 19, in play if not self.player.bet(10): # Default bet amount is 10 File "/Users/xuxiaotian/project/metaGPT/MetaGPT/workspace/cli_blackjack/cli_blackjack/player.py", line 26, in bet self.hands.append(Hand()) # Add a new hand for the player NameError: name 'Hand' is not defined

Bug solved method

Environment information

  • LLM type and model name: zhipu, glm-4
  • System version: MacOS 14.4.1,
  • Python version: 3.9
  • MetaGPT version or branch: dev version
  • packages version:
  • installation method: pip install from source

Screenshots or logs

xiaotiancd avatar May 08 '24 05:05 xiaotiancd

I met the same problem, it seems that zhipu glm-4 is bad at code generation.

LyndonZhao avatar Jun 15 '24 15:06 LyndonZhao

Due to the lack of updates or replies by the user for a long time, we will close it. Please reopen it if necessary.

better629 avatar Oct 10 '24 02:10 better629

This issue has been closed because it took too long.

geekan avatar Oct 20 '24 07:10 geekan