Optimize generate response in actions