Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

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

莘权 马3aaa8cf30b52
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 @@ 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])