Merge branch 'dynamic_think' into 'mgx_ops'

fix critical bug: add available commands

See merge request pub/MetaGPT!82
This commit is contained in:
林义章 2024-04-28 11:54:58 +00:00
commit fcaee6b64f
3 changed files with 14 additions and 26 deletions

View file

@ -59,3 +59,10 @@ class Command(Enum):
@property
def cmd_name(self):
return self.value.name
def prepare_command_prompt(commands: list[Command]) -> str:
command_prompt = ""
for i, command in enumerate(commands):
command_prompt += f"{i+1}. {command.value.signature}:\n{command.value.desc}\n\n"
return command_prompt