RocketChat / Apps.Dialogflow

Integration between Rocket.Chat and the Dialogflow Chatbot platform
9 stars 16 forks source link

Getting Error while connecting Dialogflow cx to Rocket.chat gold account #78

Open jayeshdesai4520 opened 2 years ago

jayeshdesai4520 commented 2 years ago

Hello @murtaza98 , @renatobecker, and others, ok, so I have connected Dialogflow es chatbot to rocket.chat and it is working fine but when I try to connect Dialogflow cx agent using the service account credentials it is giving me an error like this "IAM permission ‘dialogflow.sessions.detectIntent’ on ‘projects/xxxxxxxxxxx/agent’ denied.“PERMISSION_DENIED” so is it possible to connect dialogflow cx bot to rocket.chat?

and also right now I am using https://dialogflow.cloud.google.com/cx/projects/xxxxxx/locations/us-central1/agents/xxxxx_projectID_xxxxxx/ Project Id which is at the last of the URL in the rocket.chat dialogflow app(key has all the permissions(dialogflow admin and client))

maybe I think I am not using project ID correctly, dialogflow es has seperate project ID for each agent but about dialogflow cx there is one project id and multiple agents in the projects

Note - dialogflow es is working fine with rocket.chat

murtaza98 commented 2 years ago

Hi @jayeshdesai4520 This app was earlier just designed for Dialogflow ES. In fact, Dialogflow CX was not even a product when this app was released, so it was never part of our original scope of this integration. So there might be some changes within the Dialogflow Api's which this app is using, essentially to migrate from ES to CX, like the one you pointed out. So feel free to share your findings here, or even raise a PR with these changes :smile:

jayeshdesai4520 commented 2 years ago

Hi @murtaza98, the key.json file of Dialogflow CX project looks the same as Dialogflow ES, it has all the same fields, but it's not working with rocket.chat's Dialogflow app, I feel like in the rocket.chat Dialogflow app there should be one more field called agent ID with project ID, because in the CX as I mentioned it has Project ID and Agent ID as well.

you know anyway to make it work?

murtaza98 commented 2 years ago

@jayeshdesai4520 I think you're right here. On comparing ES and CX docs for detectIntent endpoint, I see that Agent Id param was introduced in CX. So, there is indeed some change required here where we're building this URL.

jayeshdesai4520 commented 2 years ago

yes @murtaza98 ok after changing the URL it might work, but the thing is we also want agent ID from the rocket.chat Dialogflow app so I need to make changes and add one more field into the dialogflow.app also am I right?

murtaza98 commented 2 years ago

Sure, this could be an app setting, just like the other apps settings like project Id, private key, etc.

One suggestion here: try to be more explicit about if the bot is for CX or for ES. One way to do that would be to add an SELECT option setting with 2 options, ES and CX.

yes @murtaza98 ok after changing the URL it might work, but the thing is we also want agent ID from the rocket.chat Dialogflow app so I need to make changes and add one more field into the dialogflow.app also am I right?

jayeshdesai4520 commented 2 years ago

@murtaza98, To be honest, I only work in python but still, I will try to do it, If I am able to do it, how much time do you think it will take to get live(on the rocket.chat marketplace) and I can actually use the benefit of this update?

murtaza98 commented 2 years ago

Thanks for your interest @jayeshdesai4520 ! Any community PR goes through the standard community process of getting reviewed by some contributor (Hopefully, I'll be able to help here), and once it is approved, it shouldn't take much time to get it released on the marketplace. Usually, the apps-engine team reviews the app within a week.

tienhuynh17 commented 1 week ago

Hi @murtaza98, does your team have a roadmap or any update for this issue (Dialogflow CX migration) ? Thanks!

murtaza98 commented 1 week ago

Hi @tienhuynh17 Sorry I'm no longer part of the RocketChat team so I cannot answer this. Can you reach out to their official support?