-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
role property is not set for messages sent by bot #1886
Comments
@corinagum what do you mean with "need more detail"? |
Hi @hansmbakker, sorry for the confusion - the "Need more detail" label just means that the team hasn't investigated this issue yet. :) In this case, I have read the issue but haven't reproduced it or discussed it with other team members. This is also when we determine the T-Shirt size and how soon we want to implement the feature or fix. Hope that helps! |
Thanks for the clarification! |
@hansmbakker Where are you trying to filter the activities? |
First I would like to share that the filtering likely is not the problem here; it works with the bot emulator. I believe the web chat simply does not add the I do the filtering in the bot's webapp (I'm using the enterprise bot template). I want to build functionality where the user can download a transcript of his conversation. So what I do:
|
I agree that the issue is most likely not with filter the activities. I wanted to be sure I was reproducing the behavior properly. Thank you for clarifying your issue. |
Just taking a look at the ConsoleTranscriptLogger, you are correct. The from attribute in Activities sent by the bot are being set properly when client is the emulator but not WebChat. Take a look at the screenshots below. adapter.use(new TranscriptLoggerMiddleware(new ConsoleTranscriptLogger())); I think it's worth noting that the TranscriptLoggerMiddleware sets the role for Activities sent by the user if it is missing. |
Nice that you could reproduce it! |
From the looks of the Bot Framework schema, this is intentional in the protocol and is a wontfix.
I believe expectation is that users of DLJS who want to utilize role must fill it themselves, and |
Adding @justinwilaby to the list of pings :) |
@corinagum is correct. The required fields for a |
I'm going to close this as a won't fix. We can always open this up to further discussion again at a later time. :) |
My usecase is, simply put:
@corinagum since (per the Bot Framework schema also linked by @corinagum)
The field supports my usecase, but the field only adds value when it is properly filled. What component should fill the |
My understanding is that it would be the user's responsibility to write this patch. Would you be able to implement something similar to Web Chat's role patch? |
According to the spec Conversation account role, it should be filled by the receiver from the Direct Line channel, and removed before sending it back to the channel. IMO, the ideal case would be DirectLineJS filling it and removing it. So it is most transparent to the user and also most usable. |
@corinagum could you explain where/how that code is used? Is it used by WebChat and does WebChat remove the role again before sending it to the bot? @compulim I am using the Virtual Assistant C# template --> did you mean DirectLineJS as a WebChat dependency or as a dependency for the bot adapter? In that case it would need to be done by @corinagum When implementing it into my project I could implement it as middleware for virtual assistant. |
Yes, Web Chat routes it through to add the role and it should be removed. (To answer your question to compulim as well) |
Ok, I'll look into writing middleware that does it. @corinagum @compulim what is the risk of not removing the |
Description (Actual behavior)
I noticed that
in the the Web Chat channel
role
property is not set infrom
for messages sent by the botThis applies both to
https://webchat.botframework.com/embed/<botId>?s=<secret>
Therefore, I cannot search for message sent by the bot by filtering
type == "message"
ANDrole == "bot"
(since
role = bot
is not set, zero messages are found)The bot emulator correctly fills the role property though.
Expected behaviour
When a user has a conversation with the bot, I can get messages sent by the bot by filtering
type == "message"
ANDrole == "bot"
Workaround
To get bot messages: filter activities in the webchat
type == "message"
ANDrole != "user"
Related PRs
The text was updated successfully, but these errors were encountered: