(code)
| 24 | |
| 25 | |
| 26 | def run_agent(code): |
| 27 | tools = [tool['tool']() for tool in TOOLS if tool['include'] is True] |
| 28 | |
| 29 | memory = ConversationBufferMemory(memory_key="chat_history", output_key='output') |
| 30 | |
| 31 | agent = initialize_agent(tools, llm, agent="conversational-react-description", memory=memory, verbose=True) |
| 32 | |
| 33 | prompt = flowchart_template( |
| 34 | f""" |
| 35 | {code} |
| 36 | """) |
| 37 | |
| 38 | agent.run(prompt) |
| 39 | agent.run("Generate a correct mermaid.js flowchart syntax from the explanation you provided") |
| 40 | |
| 41 | |
| 42 | def main(): |
nothing calls this directly
no test coverage detected