fixbug: use a share context to pass the repo path information

This commit is contained in:
莘权 马 2024-12-06 15:49:55 +08:00
parent 68b7dc6c16
commit 3aaa8cf30b

View file

@ -5,13 +5,15 @@ Author: garylin2099
"""
import asyncio
from metagpt.context import Context
from metagpt.logs import logger
from metagpt.roles.product_manager import ProductManager
async def main():
msg = "Write a PRD for a snake game"
role = ProductManager()
context = Context() # Used to share repo path information between multiple actions within the role.
role = ProductManager(context=context)
result = await role.run(msg)
logger.info(result.content[:100])