geekan / MetaGPT

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

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

Closed xiaotiancd closed 23 hours ago

xiaotiancd commented 5 months ago

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

Screenshots or logs

LyndonZhao commented 4 months ago

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

better629 commented 1 week ago

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

geekan commented 23 hours ago

This issue has been closed because it took too long.