Time series in TensorFlow using LSTM

I am trying to implement the following idea.

I was following the code sample from TensorFlow.

I will be glad if you suggest to me how can I modify the WindowGenerator() function or implement the idea.

Much appreciated.