
Getting started with GitHub Copilot part 2, streamable responses
I'm sure you've seen many AI apps where you sit tight for 30s or and you wonder if things are stuck? Not a great experience right? Yes, you're right, you deserve better, so how do we fix it? Type your prompt> Tell me a joke . . . . . . . . Why could I never find the atoms, cause they split.. Series on Copilot SDK This series is about Copilot SDK and how you can leverage your existing GitHub Copilot license to integrate AI into your apps Part 1 - install and your first app Part 2 - streamable response, you're here Addressing the problem By streaming the response, the response now arrives in chunks, pieces that you can show as soon as they arrive. How can we do that though and how can GitHub Copilot SDK help out? Well, there's two things you need to do: Enable streaming. You need to set streaming to True when you call create_session . Listen for events that contains a chunk. Specifically, you need to listen to ASSISTANT_MESSAGE_DELTA and print out the chunk. # 1. Enable streaming session
Continue reading on Dev.to Python
Opens in a new tab



