/ examples / di / solve_math_problems.py
solve_math_problems.py
 1  import asyncio
 2  
 3  from metagpt.roles.di.data_interpreter import DataInterpreter
 4  
 5  
 6  async def main(requirement: str = ""):
 7      di = DataInterpreter()
 8      await di.run(requirement)
 9  
10  
11  if __name__ == "__main__":
12      requirement = "Solve this math problem: The greatest common divisor of positive integers m and n is 6. The least common multiple of m and n is 126. What is the least possible value of m + n?"
13      # answer: 60 (m = 18, n = 42)
14      asyncio.run(main(requirement))