from metagpt.actions import Action
class SimpleWriteCode(Action):
Write a python function that can {instruction} and provide two runnnable test cases.
Quote all your code with a single ``` ```,
def __init__(self, name="SimpleWriteCode", context=None, llm=None):
super().__init__(name, context, llm)
async def run(self, instruction: str):
prompt = self.PROMPT_TEMPLATE.format(instruction=instruction)
rsp = await self._aask(prompt)
code_text = SimpleWriteCode.parse_code(rsp)