DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Is 2025 the year of API-first development and democratization? Take our annual survey and tell us how you implement APIs across your org.

Explore common security challenges that data engineering teams face. Leverage that to build secure data pipelines with Apache Airflow.

GenAI: See the trends surrounding GenAI models, algorithms, implementation, its impacts on code generation, and development as a whole.

80% of respondents actively use Docker. See what other software platforms and tools are most commonly used by developers.

Related

  • An Overview of Kubernetes Security Projects at KubeCon Europe 2023
  • Keep Your Application Secrets Secret
  • GitOps: Flux vs Argo CD
  • Securing Conversations With LLMs

Trending

  • GenAI: From Prompt to Production
  • Different Garbage Collectors in Java: Exploring the Options
  • Stop Wasting Time Writing Code for APIs
  • Leverage Amazon BedRock Chat Model With Java and Spring AI
  1. DZone
  2. Popular
  3. Open Source
  4. Dialogflow CX Agents

Dialogflow CX Agents

This tutorial serves as an introduction to Dialogflow CX agents and how to interact with them using the console and the CXCLI.

By 
Xavier Portilla Edo user avatar
Xavier Portilla Edo
DZone Core CORE ·
Jan. 23, 23 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
2.7K Views

Join the DZone community and get the full member experience.

Join For Free

Previous Requisites

Here are the technologies used in this project

  1. Google Cloud Account
  2. Dialogflow API enabled 
  3. Dialogflow CX CLI

What Is a Dialogflow CX Agent?

An agent in Dialogflow CX is the entity that handles all the conversations that we have defined on the Dialogflow CX console with the end users.

An agent is basically an assistant that will manage the state of each user’s conversation when the end users are interacting with the agent through text or audio in multiple channels.

Dialogflow Console

Dialogflow Console is a web interface where you can design your conversations by creating agents and within an agent, creating flows, intents, entity types, etc. On the Dialogflow Console, you can create and interact easily with your agents. To do that you just need to go to the Dialogflow CX Console. This is what it looks like:

Dialogflow CX Console

Once you have created an agent, you can start building conversations! Things that you can do on the console are:

  1. Export an agent: in blob or JSON format
  2. Delete an agent
  3. Conversational components like flows or pages
  4. Modify your NLU by creating intents and entity types
  5. Test your agent

Dialogflow CX CLI

The Dialogflow CX CLI or cxcli is a command-line interface tool that you can use to interact with your Dialogflow CX projects in a terminal. It is an open-source project. With the cxcli you can interact easily with your Dialogflow CX agents.

All the commands that you have available in the cxcli to interact with your agents are located down the cxcli agent command.

Restore

You can restore an agent using a blob file. Right now the Dialogflow CX API, used by the cxcli, only works with the blob format.

The cxcli has a command that allows you to restore an agent.

This a simple example of the cxcli agent restore command:

cxcli agent restore test-agent --project-id test-cx-346408 --location-id us-central1 --input agent.blob


The command above will give you an output like this one:

$ cxcli agent restore test-agent --project-id test-cx-346408 --location-id us-central1 --input agent.blob
INFO Agent restored 


Export

Also, an agent can be exported as a blob file. Right now the Dialogflow CX API, used by the cxcli, only works with the blob format.

The cxcli has a command that allows you to export your agent.

This a simple example of the cxcli agent export command:

cxcli agent export test-agent --project-id test-cx-346408 --location-id us-central1


The command above will give you an output like this one:

$ cxcli agent export test-agent --project-id test-cx-346408 --location-id us-central1
INFO Agent exported to file: agent.blob                    


Delete

The cxcli has a command that allows you to delete your agent.

Below you will find an example of the cxcli agent delete command:

cxcli agent delete test-agent --project-id test-cx-346408 --location-id us-central1


The command above will give you an output like this one:

$ cxcli agent delete test-agent --project-id test-cx-346408 --location-id us-central1
INFO Agent deleted                          


Resources 

If you want to check the full usage of the cxcli agent command, please refer to this page.

If you want to learn more about Dialogflow CX agents, check the official documentation.

Conclusion 

This was a basic tutorial to learn about a Dialogflow CX Agent. As you have seen in this example, creating an agent and interacting with it either with the console or the cxcli is very easy.

I hope this tutorial will be useful to you.

That’s all folks!

Happy coding!

Command-line interface Dialogflow Conversations (software) Open source

Published at DZone with permission of Xavier Portilla Edo, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • An Overview of Kubernetes Security Projects at KubeCon Europe 2023
  • Keep Your Application Secrets Secret
  • GitOps: Flux vs Argo CD
  • Securing Conversations With LLMs

Partner Resources


Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!