An SDK to Integrate DialogFlow With Golang for Bot Development

DZone 's Guide to

An SDK to Integrate DialogFlow With Golang for Bot Development

DialogFlow, a natural language processing service, offers many SDKs in different programming languages — but not Golang. Until now...

· AI Zone ·
Free Resource

DialogFlow (formerly API.AI) gives users new ways to interact with your bot by building engaging voice- and text-based conversational interfaces powered by AI.

DialogFlow offers many SDKs in different programming languages:

But unfortunately, there’s no SDK for Golang.

But don't be sad! I made an SDK to integrate DialogFlow with Golang:

This library allows integrating agents from the DialogFlow natural language processing service with your Golang application.

Issue the following command to install the library:

go get github.com/mlabouardy/dialogflow-go-client

The example below, display list of entities:

package main

import (

func main() {
    err, client: = NewDialogFlowClient(Options {
        AccessToken: "<DIALOGFLOW TOKEN GOES HERE>",
    if err != nil {

    entities, err: = client.EntitiesFindAllRequest()
    if err != nil {
    for _, entity: = range entities {

Note: For more details about the available methods, check the project's GitHub repository.

For a real-world example on how to use this library, check my previous tutorial on how to create a Messenger Bot in Golang to show a list of movies playing in cinema, and TV shows airing on TV:

That's it! Comment below with any questions or observations.

ai ,bot development ,chatbots ,conversational interfaces ,golang ,nlp ,sdk

Published at DZone with permission of Mohamed Labouardy , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}