/ examples / di / run_flask.py
run_flask.py
 1  import asyncio
 2  
 3  from metagpt.roles.di.data_interpreter import DataInterpreter
 4  
 5  USE_GOT_REPO_REQ = """
 6  Write a service using Flask, create a conda environment and run it, and call the service's interface for validation.
 7  Notice: Don't write all codes in one response, each time, just write code for one step.
 8  """
 9  # If you have created a conda environment, you can say:
10  # I have created the conda environment '{env_name}', please use this environment to execute.
11  
12  
13  async def main():
14      di = DataInterpreter(tools=["Terminal", "Editor"])
15      await di.run(USE_GOT_REPO_REQ)
16  
17  
18  if __name__ == "__main__":
19      asyncio.run(main())