When using keras to train a model, how to use the output of one round as the input of the next round

Hello. I want to use keras for time series forecasting. When forecasting, I hope that the forecast result at time t will be used as the input at time t+1. So when I want to train, put the final output of the training at time t to time t+1 as input. May I ask how it can be implemented in keras. Or how can it be achieved with tensorflow.