| 6 | |
| 7 | |
| 8 | class FlowchartGenTool(BaseTool): |
| 9 | name = "Generate flowchart" |
| 10 | description = ( |
| 11 | "A flowchart generator, which generates a flowchart out of some text explaining a code process." |
| 12 | "Input should be a valid a detailed text explaining a process." |
| 13 | "" |
| 14 | ) |
| 15 | llm = OpenAI(temperature=0.9) |
| 16 | |
| 17 | def _run(self, query: str) -> str: |
| 18 | """Use the tool.""" |
| 19 | code = self.llm(flowchart_template(query)) |
| 20 | return generate_flowchart(code.replace('`', '')) |
| 21 | |
| 22 | async def _arun(self, query: str) -> str: |
| 23 | """Use the tool asynchronously.""" |
| 24 | raise NotImplementedError("CodeExplanationTool does not support async") |
nothing calls this directly
no outgoing calls
no test coverage detected