microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
350 stars 144 forks source link

[Dev support]: #1663

Closed aligg73 closed 3 weeks ago

aligg73 commented 1 month ago

Question

When a user has a query, and the action plan is being executed, sometimes the user adds additional messages / questions in the chat, before the original action is completed.

I have noticed this creates unpredictable results, as in the teams-ai library starts a new thread, when the original question gets answered later on. In some cases, it leads to confusion.

Have you experienced similar issues, and what would be the best way to handle them? I was thinking, perhaps any additional messages could be ignored until the original thread has been answered.

Thanks for your thoughts and consideration. Alex

aacebo commented 3 weeks ago

I see where you are coming from, we spoke with bot framework since they have talked about this issue before and we agreed that this is working as expected from an SDK perspective.

If you wanted to put a guard in place to block a user from sending another message before they receive a response to the first message (ie ensuring the message history is 1 to 1), you could use the turn states conversation history in unison with a beforeTurn handler to achieve this.