Merge pull request #1631 from iorisa/fixbug/1623

fixbug: #1623, use a share context to pass the repo path information
This commit is contained in:
Guess 2024-12-06 15:59:16 +08:00 committed by GitHub
commit 0a5a2357d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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])