How would you design the networking layer for a chat app that streams AI responses token by token at xAI, and how do you handle network interruptions?