add example for the researcher role

This commit is contained in:
shenchucheng 2023-08-08 23:02:15 +08:00
parent 25d2621198
commit 2d8a3f1296
2 changed files with 17 additions and 1 deletions

16
examples/research.py Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env python
import asyncio
from metagpt.roles.researcher import RESEARCH_PATH, Researcher
async def main():
topic = "dataiku .vs datarobot"
role = Researcher(language="en-us")
await role.run(topic)
print(f"save report to {RESEARCH_PATH / f'{topic}.md'}.")
if __name__ == '__main__':
asyncio.run(main())