/ examples / di / use_browser.py
use_browser.py
 1  import asyncio
 2  
 3  from metagpt.roles.di.data_interpreter import DataInterpreter
 4  
 5  MG_LLM_CONFIG_REQ = """
 6  This is a link to the doc site of MetaGPT project: https://docs.deepwisdom.ai/main/en/
 7  Check where you can go to on the site and try to find out the list of LLM APIs supported by MetaGPT.
 8  Don't write all codes in one response, each time, just write code for one step.
 9  """
10  
11  PAPER_LIST_REQ = """"
12  At https://papercopilot.com/statistics/iclr-statistics/iclr-2024-statistics/,
13  find the first paper whose title includes `multiagent`, open it and summarize its abstract.
14  Don't write all codes in one response, each time, just write code for one step.
15  """
16  
17  DESCRIBE_GITHUB_ISSUE_REQ = """
18  Visit https://github.com/geekan/MetaGPT, navigate to Issues page, open the first issue related to DataInterpreter, then summarize what the issue is in one sentence.
19  Don't write all codes in one response, each time, just write code for one step.
20  """
21  
22  
23  async def main():
24      di = DataInterpreter(tools=["Browser"], react_mode="react")
25      await di.run(MG_LLM_CONFIG_REQ)
26  
27  
28  if __name__ == "__main__":
29      asyncio.run(main())