Search code examples
google-cloud-platformdialogflow-es

Connect Mega Agent to Sub-Agents, Dialogflow


I am not able to use the mega-agent with the webdemo integration.

Let me describe the process that I have used to create the agents.

  1. Created a mega agent in Dialogflow console. and the project is automatically created with the agent.
  2. Created a sub-agent and added this to the mega agent.
  3. Enabled the webdemo integration in the mega agent. tried to send a message to the mega agent. got this error -

enter image description here

  1. I figured that I have to add the service account for the mega agent to the service account of all the sub-agents to make this work. checked for the service account and found none below the project id.

enter image description here

  1. I went to google cloud console and created the service account and gave Dialogflow API admin permission.

enter image description here

(As you can see the dialogflow API admin role is not showing anywhere)

  1. Then I took this email for the mega agent service account and added it to the sub-agent service account (which I created) and tried to give a Dialogflow API client permission. but the permission is not available.

enter image description here

Now if I cant add this email with the Dialogflow permission I can't access the sub-agent from a mega agent and I cant make any progress with the mega agent integration.

How do I integrate the Mega agent with the Sub-Agents ?

Edit: I was looking at the service accounts sections. but the automatically created accounts are located on the main page on IAM.


Solution

  • I have followed this documentation to create a mega agent and I am able to integrate the mega agent with my sub-agents using Dialogflow Web Demo.

    You can refer to the below steps :

    • Create a mega agent and add sub-agents to your mega agent.
    • The sub-agents will be in different projects as in Dialogflow Essentials you can create only one agent per project.
    • For integrating your mega agent with Dialogflow Web Demo you need to add the service account of the mega agent to your respective sub-agents.
    • Dialogflow provides an automatically created service account of type “service-project-number@gcp-sa-dialogflow.iam.gserviceaccount.com”.
    • When doing integrations you need to select the above automatically generated service account as per this document.
    • This service account for mega agent's project needs to be a member of all sub-agent projects, and the applied role should have permission to make detect intent calls.
    • The various roles that will provide access are : Project Owner, Project Editor, Dialogflow API Admin, or Dialogflow API Client.

    You can also refer to the below screenshots :

    1. Mega Agent

    enter image description here

    2. Service account in mega agent which needs to be added as a member in sub-agent’s project with defined roles. I have used the Dialogflow API Client role:

    enter image description here

    3. Intent and training phrases in sub-agent:

    enter image description here

    4. Integration of mega agent with sub-agent in Dialogflow Web Demo :

    enter image description here