RA-Gen: A Controllable Code Generation Framework Using ReAct for Multi-Agent Task Execution