Skip to content
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

Buttons click handling MS Botframework #8164

Closed
thaume opened this issue Mar 10, 2021 · 10 comments · May be fixed by #8190
Closed

Buttons click handling MS Botframework #8164

thaume opened this issue Mar 10, 2021 · 10 comments · May be fixed by #8190
Labels
area:rasa-oss/channels 📞 Issues focused around rasas input and output channels area:rasa-oss 🎡 Anything related to the open source Rasa framework difficulty:easy 🦋 type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR

Comments

@thaume
Copy link
Contributor

thaume commented Mar 10, 2021

Rasa version: 2.3.0

Rasa SDK version (if used & relevant): Nope

Rasa X version (if used & relevant): Nope

Python version: I'm using the provided dockerfile to build and run Rasa

Operating system (windows, osx, ...): MacOS, but again rasa is running in Docker

Issue:

I'm having an issue with handling buttons clicks coming from Teams. The way Teams handles clicks and text input is different and right now the Botframework Rasa connector (that was built by my company 2 years ago) doesn't support that.

We have a working version that we keep up to date with the master repo from time to time but I think it would make more sense to take the time to merge it.

And... it's just 6 lines of code

😅

Error (including full traceback): This is the stacktrace shown by Rasa after a click on a button

2021-03-10 09:47:44 DEBUG rasa.core.processor - Received user message '' with intent '

{'name': None, 'confidence': 0.0}

' and entities '[]'

Command or request that led to error: After writing and sending a message ("Home") to Rasa from Teams, this JSON is sent to rasa endpoint :

{
 "text": "Home",
 "textFormat": "plain",
 "type": "message",
 "timestamp": "
 ",
 "localTimestamp": "

 ",
 "id": "

 ",
 "channelId": "msteams",
 "serviceUrl": "https://smba.trafficmanager.net/emea/",
 "from": 

 { "id": " ", "name": " ", "aadObjectId": " " } 

, "conversation": 

 { "conversationType": "personal", "tenantId": " ", "id": " " } 

, "recipient": 

 { "id": " ", "name": " " } 

, "entities": [ 

 { "locale": "en-GB", "country": "GB", "platform": "Web", "timezone": "Europe/Paris", "type": "clientInfo" } 

 ], "channelData": { "tenant": 

 { "id": " " } 

 }, "locale": "en-GB", "localTimezone": "Europe/Paris" }

 

After clicking on a button from a card (created by the chatbot) on Teams, this JSON is sent to rasa endpoint :

{
 "type": "message",
 "timestamp": "
 ",
 "localTimestamp": "

 ",
 "id": "

 ",
 "channelId": "msteams",
 "serviceUrl": "https://smba.trafficmanager.net/emea/",
 "from": 

 { "id": " ", "name": " ", "aadObjectId": " " } 

, "conversation": 

 { "conversationType": "personal", "tenantId": " ", "id": " " } 

, "recipient": 

 { "id": " ", "name": " " } 

, "entities": [ 

 { "locale": "en-GB", "country": "GB", "platform": "Web", "timezone": "Europe/Paris", "type": "clientInfo" } 

 ], "channelData": { "tenant": 

 { "id": " " } 

, "source": 

 { "name": "message" } 

, "legacy": 

 { "replyToId": " " } 

 }, "replyToId": "

 ", "value": 

 { "id": "Jobs" } 

, "locale": "en-GB", "localTimezone": "Europe/Paris" }

 

As you can see, the text key is present only when sending data as text but not when clicking on a button (the button's data is inside a value dict).

Right now this data is handled here : https://github.com/RasaHQ/rasa/blob/main/rasa/core/channels/botframework.py#L236

And we are handling it like that on our repo :

text = ""
 if postdata.get("text"):
 text = postdata.get("text")
 else:
 if postdata.get("value"):
 raw_value = postdata.get("value")
 if "value" in raw_value:
 raw_value = raw_value["value"]
 text = json.dumps(raw_value)

 user_msg = UserMessage(
 text=text,
 output_channel=out_channel,
 sender_id=postdata["from"]["id"],
 input_channel=self.name(),
 metadata=metadata_with_attachments,
 )

How would you like to solve this problem ?

Thanks !

Content of configuration file (config.yml) (if relevant): not modified

Content of domain file (domain.yml) (if relevant): not modified

@thaume thaume added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Mar 10, 2021
@thaume thaume changed the title [Can provide PR from working repo] Buttons click handling MS Botframework Buttons click handling MS Botframework Mar 10, 2021
@sara-tagger
Copy link
Collaborator

sara-tagger commented Mar 11, 2021

Exalate commented:

sara-tagger commented:

Thanks for raising this issue, @m-vdb will get back to you about it soon


Please also check out the docs and the forum in case your issue was raised there too
🤗

@m-vdb m-vdb added the area:rasa-oss/channels 📞 Issues focused around rasas input and output channels label Mar 11, 2021
@m-vdb
Copy link
Collaborator

m-vdb commented Mar 11, 2021

Exalate commented:

m-vdb commented:

Hi @thaume and thanks for creating this GitHub issue. Would you be up for submitting a pull request? We'll gladly review it

@thaume
Copy link
Contributor Author

thaume commented Mar 11, 2021

Exalate commented:

thaume commented:

Hi @m-vdb sure ! I just wanted to double check with you first that this was of interest and made sense for the project

@m-vdb
Copy link
Collaborator

m-vdb commented Mar 11, 2021

Exalate commented:

m-vdb commented:

yeah I think it'd be useful! I don't know much about this channel, but if this use case is not working for you, it's possible it's not working for other people. Would be great if in your PR you could link to the API reference, I think it'd be easier for other contributors

@thaume
Copy link
Contributor Author

thaume commented Mar 12, 2021

Exalate commented:

thaume commented:

Hey @m-vdb, the PR is over here #8190 ! Let me know what you think

@m-vdb m-vdb linked a pull request Mar 12, 2021 that will close this issue
4 tasks
@stale
Copy link

stale bot commented Jul 21, 2021

Exalate commented:

stale[bot] commented:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 21, 2021
@rasabot-exalate rasabot-exalate added area:rasa-oss and removed type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. difficulty:easy 🦋 area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/channels 📞 Issues focused around rasas input and output channels labels Mar 15, 2022 — with Exalate Issue Sync
@stale stale bot removed the stale label Mar 15, 2022
@m-vdb m-vdb added area:rasa-oss/channels 📞 Issues focused around rasas input and output channels difficulty:easy 🦋 area:rasa-oss 🎡 Anything related to the open source Rasa framework and removed area:rasa-oss/channels labels Mar 16, 2022
@rasabot-exalate rasabot-exalate added area:rasa-oss :ferris wheel: stale and removed area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/channels 📞 Issues focused around rasas input and output channels labels Mar 17, 2022 — with Exalate Issue Sync
@stale stale bot removed stale labels Mar 17, 2022
@rasabot-exalate rasabot-exalate added area:rasa-oss 🎡 Anything related to the open source Rasa framework stale and removed area:rasa-oss :ferris wheel: labels Mar 17, 2022 — with Exalate Issue Sync
@stale stale bot removed the stale label Mar 17, 2022
@m-vdb m-vdb added area:rasa-oss/channels 📞 Issues focused around rasas input and output channels and removed area:rasa-oss/channels labels Mar 17, 2022
@stale stale bot removed the stale label Mar 21, 2022
@m-vdb m-vdb added the type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR label Oct 10, 2022
@guilhermemoraisr
Copy link
Contributor

Hey! Is this issue still open for contribution? I would like to help solve it

@m-vdb
Copy link
Collaborator

m-vdb commented Dec 9, 2022

yes it it 🎉 Another contributor had submitted a PR a while ago, but it's currently stale. Feel free to take a look at the code they wrote (and the review comments that were shared) :)

@thaume
Copy link
Contributor Author

thaume commented Dec 9, 2022

Hey everyone,

Just FYI @guilhermemoraisr, only tests are missing. It's very possible the code doesn't work with the latest version of MS Botframework tho

The project I was working on for bot framework was finished about a year ago so I don't use it anymore but happy to help if you have questions!

@sync-by-unito
Copy link

sync-by-unito bot commented Dec 19, 2022

➤ Maxime Verger commented:

💡 Heads up! We're moving issues to Jira: https://rasa-open-source.atlassian.net/browse/OSS.

From now on, this Jira board is the place where you can browse (without an account) and create issues (you'll need a free Jira account for that). This GitHub issue has already been migrated to Jira and will be closed on January 9th, 2023. Do not forget to subscribe to the corresponding Jira issue!

➡️ More information in the forum: https://forum.rasa.com/t/migration-of-rasa-oss-issues-to-jira/56569.

@m-vdb m-vdb closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss/channels 📞 Issues focused around rasas input and output channels area:rasa-oss 🎡 Anything related to the open source Rasa framework difficulty:easy 🦋 type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants