From 3aaa8cf30b523960e109f4d7a06691f8e67539cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Fri, 6 Dec 2024 15:49:55 +0800 Subject: [PATCH] fixbug: use a share context to pass the repo path information --- examples/use_off_the_shelf_agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/use_off_the_shelf_agent.py b/examples/use_off_the_shelf_agent.py index 4445a6c62..7ccf87a2b 100644 --- a/examples/use_off_the_shelf_agent.py +++ b/examples/use_off_the_shelf_agent.py @@ -5,13 +5,15 @@ """ 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])