To enable streaming responses in the Teams bot chat UI using the Teams Toolkit SDK, particularly with Python, you can follow these steps to configure your AI-powered bot to stream messages. This approach will allow the bot to send chunks of messages as they are generated, providing a more engaging experience for the user.
- Enable Streaming for AI-powered Bot:
- Use the
DefaultAugmentation
class in theconfig.json
file of your bot. - Set the
stream
parameter totrue
in theOpenAIModel
declaration within your main application file (bot.py
).
- Use the
- Set Informative Messages:
- Define an informative message that will appear to the user every time the bot sends an update.
- Format the Final Streamed Message:
- Configure the bot to format text messages and simple markdown while they are being streamed.
- Ensure that attachments like Adaptive Cards are only sent once the final message chunk is complete.
Thanks,
Prasad Das
*************************************************************************
If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.