Make generate_response function public.