A Dialogflow agent is a virtual agent that handles concurrent conversations with end users. It can translate text or audio during a conversation into structured data that your apps and services can understand. You design and build a Dialogflow agent to handle the types of conversations required for your system.
You can integrate your existing Dialogflow agents with your assistants so that your assistants can use the conversation technology and data that Dialogflow agents provide. When an end user sends a query to the assistant, the Dialogflow agent can be invoked. This query is forwarded to a generative Dialogflow agent, and the returned answer is displayed in the app.
Before you begin
Make sure to have the following before you begin:
- A Dialogflow agent that is in the same project and region as your app. Only the us-central1 region is supported. For how to create an agent, see Create an agent in the public Dialogflow documentation.
Integrate your Dialogflow agent
To integrate your Dialogflow agent, update the assistant with your Dialogflow agent configuration. This registers the Dialogflow agent with the assistant.
Run the following curl command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: PROJECT_ID" \
"https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/engines/APP_ID/assistants/ASSISTANT_ID?updateMask=vertexAiAgentConfigs" \
-d '{
"vertexAiAgentConfigs": [{
"displayName": "AGENT_DISPLAY_NAME",
"name": "projects/PROJECT_ID/locations/global/agents/AGENT_ID",
"toolDescription": "TOOL_DESCRIPTION"
}]
}'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.APP_ID
: the ID of the app to attach your assistant to.ASSISTANT_ID
: the ID of the assistant.AGENT_ID
: the ID of the Dialogflow agent to integrate. This ID is available in the site URL when you view your agent in the console. For example:https://vertexaiconversation.cloud.google.com/projects/PROJECT_ID/locations/LOCATION/agents/AGENT_ID
AGENT_DISPLAY_NAME
: the display name of the agent.TOOL_DESCRIPTION
: the tool description of the agent. This description is used by the LLM to decide whether the agent is relevant to the user question and if the question should be routed to the agent.
Example command and response:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: 1234" \
"https://discoveryengine.googleapis.com/v1alpha/projects/1234/locations/global/collections/default_collection/engines/myapp/assistants/default_assistant" \
-d '{
"vertexAiAgentConfigs": [{
"displayName": "Story teller",
"name": "projects/1234/locations/global/agents/1a2b-cdd31-ef456-7890",
"toolDescription": "Call this agent to ask about ancient Greek mythology, the stories of gods and heroes. If this tool provides an answer, do not rephrase it, but return as is."
}]
}'
------------------
{
"name": "projects/1234/locations/global/collections/default_collection/engines/myapp/assistants/default_assistant",
"vertexAiAgentConfigs": [{
"displayName: "Story teller"
"name": "projects/1234/locations/global/agents/1a2b-cdd31-ef456-7890"
"toolDescription": "Call this agent to ask about ancient Greek mythology, the stories of gods and heroes. If this tool provides an answer, do not rephrase it, but return as is."
}]
}