almost done the dialog thing with agents, start to generate agent code