A generalized fluctuation-dissipation theorem