MCPcopy Create free account
hub / github.com/IyadhKhalfallah/Code2Flowchart / run_agent

Function run_agent

code2flowchart/playground.py:26–39  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

24
25
26def 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
42def main():

Callers

nothing calls this directly

Calls 1

flowchart_templateFunction · 0.90

Tested by

no test coverage detected