added code for ai client integeration